topology-aware: publish socket DRA devices #875
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 305 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.342
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #875"
general
weight: 0.35
askervin
topology-aware published one DRA device per NUMA node, so a claim for more CPUs than one node has needed one request per node. Now every socket is a DRA device too,
cpudevsocket000,cpudevsocket001and so on, next to the NUMA devices. A request on a socket device gets CPUs of one NUMA node when one node has enough free CPUs, otherwise CPUs of several nodes of the socket.Every device gets two new attributes:
dra.cpu/level(numanodeorsocket) anddra.cpu/numCPUs. Socket devices have nonumaNode. A CEL selector which reads an attribute the device does not have fails the allocation of the claim on the node. It does not skip the device. So claims which selectnumaNodewithout checking the level first stop scheduling once the socket devices exist. The docs show the check (device.attributes["dra.cpu"].level == "numanode" && ...), and test42 and test45 use it now.The capacity of a device is now its free CPUs, not its total: the CPUs of the node or socket, minus the reserved CPUs, minus the CPUs containers hold exclusively, minus the whole CPUs the shared containers need. A socket device also leaves out the CPUs of claims on its NUMA nodes. The policy publishes the devices after every allocation change. The kubelet library's ResourceSlice controller merges bursts and writes nothing when the devices did not change.
Owner.DRAEnabled()lets the policy skip building the devices when DRA is off.A claim on a socket device is not bound to its CPUs. When a NUMA claim needs CPUs that a socket claim holds on that node, the socket claim gives up only as many CPUs as needed and gets other CPUs of the socket. Its containers are pinned to the new CPUs and get the new
CLAIMED_CPUS. Their memory stays on the nodes it was on. If the NUMA claim still fails, the moved claims get their old CPUs back.Testing:
go test -race -count=1 ./cmd/plugins/topology-aware/... ./pkg/resmgr/...passes.DRAConsumableCapacityon by default), with an image built from this branch: test42, test43, test45 and the new test48 pass. test48 checks the socket devices and their attributes, a socket claim larger than one node, a socket claim which fits in one node, capacities which follow exclusive containers, and a socket claim which moves when a NUMA claim needs the CPUs of its node. WithDRAConsumableCapacity=false, test48 is skipped.