All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Dylan Hatch <dylanbhatch@google.com>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>,
	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 v2 0/2] sched, livepatch: Fix transition stall for CPU-bound tasks
Date: Wed, 25 Nov 2026 10:50:56 +0100	[thread overview]
Message-ID: <20261125095056.GZ2668804@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20261125041900.3243569-1-dylanbhatch@google.com>

On Wed, Nov 25, 2026 at 04:18:58AM +0000, Dylan Hatch wrote:
> Commit 676e8cf70cb0 ("sched,livepatch: Untangle cond_resched() and
> live-patching") moved klp_sched_try_switch() from _cond_resched() into
> __schedule() and gated it on READ_ONCE(curr->__state) & TASK_FREEZABLE.
> This causes livepatch transitions to stall when CPU-bound kthreads,
> PF_USER_WORKER threads (such as vhost-<pid>), or user tasks in long
> kernel loops spin with cond_resched():
> 
> 1. Even when __schedule() is entered via preemption or an unfreezable
>    sleep (such as PF_NOFREEZE kthreads or PF_USER_WORKER threads
>    sleeping in TASK_INTERRUPTIBLE), curr->__state does not have
>    TASK_FREEZABLE set, so klp_sched_try_switch() skips the task.
> 2. A sole runnable task spinning in the kernel never gets
>    TIF_NEED_RESCHED set during sched_tick(). In klp_send_signals(),
>    wake_up_state(task, TASK_INTERRUPTIBLE) is a no-op for a
>    TASK_RUNNING task, and set_notify_signal() sets TIF_NOTIFY_SIGNAL
>    without TIF_NEED_RESCHED, so the resulting reschedule IPI returns to
>    kernel mode without entering __schedule().

How does the freezer handle this? I mean, systems doing this must also
still suspend, right?

  parent reply	other threads:[~2026-11-25  9:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  4:18 [PATCH v2 0/2] sched, livepatch: Fix transition stall for CPU-bound tasks Dylan Hatch
2026-11-25  4:18 ` [PATCH v2 1/2] " Dylan Hatch
2026-11-25  4:46   ` sashiko-bot
2026-11-25  4:19 ` [PATCH v2 2/2] selftests/livepatch: Add cond_resched() transition tests Dylan Hatch
2026-11-25  9:50 ` Peter Zijlstra [this message]
2026-11-26 14:29 ` [PATCH v2 0/2] sched, livepatch: Fix transition stall for CPU-bound tasks Peter Zijlstra
2026-11-26 14:41   ` Peter Zijlstra

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=20261125095056.GZ2668804@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.