The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Nam Cao <namcao@linutronix.de>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Mel Gorman <mgorman@suse.de>,
	Shrikanth Hegde <sshegde@linux.ibm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Valentin Schneider <vschneid@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] smp: Suppress false DEBUG_PREEMPT warning in smp_call_on_cpu()
Date: Wed, 05 Nov 2025 09:42:42 +0100	[thread overview]
Message-ID: <87ikfolvjx.fsf@yellow.woof> (raw)
In-Reply-To: <20251024140832.46JNLRvL@linutronix.de>

Sebastian Andrzej Siewior <bigeasy@linutronix.de> writes:
>> This appears after commit 06ddd17521bf ("sched/smp: Always define
>> is_percpu_thread() and scheduler_ipi()"). Before this commit,
>> is_percpu_thread() always returns true on UP kernel and thus
>> debug_smp_processor_id() always sees a per-cpu thread and never warns. But
>> now is_percpu_thread() returns false for this case.
>> 
>> Suppress this warning with a migrate_disable()+migrate_enable() pair.
>
> Right. This is one of the possibilities. The other one would be to also
> workqueue on UP and preserve the same semantic.
> I don't mind this.

Yeah it's a tradeoff. I'm not sure if someone will be bothered by the
overhead that workqueue introduces, so I use this cheap solution.

>> +
>> +	/* suppress warnings from debug_smp_processor_id() */
>
> If you want to add a comment, what about something like
>
>   /* Preserve not being migratable such as SMP variant does */ 

Wouldn't it be a bit misleading? It's true that technically SMP variant
is not migratable, but that's because it is a per-cpu thread, not
because of migrate_disable(). To me, the comment sounds like that there
is also a migrate_disable() in SMP variant.

Nam

  reply	other threads:[~2025-11-05  8:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24  7:07 [PATCH] smp: Suppress false DEBUG_PREEMPT warning in smp_call_on_cpu() Nam Cao
2025-10-24 14:08 ` Sebastian Andrzej Siewior
2025-11-05  8:42   ` Nam Cao [this message]
2025-11-05  8:48     ` Sebastian Andrzej Siewior

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=87ikfolvjx.fsf@yellow.woof \
    --to=namcao@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sshegde@linux.ibm.com \
    --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