Skip to content

Commit

Permalink
WiP: cpuallocator: don't filter based on single CoreKind.
Browse files Browse the repository at this point in the history
Ditto for CPU clusters: only filter clusters based on CoreKind
if we have multiple of them available.

Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Jun 26, 2024
1 parent 05afcb5 commit 4424d83
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions pkg/cpuallocator/allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,17 @@ func (a *allocatorHelper) takeIdleClusters() {
var (
offline = a.sys.OfflineCPUs()
pickIdle = func(c *cpuCluster) (bool, cpuset.CPUSet) {
// we only take E-clusters for low-prio requests
if a.prefer != PriorityLow && c.kind == sysfs.EfficientCore {
a.Debug(" - omit %s, CPU preference is %s", c, a.prefer)
return false, emptyCPUSet
}
// we only take P-clusters for other than low-prio requests
if a.prefer == PriorityLow && c.kind == sysfs.PerformanceCore {
a.Debug(" - omit %s, CPU preference is %s", c, a.prefer)
return false, emptyCPUSet
if len(a.topology.kind) > 1 {
// we only take E-clusters for low-prio requests
if a.prefer != PriorityLow && c.kind == sysfs.EfficientCore {
a.Debug(" - omit %s, CPU preference is %s", c, a.prefer)
return false, emptyCPUSet
}
// we only take P-clusters for other than low-prio requests
if a.prefer == PriorityLow && c.kind == sysfs.PerformanceCore {
a.Debug(" - omit %s, CPU preference is %s", c, a.prefer)
return false, emptyCPUSet
}
}

// we only take fully idle clusters
Expand Down

0 comments on commit 4424d83

Please sign in to comment.