← Back to Pull requests

topology-aware: add DRA memory devices and memory claims #902

Open
unknown opened this pull request with 396 lines diff across 4 files
View on GitHub
unknown unknown commented on Nov 19, 2026 19:48 UTC
Author

The topology-aware policy now publishes DRA memory devices next to its CPU devices. A pod can claim memory on a NUMA node, a socket or the machine. The policy pins the containers of the pod to the claimed memory nodes.

The DRA section of the topology-aware docs describes the memory devices and the memory claims. It has an example claim with CPUs and memory on one socket.

Memory devices

  • Each NUMA node with memory gets a device, such as memdevnuma000.

  • Each socket and the machine get one device for each memory type, such as memdevsocket000, memdevsocket000hbm and memdevmachinepmem.

  • A device has the capacity memory. A request takes whole mebibytes. The smallest request is 1Mi.

  • The capacity is the free memory in libmem plus the memory of the claims on the device. The scheduler subtracts those claims itself.

  • The attributes are level, memoryType, dra.cpu/socketID, resource.kubernetes.io/numaNode and resource.kubernetes.io/pcieRoot.
  • Memory claims

  • The policy takes the claimed bytes from libmem. It uses the smallest node group in the device with enough free memory. libmem never moves this memory.

  • A container with a memory claim gets the claimed nodes in cpuset.mems. Its own memory zone stays there too.

  • A container with only memory claims goes to the pool of the claimed nodes. It goes to a wider pool if its own CPUs do not fit there.

  • The policy exports the claimed nodes to the container as CLAIMED_MEMS.

  • A container that does not fit next to a claim gets a wider memory zone. It keeps that zone after the claim is released.

  • A claim keeps its memory nodes across a plugin restart. The restart fails if these nodes no longer have room for the memory.
  • Nodes without CPUs

    A NUMA node without CPUs now gets the package of its closest DRAM node with CPUs. A node with equally close nodes in two packages gets no package. So a socket can now have HBM and PMEM memory devices.

    This also changes the cpu-packages memory policy. It now includes the nodes without CPUs in each socket. The memory-policy plugin uses it too, for instance in its interleave-cpu-packages class.

    Breaking changes

  • The dra.cpu/level attribute is now level, in the topology-aware.nri.io domain. Claims that select dra.cpu/level need the new name.

  • A request without an amount now matches the memory devices too. On a memory device it gets 1Mi. Before this change, such a request always got one CPU. Claims that want CPUs need a dra.cpu/cpu amount.
  • Testing

  • Unit tests cover the memory devices, their capacity, memory claims, cpuset.mems, CLAIMED_MEMS, restarts and the package of nodes without CPUs.

  • golangci-lint reports 0 issues.

  • n4c16 Fedora 43 VM with containerd: test42, test43, test45, test48 and the new test49 passed. test49 claims memory on NUMA and socket devices. It checks cpuset.mems, CLAIMED_MEMS and the capacities of all memory devices. It checks them again after a plugin restart.

  • The e2e runs used an earlier revision of this branch. test49 needs a rerun on this revision.

  • test50 selected dra.cpu/level in that revision. It now selects level. It needs a run too.
  • Diff: 396 lines (+297 / -99) across 4 files Reviewer: bart0sh Review duration: 16297m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.43) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 396 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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.358
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #902"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 43.2% (MEDIUM) · Higher = larger blast radius
    43.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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 23% · Safe to merge
    23%