The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Dylan Hatch <dylanbhatch@google.com>,
	Miroslav Benes <mbenes@suse.cz>, Petr Mladek <pmladek@suse.com>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	Song Liu <song@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Shuah Khan <shuah@kernel.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>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Thomas Gleixner <tglx@kernel.org>,
	live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] sched, livepatch: Fix transition stall for CPU-bound tasks
Date: Thu, 26 Nov 2026 15:05:58 +0100	[thread overview]
Message-ID: <20261126140558.GF49833@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <awIMltMpXzhXiDpU@jpoimboe>

On Sat, Nov 21, 2026 at 01:55:39PM -0800, Josh Poimboeuf wrote:

> diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c
> index e058d21d84b75..1ccbae2051c72 100644
> --- a/kernel/livepatch/transition.c
> +++ b/kernel/livepatch/transition.c
> @@ -402,12 +402,22 @@ static void klp_send_signals(void)
>  		 * Meanwhile the task could migrate itself and the action
>  		 * would be meaningless. It is not serious though.
>  		 */
> -		if (task->flags & PF_KTHREAD) {
> +		if (task->flags & (PF_KTHREAD | PF_USER_WORKER)) {
>  			/*
>  			 * Wake up a kthread which sleeps interruptedly and
>  			 * still has not been migrated.
>  			 */
> -			wake_up_state(task, TASK_INTERRUPTIBLE);
> +			if (wake_up_state(task, TASK_INTERRUPTIBLE))
> +				continue;
> +
> +			/*
> +			 * If it's running, force it through __schedule() so
> +			 * it can switch itself in klp_sched_try_switch().
> +			 */
> +			if (task_curr(task)) {
> +				set_tsk_need_resched(task);

That's broken. Preempt state is more than just the TIF bit.

> +				kick_process(task);
> +			}
>  		} else {
>  			/*
>  			 * Send fake signal to all non-kthread tasks which are

  parent reply	other threads:[~2026-11-26 14:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  4:52 [PATCH 0/2] sched, livepatch: Fix transition stall for CPU-bound tasks Dylan Hatch
2026-11-17  4:52 ` [PATCH 1/2] " Dylan Hatch
2026-11-21 21:55   ` Josh Poimboeuf
2026-11-25  4:18     ` Dylan Hatch
2026-11-26 14:05     ` Peter Zijlstra [this message]
2026-11-17  4:52 ` [PATCH 2/2] selftests/livepatch: Add cond_resched() kthread transition test Dylan Hatch

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=20261126140558.GF49833@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bigeasy@linutronix.de \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=dylanbhatch@google.com \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=tglx@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