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]
Date:   Wed, 18 Oct 2023 10:31:46 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     paulmck@...nel.org, Linus Torvalds <torvalds@...ux-foundation.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ankur Arora <ankur.a.arora@...cle.com>,
        linux-kernel@...r.kernel.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,
        Frederic Weisbecker <fweisbec@...il.com>,
        Daniel Bristot de Oliveira <bristot@...nel.org>
Subject: Re: [PATCH v2 7/9] sched: define TIF_ALLOW_RESCHED

On Wed, 18 Oct 2023 15:16:12 +0200
Thomas Gleixner <tglx@...utronix.de> wrote:

> > 14.	The kernel/trace/trace_osnoise.c file's run_osnoise() function
> > 	might need to do something for non-preemptible RCU to make
> > 	up for the lack of cond_resched() calls.  Maybe just drop the
> > 	"IS_ENABLED()" and execute the body of the current "if" statement
> > 	unconditionally.  

Right.

I'm guessing you are talking about this code:

                /*
                 * In some cases, notably when running on a nohz_full CPU with
                 * a stopped tick PREEMPT_RCU has no way to account for QSs.
                 * This will eventually cause unwarranted noise as PREEMPT_RCU
                 * will force preemption as the means of ending the current
                 * grace period. We avoid this problem by calling
                 * rcu_momentary_dyntick_idle(), which performs a zero duration
                 * EQS allowing PREEMPT_RCU to end the current grace period.
                 * This call shouldn't be wrapped inside an RCU critical
                 * section.
                 *
                 * Note that in non PREEMPT_RCU kernels QSs are handled through
                 * cond_resched()
                 */
                if (IS_ENABLED(CONFIG_PREEMPT_RCU)) {
                        if (!disable_irq)
                                local_irq_disable();

                        rcu_momentary_dyntick_idle();

                        if (!disable_irq)
                                local_irq_enable();
                }

                /*
                 * For the non-preemptive kernel config: let threads runs, if
                 * they so wish, unless set not do to so.
                 */
                if (!disable_irq && !disable_preemption)
                        cond_resched();



If everything becomes PREEMPT_RCU, then the above should be able to be
turned into just:

                if (!disable_irq)
                        local_irq_disable();

                rcu_momentary_dyntick_idle();

                if (!disable_irq)
                        local_irq_enable();

And no cond_resched() is needed.

> 
> Again. There is no non-preemtible RCU with this model, unless I'm
> missing something important here.

Daniel?

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ