Skip to content

Show L3CA/MBA COS definitions per L3 cluster on AMD and Hygon#305

Closed
shenxiaochen wants to merge 3 commits intointel:masterfrom
shenxiaochen:show-cos-per-l3-cluster
Closed

Show L3CA/MBA COS definitions per L3 cluster on AMD and Hygon#305
shenxiaochen wants to merge 3 commits intointel:masterfrom
shenxiaochen:show-cos-per-l3-cluster

Conversation

@shenxiaochen
Copy link
Contributor

Show L3CA/MBA COS definitions per L3 cluster on AMD and Hygon

Description

This PR adds 3 patches (2 preparatory patches) to support showing L3CA/MBA COS definitions per L3 cluster instead of per socket on AMD and Hygon platforms that Platform QoS allocation configuration is per L3 cluster (or Core Complex - CCX).

The output of "pqos -s" looks like:

$ pqos -s
L3CA/MBA COS definitions for L3 Cluster (or Core Complex) 0:
    L3CA COS0 => MASK 0xffff
    ...
    L3CA COS15 => MASK 0xffff
    MBA COS0 => 2048 available
    ...
    MBA COS15 => 2048 available
L3CA/MBA COS definitions for L3 Cluster (or Core Complex) N:
...

Xiaochen Shen (3):
lib: Introduce pqos_cpu_get_l3_clusters
pqos: Introduce print_per_l3_cluster_config
pqos: Show L3CA/MBA COS definitions per L3 cluster on AMD and Hygon

Affected parts

  • library
  • pqos utility
  • rdtset utility
  • other: (please specify)

Motivation and Context

AMD and Hygon Platform QoS allocation configuration is per L3 cluster (or Core Complex - CCX). Each L3 cluster (CCX) has one L3 cluster ID which is used for both CAT and MBA ids.

Show L3CA/MBA COS definitions per L3 cluster instead of per socket on AMD and Hygon platforms. The output of "pqos -s" looks like:

$ pqos -s
L3CA/MBA COS definitions for L3 Cluster (or Core Complex) 0:
    L3CA COS0 => MASK 0xffff
    ...
    L3CA COS15 => MASK 0xffff
    MBA COS0 => 2048 available
    ...
    MBA COS15 => 2048 available
L3CA/MBA COS definitions for L3 Cluster (or Core Complex) N:
...

How Has This Been Tested?

(1) The output of "pqos -s" shows "L3CA/MBA COS definitions for L3 Cluster (or Core Complex) N" on AMD or Hygon platforms.
(2) Passed all tests in intel-cmt-cat/unit-test.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@shenxiaochen
Copy link
Contributor Author

Note: The code base of this PR is on top of #300 and #299

[This PR - #305 ]
7434f28 pqos: Show L3CA/MBA COS definitions per L3 cluster on AMD and Hygon
b27fa65 pqos: Introduce print_per_l3_cluster_config
2dec385 lib: Introduce pqos_cpu_get_l3_clusters

[PR #300 ]
b981133 lib: Set fixed MBM counter length for Hygon
90c603e lib/python: Add support for Hygon Platform QoS features
c5cc545 lib: Add support for Hygon Platform QoS features

[PR #299 ]
6a4d764 lib: Fix incorrect bitmask for MBM counter length

Best regards,
Xiaochen

@shenxiaochen
Copy link
Contributor Author

I would appreciate it if you could review this PR at your convenience. As a heads-up, it depends on PR #300.
Thank you very much!

@rkanagar rkanagar requested a review from Copilot January 21, 2026 12:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for displaying L3CA/MBA COS definitions per L3 cluster instead of per socket on AMD and Hygon platforms, where Platform QoS allocation configuration is per L3 cluster (Core Complex - CCX).

Changes:

  • Adds support for Hygon vendor alongside AMD throughout the codebase
  • Introduces pqos_cpu_get_l3_clusters() function to retrieve L3 cluster IDs
  • Implements print_per_l3_cluster_config() to display per-cluster configuration

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lib/pqos.h Adds PQOS_VENDOR_HYGON enum value and pqos_cpu_get_l3_clusters function declaration
lib/utils.c Implements pqos_cpu_get_l3_clusters to retrieve L3 cluster IDs from CPU info
lib/cpuinfo.c Adds Hygon vendor detection and initialization logic
lib/hw_cap.c Adds Hygon-specific counter length handling for monitoring capabilities
lib/cap.c Routes Hygon to AMD-specific MBA discovery path
lib/api.c Routes Hygon to AMD-specific MBA get/set functions
pqos/alloc.c Implements print_per_l3_cluster_config and updates alloc_print_config to use it for AMD/Hygon
rdtset/rdt.c Updates vendor checks to include Hygon for MBA and display logic
lib/python/pqos/native_struct.py Adds PQOS_VENDOR_HYGON constant
lib/python/pqos/cpuinfo.py Adds Hygon vendor string mapping

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rkanagar
Copy link
Contributor

Hi @shenxiaochen
We are reviewing all PRs now. Please address all the Copilot review comments. Thanks.

@shenxiaochen
Copy link
Contributor Author

Hi @shenxiaochen We are reviewing all PRs now. Please address all the Copilot review comments. Thanks.

@rkanagar Thank you very much for code review! I will address the Copilot review comments inline.

@shenxiaochen shenxiaochen force-pushed the show-cos-per-l3-cluster branch from 7434f28 to c12238b Compare January 28, 2026 06:23
@rkanagar
Copy link
Contributor

Hi @shenxiaochen ,

Please rebase this PR. We are ready to merge.

Thanks,
Raghavan K.

@shenxiaochen shenxiaochen force-pushed the show-cos-per-l3-cluster branch from c12238b to d4b88fa Compare January 28, 2026 16:30
@shenxiaochen
Copy link
Contributor Author

Hi @shenxiaochen ,

Please rebase this PR. We are ready to merge.

Thanks, Raghavan K.

Rebased on top of master tree (after PR #300 merged). Thank you!

@shenxiaochen shenxiaochen force-pushed the show-cos-per-l3-cluster branch from d4b88fa to c0c5c63 Compare January 29, 2026 06:06
@shenxiaochen
Copy link
Contributor Author

Git pushed code to fix the comments mentioned in #305 (review) and #305 (review)

The function pqos_cpu_get_l3_clusters retrieves the L3 cluster id's from
cpu info structure.

This function will be used in pqos function alloc_print_config.

Signed-off-by: Xiaochen Shen <shenxiaochen@open-hieco.net>
The function print_per_l3_cluster_config prints per L3 cluster L3 CAT,
MBA and SMBA class definition.

This function will be used in function alloc_print_config.

Signed-off-by: Xiaochen Shen <shenxiaochen@open-hieco.net>
AMD and Hygon Platform QoS allocation configuration is per L3 cluster
(or Core Complex - CCX). Each L3 cluster (CCX) has one L3 cluster ID
which is used for both CAT and MBA ids.

Show L3CA/MBA COS definitions per L3 cluster instead of per socket on
AMD and Hygon platforms. The output of "pqos -s" looks like:

  $ pqos -s
  L3CA/MBA COS definitions for L3 Cluster (or Core Complex) 0:
      L3CA COS0 => MASK 0xffff
      ...
      L3CA COS15 => MASK 0xffff
      MBA COS0 => 2048 available
      ...
      MBA COS15 => 2048 available
  L3CA/MBA COS definitions for L3 Cluster (or Core Complex) N:
  ...

Signed-off-by: Xiaochen Shen <shenxiaochen@open-hieco.net>
@shenxiaochen shenxiaochen force-pushed the show-cos-per-l3-cluster branch from c0c5c63 to d4e34d4 Compare January 29, 2026 06:31
@rkanagar
Copy link
Contributor

Merged

@rkanagar rkanagar closed this Jan 29, 2026
@shenxiaochen
Copy link
Contributor Author

Merged

@rkanagar Thank you very much for help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants