← Back to Pull requests

topology-aware: publish socket DRA devices #875

Closed
unknown closed this pull request without merging on Nov 06, 2026 16:43 UTC
View on GitHub
unknown unknown commented on Oct 26, 2026 11:19 UTC
Author

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, cpudevsocket001 and 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 (numanode or socket) and dra.cpu/numCPUs. Socket devices have no numaNode. 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 select numaNode without 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.

  • golangci-lint v2.11.4 reports no issues.

  • e2e on Kubernetes 1.37 (DRAConsumableCapacity on 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. With DRAConsumableCapacity=false, test48 is skipped.
  • Diff: 305 lines (+228 / -77) across 3 files Reviewer: askervin Review duration: 16164m
    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
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.2% (MEDIUM) · Higher = larger blast radius
    40.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.9% · Safe to merge
    15.9%