Skip to content

Commit 9361d91

Browse files
committed
Merge: sched/isolation: Make use of more than one housekeeping cpu
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/993 JIRA: https://issues.redhat.com/browse/RHEL-8694 commit 6432e16 Author: Phil Auld <pauld@redhat.com> Date: Tue Feb 18 18:46:18 2025 +0000 sched/isolation: Make use of more than one housekeeping cpu The exising code uses housekeeping_any_cpu() to select a cpu for a given housekeeping task. However, this often ends up calling cpumask_any_and() which is defined as cpumask_first_and() which has the effect of alyways using the first cpu among those available. The same applies when multiple NUMA nodes are involved. In that case the first cpu in the local node is chosen which does provide a bit of spreading but with multiple HK cpus per node the same issues arise. We have numerous cases where a single HK cpu just cannot keep up and the remote_tick warning fires. It also can lead to the other things (orchastration sw, HA keepalives etc) on the HK cpus getting starved which leads to other issues. In these cases we recommend increasing the number of HK cpus. But... that only helps the userspace tasks somewhat. It does not help the actual housekeeping part. Spread the HK work out by having housekeeping_any_cpu() and sched_numa_find_closest() use cpumask_any_and_distribute() instead of cpumask_any_and(). Signed-off-by: Phil Auld <pauld@redhat.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Waiman Long <longman@redhat.com> Reviewed-by: Vishal Chourasia <vishalc@linux.ibm.com> Acked-by: Frederic Weisbecker <frederic@kernel.org> Link: https://lore.kernel.org/r/20250218184618.1331715-1-pauld@redhat.com Signed-off-by: Phil Auld <pauld@redhat.com> Approved-by: Herton R. Krzesinski <herton@redhat.com> Approved-by: Waiman Long <longman@redhat.com> Approved-by: Juri Lelli <juri.lelli@redhat.com> Approved-by: Wander Lairson Costa <wander@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents 1840239 + 8e1de9e commit 9361d91

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

kernel/sched/isolation.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int housekeeping_any_cpu(enum hk_type type)
4040
if (cpu < nr_cpu_ids)
4141
return cpu;
4242

43-
cpu = cpumask_any_and(housekeeping.cpumasks[type], cpu_online_mask);
43+
cpu = cpumask_any_and_distribute(housekeeping.cpumasks[type], cpu_online_mask);
4444
if (likely(cpu < nr_cpu_ids))
4545
return cpu;
4646
/*

kernel/sched/topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2109,7 +2109,7 @@ int sched_numa_find_closest(const struct cpumask *cpus, int cpu)
21092109
for (i = 0; i < sched_domains_numa_levels; i++) {
21102110
if (!masks[i][j])
21112111
break;
2112-
cpu = cpumask_any_and(cpus, masks[i][j]);
2112+
cpu = cpumask_any_and_distribute(cpus, masks[i][j]);
21132113
if (cpu < nr_cpu_ids) {
21142114
found = cpu;
21152115
break;

0 commit comments

Comments
 (0)