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]
Date:	Wed, 25 Nov 2015 09:01:34 +0800
From:	Boqun Feng <boqun.feng@...il.com>
To:	Daniel Wagner <daniel.wagner@...-carit.de>
Cc:	linux-kernel@...r.kernel.org, linux-rt-users@...r.kernel.org,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Marcelo Tosatti <mtosatti@...hat.com>,
	Paolo Bonzini <pbonzini@...hat.com>,
	Paul Gortmaker <paul.gortmaker@...driver.com>
Subject: Re: [PATCH tip v4 4/5] rcu: Do not call rcu_nocb_gp_cleanup() while
 holding rnp->lock

On Tue, Nov 24, 2015 at 11:52:12PM +0800, Boqun Feng wrote:
> Hi Daniel,
> 
> On Tue, Nov 24, 2015 at 02:03:06PM +0100, Daniel Wagner wrote:
> > rcu_nocb_gp_cleanup() is called while holding rnp->lock. Currently,
> > this is okay because the wake_up_all() in rcu_nocb_gp_cleanup() will
> > not enable the IRQs. lockdep is happy.
> > 
> > By switching over using swait this is not true anymore. swake_up_all()
> > enables the IRQs while processing the waiters. __do_softirq() can now
> > run and will eventually call rcu_process_callbacks() which wants to
> > grap nrp->lock.
> > 
> > Let's move the rcu_nocb_gp_cleanup() call outside the lock before we
> > switch over to swait.
> > 
> 
> But you did introduce swait in this patch ;-)
> 
> [snip]
> 
> > 
> > Signed-off-by: Daniel Wagner <daniel.wagner@...-carit.de>
> > Cc: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
> > Cc: Peter Zijlstra <peterz@...radead.org>
> > Cc: Thomas Gleixner <tglx@...utronix.de>
> > Cc: linux-kernel@...r.kernel.org
> > ---
> >  kernel/rcu/tree.c        |  4 +++-
> >  kernel/rcu/tree.h        |  3 ++-
> >  kernel/rcu/tree_plugin.h | 16 +++++++++++++---
> >  3 files changed, 18 insertions(+), 5 deletions(-)
> > 
> 
> So I tried to build this patch with a config having RCU_EXPERT=y and
> RCU_NOCB_CPU=y, but I got:
> 
> In file included from include/linux/completion.h:11:0,
>                  from include/linux/rcupdate.h:43,
>                  from include/linux/sysctl.h:25,
>                  from include/linux/timer.h:242,
>                  from include/linux/workqueue.h:8,
>                  from include/linux/pm.h:25,
>                  from ./arch/x86/include/asm/apic.h:5,
>                  from ./arch/x86/include/asm/smp.h:12,
>                  from include/linux/smp.h:59,
>                  from kernel/rcu/tree.c:34:
> kernel/rcu/tree_plugin.h: In function ‘rcu_nocb_gp_cleanup’:
> kernel/rcu/tree_plugin.h:1782:14: warning: passing argument 1 of ‘__wake_up’ from incompatible pointer type [-Wincompatible-pointer-types]
>   wake_up_all(sq);
>               ^
> include/linux/wait.h:168:36: note: in definition of macro ‘wake_up_all’
>  #define wake_up_all(x)   __wake_up(x, TASK_NORMAL, 0, NULL)
> 
> 

Just to be clear, I saw this build error when I applied only the first
four patches of this series. When I applied the whole series, I didn't
see any build error.

Regards,
Boqun

Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ