Repository navigation
DRA: export claimed CPUs to topology-aware containers - #834
Merged
Merged
Conversation
bart0sh
added this pull request to stack #807
October 13, 2026 08:53
bart0sh
force-pushed
the
stacked/bart0sh/DRA/010-export-claimed-cpus
branch
2 times, most recently
from
October 15, 2026 11:34
f144bdb to
f241508
Compare
klihub
force-pushed
the
stacked/bart0sh/DRA/010-export-claimed-cpus
branch
from
October 15, 2026 11:41
f241508 to
0d7382c
Compare
bart0sh
force-pushed
the
stacked/bart0sh/DRA/010-export-claimed-cpus
branch
from
October 15, 2026 12:09
0d7382c to
e79e8c3
Compare
bart0sh
force-pushed
the
stacked/bart0sh/DRA/010-export-claimed-cpus
branch
2 times, most recently
from
October 15, 2026 12:55
f241508 to
b904425
Compare
bart0sh
marked this pull request as ready for review
October 15, 2026 13:48
There was a problem hiding this comment.
🟢 Approval recommended
The additive export uses existing claim accounting consistently, with focused test coverage and no identified blocking issues.
0 open findings
What changed in this PR
Adds CLAIMED_CPUS to topology-aware containers’ exported resource data, keeping DRA claim CPUs separate from their own CPU allocations.
Changes:
- Defines and exports the shared
CLAIMED_CPUSvariable. - Adds unit and end-to-end checks for claimed CPUs and separation from other exported CPU sets.
| File | Description |
|---|---|
test/e2e/policies.test-suite/topology-aware/n4c16/test42-dra-devices/code.var.sh |
Checks claimed and shared CPU exports in containers. |
pkg/resmgr/policy/policy.go |
Defines the claimed-CPU export constant. |
cmd/plugins/topology-aware/policy/topology-aware-policy.go |
Exports nonempty claimed CPU sets. |
cmd/plugins/topology-aware/policy/dra_test.go |
Tests exports with and without claims. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
klihub
force-pushed
the
stacked/bart0sh/DRA/010-export-claimed-cpus
branch
from
October 16, 2026 09:05
b904425 to
dddf38e
Compare
Export the CPUs of the DRA claims of a container in CLAIMED_CPUS, next to its own isolated, exclusive and shared CPUs. Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
askervin
force-pushed
the
stacked/bart0sh/DRA/010-export-claimed-cpus
branch
from
October 16, 2026 11:26
dddf38e to
7299cee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exporting claimed CPUs to topology-aware containers
Tenth PR of the DRA series, on top of #831. Two commits.
As requested in the #821 review,
ExportResourceData()now also exports the CPUs of the DRA claims of a container. The container finds them asCLAIMED_CPUSin/.nri-resource-policy/resources.sh, next toISOLATED_CPUS,EXCLUSIVE_CPUSandSHARED_CPUS. For example, for a container with a claim for CPUs 8-9 and a small CPU request of its own:CLAIMED_CPUSis the union of all claims of the container. The CPUs of each claim are still in theDRA_CPUSET_<claim UID>environment variables in this PR; #852, the next one, drops them, soCLAIMED_CPUSthen becomes the only place. The other variables keep listing only the container's own CPUs, so a claimed CPU that is kernel-isolated is listed only inCLAIMED_CPUS.The name is a common constant in
pkg/resmgr/policy,ExportClaimedCPUs, next to the existing ones. Balloons and template export no resource data, so they are not changed.Commits
topology-aware: export the CPUs of DRA claims.e2e: test exporting claimed CPUs.Extendstest42-dra-devices.Testing
TestExportClaimedCPUscovers a besteffort and an exclusive container holding a claim, and a container holding none. It also checks that the other exported CPU sets have no claimed CPUs.test42-dra-devicespasses on n4c16 with Kubernetes 1.37 and containerd v2.4.1. pod0 exports the CPUs of its claim, pod4 holds no claim and exports none, and pod7, which also has a CPU request of its own, exports its claimed CPUs and the rest of its node asSHARED_CPUS.