Re: [PATCH 1/2] sched, livepatch: Fix transition stall for CPU-bound tasks

From: Peter Zijlstra

Date: Thu Nov 26 2026 - 09:06:14 EST


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