From 430e7fc05c2f6dedb4bba450e32cc6739680285a Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Wed, 26 Jun 2024 14:20:31 +0300 Subject: [PATCH] cpuallocator: use clustered allocation only with hybrid cores. Use explicit cluster info based allocation only on hybrid core platforms. In other cases omit it altogether only using cache group based allocation. These should provide identical groups but for cache groups we do have partial allocation implemented while for cluster groups we don't have ATM. Signed-off-by: Krisztian Litkey --- pkg/cpuallocator/allocator.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pkg/cpuallocator/allocator.go b/pkg/cpuallocator/allocator.go index 1d34247c1..3644094ad 100644 --- a/pkg/cpuallocator/allocator.go +++ b/pkg/cpuallocator/allocator.go @@ -1072,11 +1072,17 @@ func (a *allocatorHelper) allocate() cpuset.CPUSet { if (a.flags & AllocIdlePackages) != 0 { a.takeIdlePackages() } - if a.cnt > 0 && (a.flags&AllocIdleClusters) != 0 { - a.takeIdleClusters() - } - if a.cnt > 0 && (a.flags&AllocCacheGroups) != 0 { - a.takeCacheGroups() + if len(a.topology.kind) > 1 { + if a.cnt > 0 && (a.flags&AllocIdleClusters) != 0 { + a.takeIdleClusters() + } + if a.cnt > 0 && (a.flags&AllocCacheGroups) != 0 { + a.takeCacheGroups() + } + } else { + if a.cnt > 0 && (a.flags&AllocCacheGroups) != 0 { + a.takeCacheGroups() + } } if a.cnt > 0 && (a.flags&AllocIdleCores) != 0 { a.takeIdleCores()