fix(scheduler): use phase-aware accounting during NUMA refit - #2868
Conversation
…nd app memory as concurrent Signed-off-by: asadjan4611 <asadjan4611@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe NUMA refit path now rebuilds candidate capacity from phase-aware init and application container usage. It aggregates per-device reservations, applies candidate-specific usage, releases recorded slot counts, and rejects unsupported device types. Tests cover sidecars, multiple applications, and Enflame validation. ChangesNUMA refit accounting
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: 🔵 Low · up to NUMA refit now avoids double-counting regular init and application memory, allowing valid placements while keeping sidecars concurrent. The change is mergeable with owner awareness that an interruption during the annotation and accounting update sequence could temporarily leave scheduler reservations inconsistent. Sequence Diagram(s)sequenceDiagram
participant RefitNumaAllocation
participant PodManager
participant effectivePodDeviceUsage
participant CandidateDeviceCapacity
RefitNumaAllocation->>PodManager: release moved-container usage
RefitNumaAllocation->>effectivePodDeviceUsage: calculate effective phase usage
effectivePodDeviceUsage->>CandidateDeviceCapacity: preload candidate-specific usage
CandidateDeviceCapacity-->>RefitNumaAllocation: return capacity-fit result
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation The changes address issue Full details: Out of Scope Changes checkExplanation The phase-aware accounting changes are in scope for issue
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 102 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Signed-off-by: asadjan4611 <asadjan4611@gmail.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: archlitchi, asadjan4611 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
NUMA refit previously treated a pod's regular init-container memory and application-container memory as concurrent usage. This could reject a valid placement with
CardInsufficientMemory.This PR uses HAMi's existing init-container accounting rules while checking allowed NUMA devices. Regular init and application usage now use their phase peak, while sidecars and application containers remain concurrent.
The candidate calculation reuses
CollapseInitContainerUsageandSteadyStateDeviceUsage. It preserves the accounting of other pods and updates the cached reservation after a successful refit.Which issue(s) this PR fixes:
Fixes #2856
Special notes for your reviewer:
Regression tests cover:
Only the NUMA-refit implementation and its focused scheduler tests are changed.
AI assistance disclosure:
I used OpenAI Codex to review the implementation and for this PR description.
Does this PR introduce a user-facing change?:
Summary by CodeRabbit
Bug Fixes
Tests