New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kubelet: consider real CPU topology when check Core/Socket free #124561
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,13 +251,13 @@ func (a *cpuAccumulator) isNUMANodeFree(numaID int) bool { | |
// Returns true if the supplied socket is fully available in `a.details`. | ||
// "fully available" means that all the CPUs in it are free. | ||
func (a *cpuAccumulator) isSocketFree(socketID int) bool { | ||
return a.details.CPUsInSockets(socketID).Size() == a.topo.CPUsPerSocket() | ||
return a.details.CPUsInSockets(socketID).Size() == a.topo.CPUDetails.CPUsInSockets(socketID).Size() | ||
} | ||
|
||
// Returns true if the supplied core is fully available in `a.details`. | ||
// "fully available" means that all the CPUs in it are free. | ||
func (a *cpuAccumulator) isCoreFree(coreID int) bool { | ||
return a.details.CPUsInCores(coreID).Size() == a.topo.CPUsPerCore() | ||
return a.details.CPUsInCores(coreID).Size() == a.topo.CPUDetails.CPUsInCores(coreID).Size() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. considering the issue #124066 as example, with this change the offlined core (id=25) won't be used, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, thanks |
||
} | ||
|
||
// Returns free NUMA Node IDs as a slice sorted by sortAvailableNUMANodes(). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if
CPUsPerSocket
is no longer used (it should be the case) let's delete itThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done it