[Deepin-Kernel-SIG] [linux 6.6-y] [Upstream] [Intel] Intel RDT non-contiguous CBM support#830
Conversation
ANBZ: #8085 commit 39c6eed upstream. Rename arch_has_sparse_bitmaps to arch_has_sparse_bitmasks to ensure consistent terminology throughout resctrl. Intel-SIG: commit 39c6eed x86/resctrl: Rename arch_has_sparse_bitmaps. Incremental backporting patches for Intel RDT on Intel Xeon platform. Suggested-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Peter Newman <peternewman@google.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Babu Moger <babu.moger@amd.com> Tested-by: Peter Newman <peternewman@google.com> Link: https://lore.kernel.org/r/e330fcdae873ef1a831e707025a4b70fa346666e.1696934091.git.maciej.wieczor-retman@intel.com [ Xiaochen Shen: amend commit log ] Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
ANBZ: #8085 commit 0e3cd31 upstream. The setting for non-contiguous 1s support in Intel CAT is hardcoded to false. On these systems, writing non-contiguous 1s into the schemata file will fail before resctrl passes the value to the hardware. In Intel CAT CPUID.0x10.1:ECX[3] and CPUID.0x10.2:ECX[3] stopped being reserved and now carry information about non-contiguous 1s value support for L3 and L2 cache respectively. The CAT capacity bitmask (CBM) supports a non-contiguous 1s value if the bit is set. The exception are Haswell systems where non-contiguous 1s value support needs to stay disabled since they can't make use of CPUID for Cache allocation. Intel-SIG: commit 0e3cd31 x86/resctrl: Enable non-contiguous CBMs in Intel CAT. Incremental backporting patches for Intel RDT on Intel Xeon platform. Originally-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Peter Newman <peternewman@google.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Babu Moger <babu.moger@amd.com> Tested-by: Peter Newman <peternewman@google.com> Link: https://lore.kernel.org/r/1849b487256fe4de40b30f88450cba3d9abc9171.1696934091.git.maciej.wieczor-retman@intel.com [ Xiaochen Shen: amend commit log ] Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
ANBZ: #8085 commit 4dba8f1 upstream. Add the interface in resctrl FS to show if sparse cache allocation bit masks are supported on the platform. Reading the file returns either a "1" if non-contiguous 1s are supported and "0" otherwise. The file path is /sys/fs/resctrl/info/{resource}/sparse_masks, where {resource} can be either "L2" or "L3". Intel-SIG: commit 4dba8f1 x86/resctrl: Add sparse_masks file in info. Incremental backporting patches for Intel RDT on Intel Xeon platform. Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Peter Newman <peternewman@google.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Babu Moger <babu.moger@amd.com> Tested-by: Peter Newman <peternewman@google.com> Link: https://lore.kernel.org/r/7300535160beba41fd8aa073749ec1ee29b4621f.1696934091.git.maciej.wieczor-retman@intel.com [ Xiaochen Shen: amend commit log ] Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
ANBZ: #8085 commit aaa5fa3 upstream. The documentation mentions that non-contiguous bit masks are not supported in Intel Cache Allocation Technology (CAT). Update the documentation on how to determine if sparse bit masks are allowed in L2 and L3 CAT. Intel-SIG: commit aaa5fa3 Documentation/x86: Document resctrl's new sparse_masks. Incremental backporting patches for Intel RDT on Intel Xeon platform. Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Peter Newman <peternewman@google.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Babu Moger <babu.moger@amd.com> Tested-by: Peter Newman <peternewman@google.com> Link: https://lore.kernel.org/r/3e9610997164f648e15c5c2e90d4944ce36504fe.1696934091.git.maciej.wieczor-retman@intel.com [ Xiaochen Shen: amend commit log ] Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
Reviewer's GuideIntroduce Intel RDT non-contiguous CBM support by adding a new sparse_masks sysfs attribute, parsing the noncontiguous bit from CPUID, updating validation logic to accept sparse masks when supported, refactoring internal flags and data structures, and updating documentation accordingly. Sequence Diagram for Reading
|
| Change | Details | Files |
|---|---|---|
| Expose sparse bitmask support via new sysfs interface |
|
arch/x86/kernel/cpu/resctrl/rdtgroup.c |
| Allow non-contiguous CBMs in validation logic |
|
arch/x86/kernel/cpu/resctrl/ctrlmondata.c |
| Detect and initialize sparse bitmask capability via CPUID |
|
arch/x86/kernel/cpu/resctrl/core.c |
| Refactor internal data structures for sparse bitmasks |
|
arch/x86/kernel/cpu/resctrl/internal.hinclude/linux/resctrl.h |
| Update resctrl documentation for sparse_masks |
|
Documentation/arch/x86/resctrl.rst |
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with@sourcery-ai issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull
request title to generate a title at any time. You can also comment
@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in
the pull request body to generate a PR summary at any time exactly where you
want it. You can also comment@sourcery-ai summaryon the pull request to
(re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull
request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the
pull request to resolve all Sourcery comments. Useful if you've already
addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull
request to dismiss all existing Sourcery reviews. Especially useful if you
want to start fresh with a new review - don't forget to comment
@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request
summary, the reviewer's guide, and others. - Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
deepin pr auto review关键摘要:
是否建议立即修改:
|
There was a problem hiding this comment.
Pull Request Overview
This PR backports upstream changes to support Intel RDT non-contiguous cache bitmask (CBM) functionality. Key changes include renaming internal fields from "sparse_bitmaps" to "sparse_bitmasks", updating CPUID parsing and CBM validation logic, and adding a new "sparse_masks" info file with corresponding documentation updates.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| include/linux/resctrl.h | Renames the field to reflect non-contiguous bitmask support. |
| arch/x86/kernel/cpu/resctrl/rdtgroup.c | Introduces a new info file entry to expose the sparse bitmask capability. |
| arch/x86/kernel/cpu/resctrl/internal.h | Adds a CPUID union for non-contiguous bitmask support. |
| arch/x86/kernel/cpu/resctrl/ctrlmondata.c | Updates CBM validation logic to reflect the new sparse bitmask flag. |
| arch/x86/kernel/cpu/resctrl/core.c | Revises CPUID extraction and sets the sparse bitmask flag appropriately for Intel CPUs. |
| Documentation/arch/x86/resctrl.rst | Documents the new "sparse_masks" file and explains the non-contiguous bitmask support. |
There was a problem hiding this comment.
Hey @Avenger-285714 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
bugzilla: https://bugzilla.openanolis.cn/show_bug.cgi?id=8085
About Intel RDT non-contiguous CBM support:
GNR and SRF support L3/L2 non-contiguous way masks. Linux kernel changes is needed to support this.
Legacy RDT only support contiguous bits in L3/L2 CAT Cache Bit Mask (CBM) when allocating L3/L2 cache. For example, 0x111 is a valid bit mask but 0x101 is an invalid bit mask. This is limitation of legacy RDT hardware. It limits user's capability to allocate L3/L2 cache efficiently and cause poor performance.
With non-contiguous bits in L3/L2 CAT, we can allocate L3/L2 cache in various ways and utilize the cache efficiently and improve user application performance.
About the patches:
There are 4 backported upstream patches:
aaa5fa3 Documentation/x86: Document resctrl's new sparse_masks
4dba8f1 x86/resctrl: Add sparse_masks file in info
0e3cd31 x86/resctrl: Enable non-contiguous CBMs in Intel CAT
39c6eed x86/resctrl: Rename arch_has_sparse_bitmaps
Passed tests:
Intel RDT non-contiguous CBM CAT tests: passed.
Link: https://gitee.com/anolis/cloud-kernel/pulls/2740
Summary by Sourcery
Enable and expose Intel RDT hardware support for non-contiguous cache bitmasks by backporting upstream sparse_masks functionality, updating validation logic, renaming internal fields, and updating documentation.
New Features:
Enhancements:
Documentation:
Tests: