Skip to content

Commit

Permalink
cpuallocator: don't filter based on single CoreKind.
Browse files Browse the repository at this point in the history
If we have only one type of core present (for instance E-core)
and the caller indicates a priority preference which corresponds
to an unavailable core type (for instance high-prio/P-core), we
don't currently attempt clustered allocation at all, since the
initial CoreKind based filtering filters out all CPU clusters as
unsuitable.

This does not make sense so relax this and only do core type
filtering when we have multiple of them (when running on hybrid
core architectures).

Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Jun 26, 2024
1 parent c1bfca2 commit fcac138
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 @@ -212,15 +212,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 fcac138

Please sign in to comment.