Improve the CPU pinning logic for BatchExecutor. - #5390
Merged
Conversation
- De-prioritize core 0 to decrease the probability of clashing with OS house-keeping - Pin hyper-threaded cores first if we run out of physical cores, and never wrap around the list (leave the over-subscribed rest workers unpinned)
Contributor
There was a problem hiding this comment.
Pull request overview
Improves Linux CPU affinity ordering for BatchExecutor.
Changes:
- De-prioritizes CPU 0’s physical core.
- Uses hyper-thread siblings after distinct physical cores.
- Leaves excess workers unpinned.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/util/BatchExecutor.h |
Updates pinning state and documentation. |
src/util/BatchExecutor.cpp |
Implements topology-aware CPU ordering and oversubscription handling. |
Comments suppressed due to low confidence (1)
src/util/BatchExecutor.cpp:94
- This comment repeats the inaccurate absolute-last guarantee: on restricted or heterogeneous affinity sets, later sibling tiers can follow CPU 0. The rotation only guarantees that CPU 0 follows the other allowed CPUs from its own core.
// Demote CPU 0 behind its own hyper-thread siblings so it becomes the
// very last CPU we pin.
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.
Description
Checklist
clang-formatv8.0.0 (viamake formator the Visual Studio extension)