lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6c36c09fbf426280d13f6025f41aed4c65c042d6.camel@fb.com>
Date:   Wed, 11 May 2022 00:35:11 +0000
From:   Rik van Riel <riel@...com>
To:     Song Liu <songliubraving@...com>,
        "jpoimboe@...nel.org" <jpoimboe@...nel.org>
CC:     "song@...nel.org" <song@...nel.org>,
        "joe.lawrence@...hat.com" <joe.lawrence@...hat.com>,
        "jpoimboe@...hat.com" <jpoimboe@...hat.com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "vincent.guittot@...aro.org" <vincent.guittot@...aro.org>,
        "live-patching@...r.kernel.org" <live-patching@...r.kernel.org>,
        Kernel Team <Kernel-team@...com>,
        "pmladek@...e.com" <pmladek@...e.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] sched,livepatch: call klp_try_switch_task in __cond_resched

On Tue, 2022-05-10 at 23:57 +0000, Song Liu wrote:
> 
> So, if we come back to the same question: is this a bug (or a
> suboptimal
> behavior that worth fixing)? If so, we are open to any solution that 
> would also help PREEMPT and/or non-x86 arches. 
> 
Using the preempt notifiers during KLP transition should
work equally well for PREEMPT and !PREEMPT. It also does
not insert any additional code into the scheduler while
there is no KLP transition going on.

> Lastly, maybe a really naive question: does the following also helps
> PREEMPT=y configurations?
> 

>  static void __sched notrace preempt_schedule_common(void)
>  {
> +       if (unlikely(klp_patch_pending(current)))
> +               klp_try_switch_task(current);
> +
>         do {
> 

While this would almost certainly speed up KLP
transitions, it would also slow down schedule
all the time, even while there is no KLP transition
going on.

That does not seem like a worthwhile tradeoff.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ