mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Frederic Weisbecker <frederic@kernel.org>
Cc: "Tejun Heo" <tj@kernel.org>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Michal Koutný" <mkoutny@suse.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Ridong Chen" <ridong.chen@linux.dev>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Juri Lelli" <juri.lelli@redhat.com>,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	"Dietmar Eggemann" <dietmar.eggemann@arm.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Ben Segall" <bsegall@google.com>, "Mel Gorman" <mgorman@suse.de>,
	"Valentin Schneider" <vschneid@redhat.com>,
	"K Prateek Nayak" <kprateek.nayak@amd.com>,
	"Anna-Maria Behnsen" <anna-maria@linutronix.de>,
	"Thomas Gleixner" <tglx@kernel.org>,
	cgroups@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	"Guopeng Zhang" <guopeng.zhang@linux.dev>,
	"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH-next v2 1/3] tick/sched: Make tick_nohz_full_mask and HK_TYPE_KERNEL_NOISE cpumask consistent
Date: Mon, 23 Nov 2026 21:47:07 -0500	[thread overview]
Message-ID: <407316d0-24b6-44a3-b4c7-90a4b3695fae@redhat.com> (raw)
In-Reply-To: <awSvBOgM9WSj-1hH@pavilion.home>

On 11/23/26 4:24 PM, Frederic Weisbecker wrote:
> Le Sun, Nov 22, 2026 at 11:12:07PM -0500, Waiman Long a écrit :
>> 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.
>>
>> 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= parameter")
>> Signed-off-by: Waiman Long <longman@redhat.com>
> Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
>
> If you like, it would be nice to remove tick_nohz_full_mask and rely on
> the housekeeping mask instead.

That will be a bigger change. It can be done later on. For this fix 
commit, I want to make it simpler.

BTW, sashiko had also noted that when arch_irq_work_has_interrupt() 
returns false, tick_nohz_full_mask will be cleared and 
tick_nohz_full_running will be set back to false in tick_nohz_init(). I 
am not quite sure on the best way to handle this. Should we just 
disallow nohz_full to be set when !arch_irq_work_has_interrupt() or 
should we allow tick_nohz_full_mask and HK_TYPE_KERNEL_NOISE cpumask to 
diverge? What do you think?

Cheers,
Longman


  reply	other threads:[~2026-11-24  2:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  4:12 [PATCH-next v2 0/3] Skip boot CPU or don't allow it from being used in isolcpus and isolated partitions Waiman Long
2026-11-23  4:12 ` [PATCH-next v2 1/3] tick/sched: Make tick_nohz_full_mask and HK_TYPE_KERNEL_NOISE cpumask consistent Waiman Long
2026-11-23 21:24   ` Frederic Weisbecker
2026-11-24  2:47     ` Waiman Long [this message]
2026-11-24  2:56   ` Ridong Chen
2026-11-24  3:05   ` Guopeng Zhang
2026-11-23  4:12 ` [PATCH-next v2 2/3] sched/isolation: Forbid the boot CPU from being domain isolated Waiman Long
2026-11-23 21:34   ` Frederic Weisbecker
2026-11-24  3:09   ` Guopeng Zhang
2026-11-24  3:27   ` Ridong Chen
2026-11-24  3:56     ` Waiman Long
2026-11-23  4:12 ` [PATCH-next v2 3/3] cgroup/cpuset: Disallow CPU 0 from being used in isolated partition Waiman Long
2026-11-23 21:38   ` Frederic Weisbecker
2026-11-24  3:28   ` Guopeng Zhang
2026-11-24  3:58     ` Waiman Long

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=407316d0-24b6-44a3-b4c7-90a4b3695fae@redhat.com \
    --to=longman@redhat.com \
    --cc=anna-maria@linutronix.de \
    --cc=bsegall@google.com \
    --cc=cgroups@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=dietmar.eggemann@arm.com \
    --cc=frederic@kernel.org \
    --cc=guopeng.zhang@linux.dev \
    --cc=hannes@cmpxchg.org \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=mkoutny@suse.com \
    --cc=peterz@infradead.org \
    --cc=rdunlap@infradead.org \
    --cc=ridong.chen@linux.dev \
    --cc=rostedt@goodmis.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tglx@kernel.org \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®