Re: [BUG] sched: BUG() in select_fallback_rq() at boot with isolcpus=domain on the boot CPU and CONFIG_CPUSETS=n
From: Waiman Long
Date: Fri Nov 20 2026 - 12:31:59 EST
On 11/20/26 11:52 AM, Waiman Long wrote:
On 11/19/26 11:03 AM, Frederic Weisbecker wrote:
Le Wed, Nov 18, 2026 at 10:55:35AM -0500, Waiman Long a écrit :
On 11/18/26 9:49 AM, Frederic Weisbecker wrote:Agreed.
Le Tue, Nov 17, 2026 at 10:13:02AM -0500, Waiman Long a écrit :The upcoming runtime modification of nohz_full CPU will not support the boot
On 11/17/26 9:48 AM, Mathieu Desnoyers wrote:You can try that, hopefully nobody relies on that. nohz_full supports the
Hi,I am now thinking about disallowing the boot CPU from being domain isolated.
With CONFIG_CPUSETS=n, a kernel booted with isolcpus=domain,0 hits the
BUG() in select_fallback_rq() during boot. CPU 0 is the boot CPU. I
found it while testing a SCHED_DEADLINE series [1]. I then reproduced
it on v7.4-rc2 alone. tip/master of 2026-11-17 and next-20261116 have
the same code. A proposed fix follows the scissors line.
Trigger
=======
Build x86-64 with CONFIG_CPUSETS=n. Boot a VM of 4 CPUs with
isolcpus=domain,0 or isolcpus=domain,0,1. The kernel panics before
init runs, in every boot.
These boot fine:
- the same kernel with isolcpus=domain,1,2, or without isolcpus;
- a kernel with CONFIG_CPUSETS=y, with isolcpus=domain,0,1.
That will include using isolcpus=domain boot time isolation parameter as
well as in setting up isolated cpuset partition. Will that be a simpler
solution than fixing all these places where isolating the boot CPU will
cause various problems that need to be fixed?
boot CPU to be isolated but it's a heresy.
CPU
at least for x86, as the boot CPU cannot be made offline.We should forbid that on all archs.
I would notIt's already supported and unfortunately we can't remove that as that would
recommend putting the boot CPU into nohz_full boot parameter, though we are
not going to forbid it.
break kernel ABI.
I just found that that CPU 0 will be automatically cleared from the nohz_full list in tick_nohz_init() for CONFIG_PM_SLEEP_SMP && !CONFIG_PM_SLEEP_SMP_NONZERO_CPU kernels. IOW, that means most kernel will do CPU 0 cleariing. Although we don't explicitly say that CPU 0 cannot be a nohz_full CPU, most kernels will not allow that.
Thinking about it, the clearing is done on the tick_nohz_full_mask which is used by the timekeeping code and in /sys/devices/system/cpu/nohz_full. So from a user point of view CPU 0 isn't in the nohz_full list. However, the HK_TYPE_KERNEL_NOISE cpumask will also have CPU 0 missing. This is inconsistent. Should we fix that by setting the bit 0 of HK_TYPE_KERNEL_NOISE cpumask when it is cleared from the tick_nohz_full_mask?
Regards,
Longman