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] [day] [month] [year] [list]
Date:   Thu, 5 Oct 2017 08:11:12 -0700
From:   "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     linux-kernel@...r.kernel.org, mingo@...nel.org,
        jiangshanlai@...il.com, dipankar@...ibm.com,
        akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
        josh@...htriplett.org, tglx@...utronix.de, rostedt@...dmis.org,
        dhowells@...hat.com, edumazet@...gle.com, fweisbec@...il.com,
        oleg@...hat.com
Subject: Re: [PATCH tip/core/rcu 1/4] sched,rcu: Make cond_resched() provide
 RCU quiescent state

On Thu, Oct 05, 2017 at 12:40:51PM +0200, Peter Zijlstra wrote:
> On Wed, Oct 04, 2017 at 02:50:22PM -0700, Paul E. McKenney wrote:
> > diff --git a/include/linux/sched.h b/include/linux/sched.h
> > index 26a7df4e558c..59688ef3ea23 100644
> > --- a/include/linux/sched.h
> > +++ b/include/linux/sched.h
> > @@ -1565,10 +1565,11 @@ static inline int test_tsk_need_resched(struct task_struct *tsk)
> >   * cond_resched_lock() will drop the spinlock before scheduling,
> >   * cond_resched_softirq() will enable bhs before scheduling.
> >   */
> > +void rcu_all_qs(void);
> >  #ifndef CONFIG_PREEMPT
> >  extern int _cond_resched(void);
> >  #else
> > -static inline int _cond_resched(void) { return 0; }
> > +static inline int _cond_resched(void) { rcu_all_qs(); return 0; }
> >  #endif
> 
> Why does it need to change PREEMPT? the whole cond_resched() thing
> should be a no-op on PREEMPT.

Let's see...  Clearly for RCU-preempt, there is no need.  And you are
quite right, if rcu_read_lock_bh() or rcu_read_lock_sched() are preventing
a CPU from context switching, invoking cond_resched() on that CPU would
be a bug anyway.

I will drop this hunk, thank you!

							Thanx, Paul

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ