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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231108112227.62f0c5a8@gandalf.local.home>
Date:   Wed, 8 Nov 2023 11:22:27 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ankur Arora <ankur.a.arora@...cle.com>,
        linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
        paulmck@...nel.org, linux-mm@...ck.org, x86@...nel.org,
        akpm@...ux-foundation.org, luto@...nel.org, bp@...en8.de,
        dave.hansen@...ux.intel.com, hpa@...or.com, mingo@...hat.com,
        juri.lelli@...hat.com, vincent.guittot@...aro.org,
        willy@...radead.org, mgorman@...e.de, jon.grimm@....com,
        bharata@....com, raghavendra.kt@....com,
        boris.ostrovsky@...cle.com, konrad.wilk@...cle.com,
        jgross@...e.com, andrew.cooper3@...rix.com, mingo@...nel.org,
        bristot@...nel.org, mathieu.desnoyers@...icios.com,
        geert@...ux-m68k.org, glaubitz@...sik.fu-berlin.de,
        anton.ivanov@...bridgegreys.com, mattst88@...il.com,
        krypton@...ich-teichert.org, David.Laight@...lab.com,
        richard@....at, mjguzik@...il.com
Subject: Re: [RFC PATCH 00/86] Make the kernel preemptible

On Wed, 08 Nov 2023 16:38:11 +0100
Thomas Gleixner <tglx@...utronix.de> wrote:

> On Wed, Nov 08 2023 at 11:13, Peter Zijlstra wrote:
> > On Wed, Nov 08, 2023 at 02:04:02AM -0800, Ankur Arora wrote:
> > I'm not understanding, those should stay obviously.
> >
> > The current preempt_dynamic stuff has 5 toggles:
> >
> > /*
> >  * SC:cond_resched
> >  * SC:might_resched
> >  * SC:preempt_schedule
> >  * SC:preempt_schedule_notrace
> >  * SC:irqentry_exit_cond_resched
> >  *
> >  *
> >  * NONE:
> >  *   cond_resched               <- __cond_resched
> >  *   might_resched              <- RET0
> >  *   preempt_schedule           <- NOP
> >  *   preempt_schedule_notrace   <- NOP
> >  *   irqentry_exit_cond_resched <- NOP
> >  *
> >  * VOLUNTARY:
> >  *   cond_resched               <- __cond_resched
> >  *   might_resched              <- __cond_resched
> >  *   preempt_schedule           <- NOP
> >  *   preempt_schedule_notrace   <- NOP
> >  *   irqentry_exit_cond_resched <- NOP
> >  *
> >  * FULL:
> >  *   cond_resched               <- RET0
> >  *   might_resched              <- RET0
> >  *   preempt_schedule           <- preempt_schedule
> >  *   preempt_schedule_notrace   <- preempt_schedule_notrace
> >  *   irqentry_exit_cond_resched <- irqentry_exit_cond_resched
> >  */
> >
> > If you kill voluntary as we know it today, you can remove cond_resched
> > and might_resched, but the remaining 3 are still needed to switch
> > between NONE and FULL.  
> 
> No. The whole point of LAZY is to keep preempt_schedule(),
> preempt_schedule_notrace(), irqentry_exit_cond_resched() always enabled.

Right.

 * NONE:
 *   cond_resched               <- __cond_resched
 *   might_resched              <- RET0
 *   preempt_schedule           <- NOP
 *   preempt_schedule_notrace   <- NOP
 *   irqentry_exit_cond_resched <- NOP

Peter, how can you say we can get rid of cond_resched() in NONE when you
show that NONE still uses it? I thought the entire point of this was to get
rid of all the cond_resched() and they are there for PREEMPT_NONE as well as
VOLUNTARY. As you showed above, the only difference between NONE and
VOLUNTARY was the might_sleep.

> 
> Look at my PoC: https://lore.kernel.org/lkml/87jzshhexi.ffs@tglx/

And I've been saying that many times already ;-)

Thanks Thomas for reiterating it.

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ