From nobody Tue Nov 24 11:45:52 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795494509; b=Q/b+YttuVU/rdsK9K1ZjUGYo7OTswnqsWq2iocugO2t/dRPTimaCUzne24uCccvsRCNd SUym8KarlhAlGmDDCCEu6X5v27hsekaSZpyTvfVdteX4ZSM16C1rV2eiiLxCdyxHcWV5k 5vORdxUgPsEMO2LG4nWiIYglO4f7pb4dmlIRcf23P+1W1YAXKl4URICCiMxdPmRCDd/7+ nGbBVA6JufO0VvzE7ReIXZwXQq3Wm9APmceu5npflYyv8riZu0Eu7A1pBL/jeaLVeEn7r aY0WT1o/c7PGIE8xevKWTK6Xs5dLKRG4QwhH8xPBOjkIWK34bApkIhjvEWAWGfyZKfQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795494509; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:From:To:Cc:Subject:Date: Message-ID:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Scanned-By; bh=B5Nbip6TzYi7GMeSs8uz5LlNsZqZbiwKYLK2KGz0yaE=; b=b37xJBX4vbUBQD4ZknkgO8fv9QLgJErINKSJY3t5gziraX3U1FY/iM0JVNjv+V26gZXA /kRn65X2/hWja6f160XBTt5JjWudxSjv/fth7zFX0B12lA4QzwhoecqIkq2guLcoHvY5v a/Z97A1eff4x6cI3/iZZDdRRddAUBsSM4/AGGdZxhAryDY062ipNNuM73vqCBAAUEGMMM ny7Sfi5CT3T0p9donLox5l/AzmfHwHsNjUtzSXi7mJKkZpvE3UsgTX0Aq5L8IKLubkv8F JMLlkg9e97f9iwrSG+0xZazwtVKkUD1+AEFVZWKJOi/0oZAuJAnjydSyzcQ8MrnsAFw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ddx81BVA; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 103E3606A32A for ; Tue, 24 Nov 2026 04:28:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 103E3606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ddx81BVA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795494508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B5Nbip6TzYi7GMeSs8uz5LlNsZqZbiwKYLK2KGz0yaE=; b=ddx81BVAmA+vvMqr0uOmCBCiSeOiOCq759E3hlvsWwCM/+vQR2m3ZP2CI9TrPTuEL14uwh IXo6Q+jtgdE3pWvXCTDjcfQluaApNZr5xbluM0ouoAWS0r/rFFjh6HfUPs1lAqg1I0n/3C vZ0LSJ8s7PVXD/laT6zpoN2cDdxKhqc= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-661-g94d1F3YMbmZc3nWerwmGQ-1; Tue, 24 Nov 2026 04:28:23 +0000 X-MC-Unique: g94d1F3YMbmZc3nWerwmGQ-1 X-Mimecast-MFC-AGG-ID: g94d1F3YMbmZc3nWerwmGQ_1795494500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 79D711955DE1; Tue, 24 Nov 2026 04:28:19 +0000 (UTC) Received: from llong-thinkpadp16vgen1.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ABF3818004F7; Tue, 24 Nov 2026 04:28:14 +0000 (UTC) From: Waiman Long To: Tejun Heo , Johannes Weiner , =?UTF-8?q?Michal=20Koutn=C3=BD?= , Jonathan Corbet , Shuah Khan , Randy Dunlap , Ridong Chen , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner Cc: cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Guopeng Zhang , Mathieu Desnoyers , Waiman Long , Guopeng Zhang Subject: [PATCH-next v3 1/3] tick/sched: Make tick_nohz_full_mask and HK_TYPE_KERNEL_NOISE cpumask consistent Date: Mon, 23 Nov 2026 23:28:00 -0500 Message-ID: <20261124042802.532633-2-longman@redhat.com> In-Reply-To: <20261124042802.532633-1-longman@redhat.com> References: <20261124042802.532633-1-longman@redhat.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Type: text/plain; charset="utf-8" When the nohz_full boot parameter is first set, the cpu list parameter is passed directly to tick_nohz_full_setup() to set up tick_nohz_full_mask cpumask. Then the HK_TYPE_KERNEL_NOISE cpumask will be set up as the inverse of given cpu list parameter. Some of the timer code and RCU uses tick_nohz_full_mask directly while other timer code, scheduler and other subsystems use the HK_TYPE_KERNEL_NOISE cpumask. With CONFIG_PM_SLEEP_SMP && !CONFIG_PM_SLEEP_SMP_NONZERO_CPU config options, the boot CPU will be cleared from tick_nohz_full_mask if set while the corresponding HK_TYPE_KERNEL_NOISE cpumask isn't touched. The nohz_full entry in kernel-parameters.txt does state that the boot CPU will be forced outside the range to maintain the timekeeping. So it makes sense that the HK_TYPE_KERNEL_NOISE should be modified accordingly. Fix this inconsistency problem by adding a new cpumask_set_cpu() init function to be called by tick_nohz_init() when the boot CPU is cleared from tick_nohz_full_mask. In the special case that "nohz_full=3D0" and CPU 0 is cleared in tick_nohz_init(), tick_nohz_full_running will be set to false. However, housekeeping_enabled(HK_TYPE_KERNEL_NOISE) will stil be true with housekeeping_cpumask(HK_TYPE_KERNEL_NOISE) equal to cpu_possible_mask. So some unneeded code paths will be activated, but no harm will be done other than wasting some CPU cycles. Another problem that needs further thought but is not handled in this patch is when arch_irq_work_has_interrupt() turns out to be false. When this happens, tick_nohz_full_mask will be cleared and tick_nohz_full_running will be set back to false in tick_nohz_init(). PM_SLEEP_SMP_NONZERO_CPU depends on ARCH_SUSPEND_NONZERO_CPU which can only be set for the PowerPC architecture. Moreover CONFIG_PM_SLEEP_SMP is on by default, it means most kernels will not allow CPU 0 to be set in the tick_nohz_full_mask and hence should be set in HK_TYPE_KERNEL_NOISE cpumask. Fixes: 6f1982fedd59 ("sched/isolation: Handle the nohz_full=3D parameter") Signed-off-by: Waiman Long Reviewed-by: Frederic Weisbecker Reviewed-by: Ridong Chen Acked-by: Guopeng Zhang Tested-by: Guopeng Zhang --- include/linux/sched/isolation.h | 2 ++ kernel/sched/isolation.c | 11 +++++++++++ kernel/time/tick-sched.c | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolatio= n.h index cf0fd03dd7a2..ae5109450ac9 100644 --- a/include/linux/sched/isolation.h +++ b/include/linux/sched/isolation.h @@ -44,6 +44,7 @@ extern bool housekeeping_enabled(enum hk_type type); extern void housekeeping_affine(struct task_struct *t, enum hk_type type); extern bool housekeeping_test_cpu(int cpu, enum hk_type type); extern int housekeeping_update(struct cpumask *isol_mask); +extern void __init housekeeping_set_cpu(int cpu, enum hk_type type); extern void __init housekeeping_init(void); =20 #else @@ -72,6 +73,7 @@ static inline bool housekeeping_test_cpu(int cpu, enum hk= _type type) } =20 static inline int housekeeping_update(struct cpumask *isol_mask) { return = 0; } +static inline void housekeeping_set_cpu(int cpu, enum hk_type type) { } static inline void housekeeping_init(void) { } #endif /* CONFIG_CPU_ISOLATION */ =20 diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c index 156025ef81b7..c0c8b8862cbd 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -120,6 +120,17 @@ bool housekeeping_test_cpu(int cpu, enum hk_type type) } EXPORT_SYMBOL_GPL(housekeeping_test_cpu); =20 +void __init housekeeping_set_cpu(int cpu, enum hk_type type) +{ + /* Only CPU setting of HK_TYPE_KERNEL_NOISE is currently supported */ + if (type !=3D HK_TYPE_KERNEL_NOISE) + return; + + if (static_branch_unlikely(&housekeeping_overridden) && + READ_ONCE(housekeeping.flags) & BIT(type)) + cpumask_set_cpu(cpu, housekeeping_cpumask_dereference(type)); +} + int housekeeping_update(struct cpumask *isol_mask) { struct cpumask *trial, *old =3D NULL; diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 255488366d7c..99ca2982e29d 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -683,6 +684,11 @@ void __init tick_nohz_init(void) pr_warn("NO_HZ: Clearing %d from nohz_full range " "for timekeeping\n", cpu); cpumask_clear_cpu(cpu, tick_nohz_full_mask); + housekeeping_set_cpu(cpu, HK_TYPE_KERNEL_NOISE); + if (cpumask_empty(tick_nohz_full_mask)) { + tick_nohz_full_running =3D false; + return; + } } } =20 --=20 2.56.1 From nobody Tue Nov 24 11:45:52 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795494513; b=aI0UEbyRhrfR9em8Hdx6VWSvxE0ruDTLmCof/g55WK32OOPXuzQDvQD+0965BIlo32Vc uVBaPPuW+X+ROLMZoHIdSYoTzMpDYhOMXwgyhDEoZfqUQjSUDIza7exTi5M4cLMLb9K/Z 0OdeYGX6Pb/GDMKyX2yHeeuDXY3/oJvZxheU0zGKIcydKMUCSGqDjgRAANHhJHxhVDD8O 5Ey2UjV6AR6CKS2/TuOgemUIbTZ3DvF/0cj7r/bgzg1UyYuFyC/gLC+Jo4ex4shtoX9gC VCdo3YD9tUQxDr22Im8KraKOiN0k0YJyfXQBxpHPoOe2ldTYwN2gpyAty4IZ1itreaw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795494513; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:From:To:Cc:Subject:Date: Message-ID:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Scanned-By; bh=mnbVql9exwLWONX5EZsGWnq9Up0Dw115AfwnQc3AkO8=; b=HZp5TVoQMFZop/WU6L8s7fmMbgzmIpFXwN3V+a+8WUKh2wlXy1HbBt0Hx8odmH4tC1do eN7WvOz4uuuypRXhmziF9RUVR2jx6eCjlyYpeLQcUiBiGzEmHOG7jbcY5/MS4BxyWU+lH GxyYXo5lx8tk8iuijaDgiG4LEjpwnw6I/LRKnZ5Mv0hI+zR0j5iQoqOclDCUnUPa1rFyR +of8ras8kOIDdhl9X+9nxCbZFi14AkBsPKFzjxJ/xT6UEE1qgp1C9538IhocLzu4Ihpbk hkS7Ztp5uyviDZZGCUOTQfFHWVf819TzNWCIQAGW7N3I551usv9rJbprBZXcxSxvY3w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ajw3EdKm; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93905606A695 for ; Tue, 24 Nov 2026 04:28:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 93905606A695 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ajw3EdKm DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795494511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mnbVql9exwLWONX5EZsGWnq9Up0Dw115AfwnQc3AkO8=; b=ajw3EdKmDWey4gxYK0qhrEOsVomyyY6DEU0mJv3jGWmgh1dat8KFMUAU1JneiZrVnNXQJj /aw7ePOWfQcdUkDA0hr0UX5z+0947z7u8Nhkv4NF7fQWodP7P468F1aRLkqcRr1QZA9pd0 E2zQtmwPBlYWHaMcETwhmKGV2AlYqyY= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-673-7_w97j7TNDm5ga3lMsbyeQ-1; Tue, 24 Nov 2026 04:28:27 +0000 X-MC-Unique: 7_w97j7TNDm5ga3lMsbyeQ-1 X-Mimecast-MFC-AGG-ID: 7_w97j7TNDm5ga3lMsbyeQ_1795494504 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5101619773CA; Tue, 24 Nov 2026 04:28:24 +0000 (UTC) Received: from llong-thinkpadp16vgen1.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B30481800551; Tue, 24 Nov 2026 04:28:19 +0000 (UTC) From: Waiman Long To: Tejun Heo , Johannes Weiner , =?UTF-8?q?Michal=20Koutn=C3=BD?= , Jonathan Corbet , Shuah Khan , Randy Dunlap , Ridong Chen , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner Cc: cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Guopeng Zhang , Mathieu Desnoyers , Waiman Long , Guopeng Zhang Subject: [PATCH-next v3 2/3] sched/isolation: Forbid the boot CPU from being domain isolated Date: Mon, 23 Nov 2026 23:28:01 -0500 Message-ID: <20261124042802.532633-3-longman@redhat.com> In-Reply-To: <20261124042802.532633-1-longman@redhat.com> References: <20261124042802.532633-1-longman@redhat.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Type: text/plain; charset="utf-8" It is reported that with CONFIG_CPUSETS=3Dn, a kernel booted with isolcpus=3Ddomain,0 hits the BUG() in select_fallback_rq() during boot [1]. At boot time, cpu 0 is the only CPU online and an unbound kworker cannot be run on a domain isolated CPU causing kernel panic. Sashiko also reports that domain isolating the boot CPU can break system suspend and trigger a BUG_ON() [2]. So it is problematic if the boot CPU is domain isolated. There may be other kernel subsystems that have problem if the boot CPU is domain isolated as most of them won't take into account the fact that boot CPU is currently allowed to be domain isolated. Given the fact that the boot CPU is likely to be disallowed from the nohz_full list, it makes sense that we should not allow the boot CPU from being set in the isolcpus boot parameter as well. This will also avoid the kind of problems listed above. Do that by clearing the boot CPU from the isolcpus range when it is specified in the boot command line. A warning may also be printed when that happens. If the users want to have boot CPU in the managed_irq or nohz isolation list, a standalone isolcpus boot parameter will be needed instead of combining domain and other flags in the same isolcpus boot parameter. This is indeed a change in behavior which is customer visible. So the kernel-paremeters.txt is updated to mention the fact that boot CPU cannot be isolated. [1] https://lore.kernel.org/lkml/20261117144817.265109-1-mathieu.desnoyers@= efficios.com [2] https://sashiko.dev/#/patchset/20261108180849.1268263-1-longman%40redha= t.com Signed-off-by: Waiman Long Reviewed-by: Frederic Weisbecker Acked-by: Guopeng Zhang Tested-by: Guopeng Zhang Reviewed-by: Ridong Chen --- .../admin-guide/kernel-parameters.txt | 7 +++--- kernel/sched/isolation.c | 22 +++++++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentatio= n/admin-guide/kernel-parameters.txt index 930cee4de79a..1c8bf3583b0b 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2954,11 +2954,12 @@ Kernel parameters =20 You can move a process onto or off an "isolated" CPU via the CPU affinity syscalls or cpuset. - begins at 0 and the maximum value is - "number of CPUs in system - 1". + begins at 0 and the maximum value + is "number of CPUs in system - 1". However boot + CPU (cpu 0) cannot be domain isolated as it + may cause problem with some kernel subsystems. =20 managed_irq - Isolate from being targeted by managed interrupts which have an interrupt mask containing isolated CPUs. The affinity of managed interrupts is diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c index c0c8b8862cbd..de8152351450 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -231,6 +231,7 @@ static int __init housekeeping_setup(char *str, unsigne= d long flags) { cpumask_var_t non_housekeeping_mask, housekeeping_staging; unsigned int first_cpu; + int boot_cpu =3D smp_processor_id(); int err =3D 0; =20 if ((flags & HK_FLAG_KERNEL_NOISE) && !(housekeeping.flags & HK_FLAG_KERN= EL_NOISE)) { @@ -253,12 +254,25 @@ static int __init housekeeping_setup(char *str, unsig= ned long flags) =20 first_cpu =3D cpumask_first_and(cpu_present_mask, housekeeping_staging); if (first_cpu >=3D nr_cpu_ids || first_cpu >=3D setup_max_cpus) { - __cpumask_set_cpu(smp_processor_id(), housekeeping_staging); - __cpumask_clear_cpu(smp_processor_id(), non_housekeeping_mask); + __cpumask_set_cpu(boot_cpu, housekeeping_staging); + __cpumask_clear_cpu(boot_cpu, non_housekeeping_mask); if (!housekeeping.flags) { - pr_warn("Housekeeping: must include one present CPU, " - "using boot CPU:%d\n", smp_processor_id()); + pr_warn("Housekeeping: must include one present CPU, using boot CPU:%d\= n", + boot_cpu); } + } else if ((flags & HK_FLAG_DOMAIN) && + cpumask_test_cpu(boot_cpu, non_housekeeping_mask)) { + /* + * If the same isolcpus boot parameter covers both domain and + * managed_irq/nohz, the boot CPU will also be removed from the + * managed_irq/nohz isolation list. Users have to use a separate + * isolcpus boot parameter for them if they want to include the + * boot CPU. + */ + pr_warn("Housekeeping: Boot CPU must not be domain isolated, clearing %d= from isolcpus range\n", + boot_cpu); + __cpumask_set_cpu(boot_cpu, housekeeping_staging); + __cpumask_clear_cpu(boot_cpu, non_housekeeping_mask); } =20 if (cpumask_empty(non_housekeeping_mask)) --=20 2.56.1 From nobody Tue Nov 24 11:45:52 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795494517; b=p2wa5ACVvGudAmjl+PQ84tMEffPGHu/vBpD8eEa4vTMyPAIPkUg3hvW+Vo3J5SowIF93 ZNuve+2wR6EkaHeL6O2I/m4Z+N1eNeiZNnH3ASC79aLNq74xofH92ON88WVMXPmkuQRIE sxONYPmZm+tdChGHZNUGtk+nfiCeEFLMU2zZJF4uwg+kfr8DH5ZgJkMgxYXFG4QXNQmN0 1vB07IgkZj5E8KMmvdE+MAnPkIucolzIXHsZ1ugZzT4tM+pgZeu2m7PtVNJDouvL5LmpQ uN3/gUtNheUWLBWrcaM7+ciAUp3TzVCluZdFBh9YSYzKi4m0H4xgbT84UUoE3v8Juuw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795494517; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:From:To:Cc:Subject:Date: Message-ID:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Scanned-By; bh=rndbTR2+ZFvyQVJESHNg9NlEd24FYBrwIE07n7H4r5k=; b=O4j+OiHHyxSNJQzGYCKd1YtfHw2wczLgk0Z2wWCvYl8MuQRaU8sATYeDSmveJgMpAQFR inNuwJgdKIODbQ4sEetH/y3u09FdGYkabZWLZGppnxMKRorV0yXak58TvTWTj+uQ/lwpa hYU06wSlBhzSBFZl1F4AnQd8Wus/soV8mZ2F2ojPVUJrO5q7vFXVofn8PqGZTe3OtY+Hr UIgPWjW02XlO4tFJd/HEs5tm1ySOgnele6mtn+IxNEVZco1uAc1IPtFFV/xLBgCrgMjbS Fr2wGtz2HwRxMKygNIcAsn0+SAr84jtJ7fuRKXHMwI8yLFJw34XuiLmQVcobYjJS1mQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=IUCblGea; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E928606A693 for ; Tue, 24 Nov 2026 04:28:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0E928606A693 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=IUCblGea DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795494515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rndbTR2+ZFvyQVJESHNg9NlEd24FYBrwIE07n7H4r5k=; b=IUCblGeaPtPehBTb0YTQh7hMGRweYI2PItT9c2Q1Vgujf67eDiWBHcf0pFF474hwsCARvI dVktMdKG2j3291t4mEM1MW1miiQXCTF0VsuPiDCDoyf5gipQe9Ul715WFpn6n2R3lL4kiH lC8CBiHCAZ9HDKDXmOB90Ln00JJe3VQ= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-227-6Ppd9m97Ov-dF76gOAhp4w-1; Tue, 24 Nov 2026 04:28:31 +0000 X-MC-Unique: 6Ppd9m97Ov-dF76gOAhp4w-1 X-Mimecast-MFC-AGG-ID: 6Ppd9m97Ov-dF76gOAhp4w_1795494508 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 58DA01800471; Tue, 24 Nov 2026 04:28:28 +0000 (UTC) Received: from llong-thinkpadp16vgen1.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8B8521801977; Tue, 24 Nov 2026 04:28:24 +0000 (UTC) From: Waiman Long To: Tejun Heo , Johannes Weiner , =?UTF-8?q?Michal=20Koutn=C3=BD?= , Jonathan Corbet , Shuah Khan , Randy Dunlap , Ridong Chen , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner Cc: cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Guopeng Zhang , Mathieu Desnoyers , Waiman Long Subject: [PATCH-next v3 3/3] cgroup/cpuset: Disallow CPU 0 from being used in isolated partition Date: Mon, 23 Nov 2026 23:28:02 -0500 Message-ID: <20261124042802.532633-4-longman@redhat.com> In-Reply-To: <20261124042802.532633-1-longman@redhat.com> References: <20261124042802.532633-1-longman@redhat.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Type: text/plain; charset="utf-8" Domain isolating CPU 0 can be problematic and may even cause panic in some cases. In the near future, we are going to enable dynamic change to the nohz_full CPUs to include the CPUs that are in isolated partitions via the CPU hotplug mechanism. However, CPU 0 can't be made offline for some architectures like x86. IOW, putting CPU 0 in an isolated partition may not have the same degree of isolation than other CPUs in the isolated partition in the future. For all these reasons, it is better to disable its use in an isolated partition. Add a new partition error code to indicate to the users that CPU 0 cannot be used in an isolated partition. The prstate_housekeeping_conflict() function is modified to return the partition error code directly as it can be either PERR_HKEEPING or PERR_ISOLCPU0. Some existing test cases in test_cpuset_prs.sh are modified to remove the use of CPU 0 in isolated partition setup and explicit new test cases are added to test that. The NOHZ_FULL test cases also modified to run if the "nohz_full" parameters includes all the CPUs except CPU 1-7 instead of 0-7. Though it is not recommended to put CPU 0 in the nohz_full boot parameter, it is the only way we can test that the cpuset code is able to correctly disallow isolating the last nohz_full/domain housekeeping CPU. With CPU 0 likely not allowed in the nohz_full list except for powerpc and with CPU 0 also disallowed from being domain isolated and offline, we will likely have CPU 0 being an always present online housekeeping CPU for most kernels. For those kernels, we will not be able to trigger partition invalidation due to using up the last nohz_full/domain housekeeping CPU in an isolated partition and the NOHZ_FULL test cases in test_cpuset_prs.sh will not be run. The cgroup-v2.rst documentation file is also modified to indicate that CPU 0 cannot be used in an isolated partition. Signed-off-by: Waiman Long Acked-by: Frederic Weisbecker Reviewed-by: Guopeng Zhang Tested-by: Guopeng Zhang --- Documentation/admin-guide/cgroup-v2.rst | 1 + kernel/cgroup/cpuset-internal.h | 1 + kernel/cgroup/cpuset.c | 90 ++++++++++--------- .../selftests/cgroup/test_cpuset_prs.sh | 44 +++++---- 4 files changed, 81 insertions(+), 55 deletions(-) diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-= guide/cgroup-v2.rst index 9e3c67b02ae2..2f792ff29425 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -2771,6 +2771,7 @@ Cpuset Interface Files and excluded from the unbound workqueues. Tasks placed in such a partition with multiple CPUs should be carefully distributed and bound to each of the individual CPUs for optimal performance. + The boot CPU (CPU 0) cannot be used in an isolated partition. =20 A partition root ("root" or "isolated") can be in one of the two possible states - valid or invalid. An invalid partition diff --git a/kernel/cgroup/cpuset-internal.h b/kernel/cgroup/cpuset-interna= l.h index 1ba94ffaff9d..505682493d81 100644 --- a/kernel/cgroup/cpuset-internal.h +++ b/kernel/cgroup/cpuset-internal.h @@ -36,6 +36,7 @@ enum prs_errcode { PERR_ACCESS, PERR_REMOTE, PERR_ISOPARENT, + PERR_ISOLCPU0, }; =20 /* bits in struct cpuset flags field */ diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 30af9531acdd..45c6a2c99f20 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -61,6 +61,7 @@ static const char * const perr_strings[] =3D { [PERR_ACCESS] =3D "Enable partition not permitted", [PERR_REMOTE] =3D "Have remote partition underneath", [PERR_ISOPARENT] =3D "Root partition is not allowed with isolated parent", + [PERR_ISOLCPU0] =3D "Boot CPU (cpu 0) cannot be isolated", }; =20 /* @@ -1327,25 +1328,25 @@ static void partition_xcpus_del(int old_prs, struct= cpuset *parent, * @parent_prs: Parent partition root state * @new_cpus: the set of new effective xcpus in the current cpuset * @del_cpus: old CPUs going to be removed from current cpuset, can be NULL - * Return: true if there is conflict, false otherwise + * Return: PRS error code if there is a conflict, PERR_NONE otherwise * - * There are two different housekeeping conflicts to be checked: + * There are three different housekeeping conflicts to be checked: * 1) If new_prs is PRS_ROOT, none of the @new_cpus can be a boot-time iso= lated * CPU. IOW, the whole @new_cpus must be a subset of HK_TYPE_DOMAIN_BOO= T. * 2) If nohz_full is enabled and we have isolated CPUs, their combination= must * still leave housekeeping CPUs. This check is only needed if new_prs * differs from parent_prs and one of them is PRS_ISOLATED. + * 3) CPU 0 cannot be used in an isolated partition. */ -static bool prstate_housekeeping_conflict(int new_prs, int parent_prs, - struct cpumask *new_cpus, - struct cpumask *del_cpus) +static enum prs_errcode prstate_housekeeping_conflict(int new_prs, int par= ent_prs, + struct cpumask *new_cpus, struct cpumask *del_cpus) { cpumask_var_t full_hk_cpus; - int res; + int prs_err =3D PERR_NONE; =20 WARN_ON_ONCE(parent_prs <=3D 0); if (!new_prs) - return false; + return PERR_NONE; =20 /* * For a currently invalid partition root state, do the check assuming @@ -1361,9 +1362,12 @@ static bool prstate_housekeeping_conflict(int new_pr= s, int parent_prs, if (new_prs < 0) new_prs =3D -new_prs; =20 + if ((new_prs =3D=3D PRS_ISOLATED) && cpumask_test_cpu(0, new_cpus)) + return PERR_ISOLCPU0; + if (housekeeping_enabled(HK_TYPE_DOMAIN_BOOT) && (new_prs =3D=3D PRS_ROOT= ) && !cpumask_subset(new_cpus, housekeeping_cpumask(HK_TYPE_DOMAIN_BOOT))) - return true; + return PERR_HKEEPING; =20 if (del_cpus && cpumask_empty(del_cpus)) del_cpus =3D NULL; @@ -1377,7 +1381,7 @@ static bool prstate_housekeeping_conflict(int new_prs= , int parent_prs, */ if (!housekeeping_enabled(HK_TYPE_KERNEL_NOISE) || (new_prs =3D=3D parent_prs) || (!del_cpus && (new_prs =3D=3D PRS_ROOT= ))) - return false; + return PERR_NONE; =20 /* * Now make sure that @new_cpus contains new CPUs to be isolated and @@ -1388,7 +1392,7 @@ static bool prstate_housekeeping_conflict(int new_prs= , int parent_prs, swap(new_cpus, del_cpus); =20 if (!alloc_cpumask_var(&full_hk_cpus, GFP_KERNEL)) - return true; + return PERR_HKEEPING; =20 /* * Check if del_cpus may contain a CPU that can become an active @@ -1398,20 +1402,19 @@ static bool prstate_housekeeping_conflict(int new_p= rs, int parent_prs, cpumask_and(full_hk_cpus, housekeeping_cpumask(HK_TYPE_KERNEL_NOISE), housekeeping_cpumask(HK_TYPE_DOMAIN_BOOT)); if (cpumask_first_and_and(del_cpus, full_hk_cpus, - cpu_active_mask) < nr_cpu_ids) { - res =3D false; + cpu_active_mask) < nr_cpu_ids) goto out; - } } =20 cpumask_and(full_hk_cpus, housekeeping_cpumask(HK_TYPE_KERNEL_NOISE), housekeeping_cpumask(HK_TYPE_DOMAIN)); cpumask_andnot(full_hk_cpus, full_hk_cpus, isolated_cpus); cpumask_and(full_hk_cpus, full_hk_cpus, cpu_active_mask); - res =3D !cpumask_weight_andnot(full_hk_cpus, new_cpus); + if (!cpumask_weight_andnot(full_hk_cpus, new_cpus)) + prs_err =3D PERR_HKEEPING; out: free_cpumask_var(full_hk_cpus); - return res; + return prs_err; } =20 /** @@ -1446,9 +1449,12 @@ static enum prs_errcode validate_partition(struct cp= uset *cs, if (!parent) parent =3D &top_cpuset; parent_prs =3D parent->partition_root_state; - if (parent_prs > 0 && - prstate_housekeeping_conflict(new_prs, parent_prs, new_excpus, del)) - return PERR_HKEEPING; + if (parent_prs > 0) { + enum prs_errcode err =3D prstate_housekeeping_conflict(new_prs, parent_p= rs, + new_excpus, del); + if (err) + return err; + } =20 if (tasks_nocpu_error(parent, cs, new_excpus)) return PERR_NOCPUS; @@ -1715,6 +1721,8 @@ static void compute_effective_nodemask(nodemask_t *ne= w_mems, static int remote_partition_enable(struct cpuset *cs, int new_prs, struct tmpmasks *tmp) { + enum prs_errcode err; + /* * The user must have sysadmin privilege. */ @@ -1737,8 +1745,9 @@ static int remote_partition_enable(struct cpuset *cs,= int new_prs, return PERR_INVCPUS; if (cpumask_intersects(tmp->new_cpus, subpartitions_cpus)) return PERR_NOCPUS; - if (prstate_housekeeping_conflict(new_prs, PRS_ROOT, tmp->new_cpus, NULL)) - return PERR_HKEEPING; + err =3D prstate_housekeeping_conflict(new_prs, PRS_ROOT, tmp->new_cpus, N= ULL); + if (err) + return err; =20 spin_lock_irq(&callback_lock); partition_xcpus_add(new_prs, NULL, tmp->new_cpus); @@ -1833,14 +1842,16 @@ static void remote_cpus_update(struct cpuset *cs, s= truct cpumask *xcpus, * left in the top cpuset. */ if (adding) { + enum prs_errcode err =3D prstate_housekeeping_conflict(prs, PRS_ROOT, + excpus, tmp->delmask); + if (!capable(CAP_SYS_ADMIN)) WRITE_ONCE(cs->prs_err, PERR_ACCESS); else if (cpumask_intersects(tmp->addmask, subpartitions_cpus) || cpumask_subset(top_cpuset.effective_cpus, tmp->addmask)) WRITE_ONCE(cs->prs_err, PERR_NOCPUS); - else if (prstate_housekeeping_conflict(prs, PRS_ROOT, - excpus, tmp->delmask)) - WRITE_ONCE(cs->prs_err, PERR_HKEEPING); + else if (err) + WRITE_ONCE(cs->prs_err, err); if (cs->prs_err) goto invalidate; } @@ -2101,16 +2112,16 @@ static int update_parent_effective_cpumask(struct c= puset *cs, int cmd, * active housekeeping CPUs. */ cpumask_andnot(tmp->addmask, cs->effective_xcpus, tmp->delmask); - if ((parent_prs =3D=3D PRS_ROOT) && (old_prs =3D=3D PRS_ISOLATED) && - prstate_housekeeping_conflict(old_prs, parent_prs, - tmp->delmask, tmp->addmask)) { - adding =3D cpumask_and(tmp->addmask, cs->effective_xcpus, - tmp->delmask); - part_error =3D PERR_HKEEPING; - } else { + if ((parent_prs =3D=3D PRS_ROOT) && (old_prs =3D=3D PRS_ISOLATED)) { + part_error =3D prstate_housekeeping_conflict(old_prs, parent_prs, + tmp->delmask, tmp->addmask); + if (part_error) + adding =3D cpumask_and(tmp->addmask, cs->effective_xcpus, + tmp->delmask); + } + if (!part_error) deleting =3D cpumask_andnot(tmp->delmask, tmp->delmask, cs->effective_xcpus); - } } else if (is_partition_invalid(cs)) { struct cgroup_subsys_state *css; struct cpuset *child; @@ -2121,11 +2132,11 @@ static int update_parent_effective_cpumask(struct c= puset *cs, int cmd, * cpu exclusivity test when cpuset.cpus.exclusive is * empty as well as the housekeeping check. */ - if (prstate_housekeeping_conflict(cs->partition_root_state, - parent_prs, tmp->delmask, NULL)) { - part_error =3D PERR_HKEEPING; + part_error =3D prstate_housekeeping_conflict(cs->partition_root_state, + parent_prs, tmp->delmask, NULL); + if (part_error) goto write_error; - } + if (cpumask_empty(cs->exclusive_cpus)) { rcu_read_lock(); cpuset_for_each_child(child, css, parent) { @@ -2997,12 +3008,11 @@ static int update_prstate(struct cpuset *cs, int ne= w_prs) * A change in load balance state only, no change in cpumasks. * Need to update isolated_cpus. */ - if (prstate_housekeeping_conflict(new_prs, parent_prs, - cs->effective_xcpus, NULL)) - err =3D PERR_HKEEPING; - else if (parent_prs =3D=3D PRS_ISOLATED) + if (parent_prs =3D=3D PRS_ISOLATED) err =3D PERR_ISOPARENT; /* old_prs should be isolated */ - + else + err =3D prstate_housekeeping_conflict(new_prs, parent_prs, + cs->effective_xcpus, NULL); if (err) { disable_partition =3D true; } else { diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/test= ing/selftests/cgroup/test_cpuset_prs.sh index 1397ec428c46..018993dbc63f 100755 --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh @@ -110,8 +110,8 @@ echo "" > test/cpuset.cpus =20 # # If nohz_full CPUs have been reserved at boot time, they should not inclu= de -# CPUs 0-7 as that may fail some of the test cases. On the other hand if t= he -# set of nohz_full CPUs includes all the CPUs except 0-7 in a single range +# CPUs 1-7 as that may fail some of the test cases. On the other hand if t= he +# set of nohz_full CPUs includes all the CPUs except 1-7 in a single range # -, we can run a special set of housekeeping CPUs exhaustion # tests to see if the cpuset code will reject them. # @@ -123,14 +123,22 @@ NOHZ_FULL_CPUS=3D NOHZ_FULL_CPUS=3D$(cat /sys/devices/system/cpu/nohz_full) LAST_PRESENT_CPU=3D$(cat /sys/devices/system/cpu/present | sed -e "s/.*[,-= ]//") [[ -n "$NOHZ_FULL_CPUS" ]] && { - FIRST_NOHZ_FULL_CPU=3D$(echo $NOHZ_FULL_CPUS | sed -e "s/[,-].*//") - LAST_NOHZ_FULL_CPU=3D$(echo $NOHZ_FULL_CPUS | sed -e "s/,.*//;s/.*[-]//") + if [[ $(expr $NOHZ_FULL_CPUS : "^0,") -gt 0 ]] + then + NOHZ_CPU0=3D1 + NOHZ_CPUS=3D$(echo $NOHZ_FULL_CPUS | sed -e "s/^0,//") + else + NOHZ_CPUS=3D$NOHZ_FULL_CPUS + fi + FIRST_NOHZ_FULL_CPU=3D$(echo $NOHZ_CPUS | sed -e "s/[,-].*//") + LAST_NOHZ_FULL_CPU=3D$(echo $NOHZ_CPUS | sed -e "s/,.*//;s/.*[-]//") echo "Boot nohz_full CPUs: $NOHZ_FULL_CPUS" } [[ -n "$FIRST_NOHZ_FULL_CPU" && "$FIRST_NOHZ_FULL_CPU" -le 7 ]] && skip_test "Boot NOHZ_FULL CPUs overlap CPUs to be tested!" =20 [[ -n "$FIRST_NOHZ_FULL_CPU" && "$FIRST_NOHZ_FULL_CPU" =3D 8 && + -n "$NOHZ_CPU0" && "$LAST_NOHZ_FULL_CPU" =3D $LAST_PRESENT_CPU ]] && RUN_NOHZ_FULL_TESTS= =3D1 =20 # @@ -394,8 +402,8 @@ TEST_MATRIX=3D( # Invalid to valid local partition direct transition tests " C1-3:P2 X4:P2 . . . . . . 0 A1:1-3|XA1= :1-3|A2:1-3:XA2: A1:P2|A2:P-2 1-3" " C1-3:P2 X4:P2 . . . X3:P2 . . 0 A1:1-2|XA1= :1-3|A2:3:XA2:3 A1:P2|A2:P2 1-3" - " C0-3:P2 . . C4-6 C0-4 . . . 0 A1:0-4|B1:= 5-6 A1:P2|B1:P0" - " C0-3:P2 . . C4-6 C0-4:C0-3 . . . 0 A1:0-3|B1:= 4-6 A1:P2|B1:P0 0-3" + " C1-3:P2 . . C4-6 C1-4 . . . 0 A1:1-4|B1:= 5-6 A1:P2|B1:P0" + " C1-3:P2 . . C4-6 C1-4:C1-3 . . . 0 A1:1-3|B1:= 4-6 A1:P2|B1:P0 1-3" =20 # Local partition invalidation tests " C0-3:X1-3:P2 C1-3:X2-3:P2 C2-3:X3:P2 \ @@ -506,6 +514,12 @@ TEST_MATRIX=3D( " CX1-4 CX2-4:P2 . C5-6 . . . P1:C3-6 0 A1:1|A2:2-= 4|B1:5-6 \ A1:P0|A2:P2:B1:P-1 2-4" =20 + # CPU 0 cannot be used in an isolated partition + " C0-4 . . . P2 . . . 0 A1:0-4 A1:= P-2" + " C0-4:P2 . . . C0-2 . . . 0 A1:0-2 A1:= P-2" + " CX0-4 C0-2:P1 . . . P2 . . 0 A1:0-4|A2:= 0-2 A2:P-2" + " CX0-4 C3-4:P2 . . . C0-2 . . 0 A1:0-4|A2:= 0-2 A2:P-2" + # When multiple partitions with conflicting cpuset.cpus are created, the # latter created ones will only get what are left of the available exclus= ive # CPUs. @@ -525,8 +539,8 @@ TEST_MATRIX=3D( =20 # A middle isolated parent shrunk below coverage: the released CPUs of # an invalidated child stay isolated as a higher ancestor still covers th= em. - " CX0-4:P2 CX2-4:P2 CX3-4:P2 . . X2 . . 0 A1:0-1,3-4= |A2:2|A3:2 \ - A1:P2|A2:P2|A3:P-2 0-4" + " CX1-4:P2 CX2-4:P2 CX3-4:P2 . . X2 . . 0 A1:1,3-4|A= 2:2|A3:2 \ + A1:P2|A2:P2|A3:P-2 1-4" =20 # When an isolated partition child with root partition parent is invalida= ted, # its effective xcpus will be removed from isolated_cpus. @@ -618,20 +632,20 @@ ISOLCPUS_TEST_MATRIX=3D( " CX1-2,I:X1,I:P1 . . . X1,2,I . . . 0 A1:1-2,I|X= A1:1-2,I A1:P-1 ." ) =20 -# Test matrix to be run when boot time nohz_full CPUs cover all CPUs excep= t CPUs 0-7 +# Test matrix to be run when boot time nohz_full CPUs cover all CPUs excep= t CPUs 1-7 # This also means that CPU 8 is available and is a nohz_full CPU. NOHZ_FULL_TEST_MATRIX=3D( # old-A1 old-A2 old-A3 old-B1 new-A1 new-A2 new-A3 new-B1 fail ECPUs Pst= ate ISOLCPUS # ------ ------ ------ ------ ------ ------ ------ ------ ---- ----- ---= --- -------- # Using all the nohz_full HK CPUs 0-7 in isolated partition is not allowed - " C0-7 . . . P2 . . . 0 A1:0-7 A1:= P-2 ." - " C2-7:P2 . . . C0-4 . . . 0 A1:0-4 A1:= P2 0-4" - " C1-7:P2 C5-7:P2 . . . . . C0:P2 0 A1:1-4|A2:= 5-7|B1:0 - A1:P2|A2:P2|B1:P-2 1-7" + " C1-7 . . . P2 . . . 0 A1:1-7 A1:= P-2 ." + " C2-7:P2 . . . C1-4 . . . 0 A1:1-4 A1:= P2 1-4" + " C2-7:P2 C5-7:P2 . . . . . C1:P2 0 A1:2-4|A2:= 5-7|B1:1 + A1:P2|A2:P2|B1:P-2 2-7" # An isolated child partition cannot grow to take over the last # housekeeping CPU when its parent expands the exclusive CPUs. - " C0-8:X1-8:P1 CX0-8:P2 . . X0-7 . . . 0 A1:0-7|A2:= 0-7 A1:P1|A2:P-2 ." - " C0-8:X0-6:P1 CX0-8:P2 . . X2-8 . . . 0 A1:|A2:2-8= A1:P1|A2:P2 2-8" + " C1-8:X2-8:P1 CX1-8:P2 . . X1-7 . . . 0 A1:1-7|A2:= 1-7 A1:P1|A2:P-2 ." + " C1-8:X0-6:P1 CX1-8:P2 . . X2-8 . . . 0 A1:|A2:2-8= A1:P1|A2:P2 2-8" ) =20 # --=20 2.56.1