Skip to content

Commit 2709dd5

Browse files
committed
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()
2 parents 0d78592 + 23906f3 commit 2709dd5

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎include/linux/cpuset.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ static inline void dl_rebuild_rd_accounting(void)
279279

280280
static inline void rebuild_sched_domains(void)
281281
{
282+
guard(cpus_read_lock)();
282283
partition_sched_domains(1, NULL, NULL);
283284
}
284285

‎kernel/sched/fair.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4934,7 +4934,12 @@ static int tg_cpus(struct task_group *tg)
49344934
nr = cpuset_num_cpus(cgrp);
49354935
}
49364936

4937-
return nr;
4937+
/*
4938+
* An empty cpuset would propagate a 0 shares_max into
4939+
* __calc_smp_shares(), where clamp() yields hi when hi < lo and so
4940+
* defeats the MIN_SHARES floor. Match tg_tasks(), which floors at 1.
4941+
*/
4942+
return max(nr, 1);
49384943
}
49394944

49404945
static inline int tg_tasks(struct task_group *tg)

0 commit comments

Comments
 (0)