Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1276941

Re: [PATCH tip v4 4/5] rcu: Do not call rcu_nocb_gp_cleanup() while holding rnp->lock

From Boqun Feng <boqun.feng@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH tip v4 4/5] rcu: Do not call rcu_nocb_gp_cleanup() while holding rnp->lock
Date 2015-11-25 02:10 +0100
Message-ID <qywKS-7sm-9@gated-at.bofh.it> (permalink)
References <qylw6-5A-7@gated-at.bofh.it> <qylw7-5A-45@gated-at.bofh.it> <qyoaC-1F0-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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@bmw-carit.de>
> > Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: linux-kernel@vger.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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH tip v4 0/5] Simple wait queue support Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-11-24 14:10 +0100
  [PATCH tip v4 5/5] rcu: use simple wait queues where possible in rcutree Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-11-24 14:10 +0100
  [PATCH tip v4 2/5] [s]wait: Add compile time type check assertion Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-11-24 14:10 +0100
    Re: [PATCH tip v4 2/5] [s]wait: Add compile time type check assertion Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-11-26 13:30 +0100
      Re: [PATCH tip v4 2/5] [s]wait: Add compile time type check  assertion Thomas Gleixner <tglx@linutronix.de> - 2015-11-27 21:20 +0100
  [PATCH tip v4 4/5] rcu: Do not call rcu_nocb_gp_cleanup() while holding rnp->lock Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-11-24 14:10 +0100
    Re: [PATCH tip v4 4/5] rcu: Do not call rcu_nocb_gp_cleanup() while  holding rnp->lock Boqun Feng <boqun.feng@gmail.com> - 2015-11-25 02:10 +0100
      Re: [PATCH tip v4 4/5] rcu: Do not call rcu_nocb_gp_cleanup() while  holding rnp->lock Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-11-25 11:30 +0100
  [PATCH tip v4 3/5] KVM: use simple waitqueue for vcpu->wq Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-11-24 14:10 +0100

csiph-web