[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220509093830.GH76023@worktop.programming.kicks-ass.net>
Date: Mon, 9 May 2022 11:38:30 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Song Liu <songliubraving@...com>
Cc: Song Liu <song@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"live-patching@...r.kernel.org" <live-patching@...r.kernel.org>,
Ingo Molnar <mingo@...hat.com>,
"vincent.guittot@...aro.org" <vincent.guittot@...aro.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
"joe.lawrence@...hat.com" <joe.lawrence@...hat.com>,
Kernel Team <Kernel-team@...com>
Subject: Re: [RFC] sched,livepatch: call klp_try_switch_task in __cond_resched
On Mon, May 09, 2022 at 08:06:22AM +0000, Song Liu wrote:
>
>
> > On May 9, 2022, at 12:04 AM, Peter Zijlstra <peterz@...radead.org> wrote:
> >
> > On Sat, May 07, 2022 at 10:46:28AM -0700, Song Liu wrote:
> >> Busy kernel threads may block the transition of livepatch. Call
> >> klp_try_switch_task from __cond_resched to make the transition easier.
> >
> > What will a PREEMPT=y kernel do? How is it not a problem there, and if
> > it is, this will not help that.
> >
> > That is; I don't think this can be right.
>
> I guess on PREEMPT=y kernel, we can simply preempt the long running
> kernel thread and check the transition?
This is not a guessing game.
> In this case (PREEMPT=n), we see a long running kernel thread could not
> finish the transition. It calls cond_resched() and gets rescheduled
> (moves among different cores). However, it never finishes the transition,
> because live patch doesn’t get a chance to check the stack.
>
> Does this answer the question?
Not really. There is no difference between an explicit preemption point
(cond_resched) or an involuntary preemption point (PREEMPT=y).
So unless you can *exactly* say why it isn't a problem on PREEMPT=y,
none of this makes any sense.
Powered by blists - more mailing lists