summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-08-22 16:40:23 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-08-22 16:40:23 -0700
commit2709dd5ae32f0828f386327c76bba9f39f63a1c6 (patch)
tree5160cb7dc810e560e65a07fa9afc7573a7baabd3 /kernel
parent0d78592583949b531318b51763ade7ff536ba9bc (diff)
parent23906f3a1686c737bf356fdd21183b40722b2437 (diff)
Merge tag 'sched-urgent-2026-08-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fixes from Ingo Molnar: - Add missing cpus_read_lock locking to rebuild_sched_domains() (Sebastian Andrzej Siewior) - Fix division by zero bug in tg_cpus() that can be triggered with empty cpusets (Jake Steinman) * tag 'sched-urgent-2026-08-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: Floor tg_cpus() at 1 sched/topology: Add a cpus_read_lock to rebuild_sched_domains()
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/fair.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 001140132a7d..6d881e530f89 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4934,7 +4934,12 @@ static int tg_cpus(struct task_group *tg)
nr = cpuset_num_cpus(cgrp);
}
- return nr;
+ /*
+ * An empty cpuset would propagate a 0 shares_max into
+ * __calc_smp_shares(), where clamp() yields hi when hi < lo and so
+ * defeats the MIN_SHARES floor. Match tg_tasks(), which floors at 1.
+ */
+ return max(nr, 1);
}
static inline int tg_tasks(struct task_group *tg)