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


Groups > linux.kernel > #1241208

Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to allow consolidation

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to allow consolidation
Date 2015-10-07 10:00 +0200
Message-ID <qgRNM-6WR-7@gated-at.bofh.it> (permalink)
References <qgDhN-2Zi-27@gated-at.bofh.it> <qgDhN-2Zi-29@gated-at.bofh.it> <qgDrs-3aC-11@gated-at.bofh.it> <qgH22-8u5-1@gated-at.bofh.it> <qgHv4-AR-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Oct 06, 2015 at 01:58:50PM -0700, Paul E. McKenney wrote:
> On Tue, Oct 06, 2015 at 10:29:37PM +0200, Peter Zijlstra wrote:
> > On Tue, Oct 06, 2015 at 09:29:21AM -0700, Paul E. McKenney wrote:
> > > +static void __maybe_unused rcu_report_exp_rnp(struct rcu_state *rsp,
> > > +					      struct rcu_node *rnp, bool wake)
> > > +{
> > > +	unsigned long flags;
> > > +	unsigned long mask;
> > > +
> > > +	raw_spin_lock_irqsave(&rnp->lock, flags);
> > 
> > Normally we require a comment with barriers, explaining the order and
> > the pairing etc.. :-)
> > 
> > > +	smp_mb__after_unlock_lock();
> 
> Hmmmm...  That is not good.
> 
> Worse yet, I am missing comments on most of the pre-existing barriers
> of this form.

Yes I noticed.. :/

> The purpose is to enforce the heavy-weight grace-period memory-ordering
> guarantees documented in the synchronize_sched() header comment and
> elsewhere.

> They pair with anything you might use to check for violation
> of these guarantees, or, simiarly, any ordering that you might use when
> relying on these guarantees.

I'm sure you know what that means, but I've no clue ;-) That is, I
wouldn't know where to start looking in the RCU implementation to verify
the barrier is either needed or sufficient. Unless you mean _everywhere_
:-)

> I could add something like  "/* Enforce GP memory ordering. */"
> 
> Or perhaps "/* See synchronize_sched() header. */"
> 
> I do not propose reproducing the synchronize_sched() header on each
> of these.  That would be verbose, even for me!  ;-)
> 
> Other thoughts?

Well, this is an UNLOCK+LOCK on non-matching lock variables upgrade to
full barrier thing, right?

To me its not clear which UNLOCK we even match here. I've just read the
sync_sched() header, but that doesn't help me either, so referring to
that isn't really helpful either.

In any case, I don't want to make too big a fuzz here, but I just
stumbled over a lot of unannotated barriers and figured I ought to say
something about it.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH tip/core/rcu 0/18] Expedited grace-period improvements for 4.4 "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:30 +0200
  [PATCH tip/core/rcu 18/18] rcu: Better hotplug handling for synchronize_sched_expedited() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
    Re: [PATCH tip/core/rcu 18/18] rcu: Better hotplug handling for  synchronize_sched_expedited() Peter Zijlstra <peterz@infradead.org> - 2015-10-07 16:30 +0200
      Re: [PATCH tip/core/rcu 18/18] rcu: Better hotplug handling for  synchronize_sched_expedited() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-07 18:30 +0200
        Re: [PATCH tip/core/rcu 18/18] rcu: Better hotplug handling for  synchronize_sched_expedited() Peter Zijlstra <peterz@infradead.org> - 2015-10-08 11:10 +0200
          Re: [PATCH tip/core/rcu 18/18] rcu: Better hotplug handling for  synchronize_sched_expedited() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-08 17:10 +0200
            Re: [PATCH tip/core/rcu 18/18] rcu: Better hotplug handling for  synchronize_sched_expedited() Peter Zijlstra <peterz@infradead.org> - 2015-10-08 17:20 +0200
              Re: [PATCH tip/core/rcu 18/18] rcu: Better hotplug handling for  synchronize_sched_expedited() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-08 17:20 +0200
                Re: [PATCH tip/core/rcu 18/18] rcu: Better hotplug handling for  synchronize_sched_expedited() Josh Triplett <josh@joshtriplett.org> - 2015-10-08 20:10 +0200
                Re: [PATCH tip/core/rcu 18/18] rcu: Better hotplug handling for  synchronize_sched_expedited() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-09 02:20 +0200
                Re: [PATCH tip/core/rcu 18/18] rcu: Better hotplug handling for  synchronize_sched_expedited() Josh Triplett <josh@joshtriplett.org> - 2015-10-09 02:50 +0200
                Re: [PATCH tip/core/rcu 18/18] rcu: Better hotplug handling for  synchronize_sched_expedited() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-09 06:00 +0200
  [PATCH tip/core/rcu 10/18] rcu: Stop silencing lockdep false positive for expedited grace periods "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
  [PATCH tip/core/rcu 08/18] rcu: Make ->cpu_no_qs be a union for aggregate OR "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
  [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to allow consolidation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
    Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation Peter Zijlstra <peterz@infradead.org> - 2015-10-06 22:30 +0200
      Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 23:00 +0200
        Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation Peter Zijlstra <peterz@infradead.org> - 2015-10-07 10:00 +0200
          Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2015-10-07 10:50 +0200
            Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation Peter Zijlstra <peterz@infradead.org> - 2015-10-07 13:10 +0200
              Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation Peter Zijlstra <peterz@infradead.org> - 2015-10-07 14:00 +0200
                Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation Peter Zijlstra <peterz@infradead.org> - 2015-10-07 14:10 +0200
                Re: Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation kbuild test robot <lkp@intel.com> - 2015-10-07 14:10 +0200
                Re: Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation kbuild test robot <lkp@intel.com> - 2015-10-07 14:10 +0200
                Re: Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation Peter Zijlstra <peterz@infradead.org> - 2015-10-07 14:20 +0200
                Re: [kbuild-all] [PATCH tip/core/rcu 02/18] rcu: Move  rcu_report_exp_rnp() to allow consolidation Fengguang Wu <lkp@intel.com> - 2015-10-07 15:50 +0200
                Re: [kbuild-all] [PATCH tip/core/rcu 02/18] rcu: Move  rcu_report_exp_rnp() to allow consolidation Peter Zijlstra <peterz@infradead.org> - 2015-10-07 16:00 +0200
                Re: [kbuild-all] [PATCH tip/core/rcu 02/18] rcu: Move  rcu_report_exp_rnp() to allow consolidation Peter Zijlstra <peterz@infradead.org> - 2015-10-07 16:30 +0200
                Re: [kbuild-all] [PATCH tip/core/rcu 02/18] rcu: Move  rcu_report_exp_rnp() to allow consolidation Fengguang Wu <lkp@intel.com> - 2015-10-07 16:30 +0200
                Re: Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation kbuild test robot <lkp@intel.com> - 2015-10-07 14:20 +0200
                Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-07 17:20 +0200
                Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation Peter Zijlstra <peterz@infradead.org> - 2015-10-08 12:30 +0200
              Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-07 17:20 +0200
          Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-07 16:40 +0200
            Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation Peter Zijlstra <peterz@infradead.org> - 2015-10-07 16:50 +0200
              Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-07 18:50 +0200
                Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation Peter Zijlstra <peterz@infradead.org> - 2015-10-08 11:50 +0200
                Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-08 17:40 +0200
                Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation Peter Zijlstra <peterz@infradead.org> - 2015-10-08 19:20 +0200
                Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-08 19:50 +0200
                Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-09 02:20 +0200
                Re: [PATCH tip/core/rcu 02/18] rcu: Move rcu_report_exp_rnp() to  allow consolidation Peter Zijlstra <peterz@infradead.org> - 2015-10-09 10:50 +0200
  [PATCH tip/core/rcu 05/18] rcu: Move synchronize_sched_expedited() to combining tree "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
  [PATCH tip/core/rcu 16/18] rcu: Add tasks to expedited stall-warning messages "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
  [PATCH tip/core/rcu 12/18] cpu: Remove try_get_online_cpus() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
  [PATCH tip/core/rcu 03/18] rcu: Consolidate tree setup for synchronize_rcu_expedited() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
  [PATCH tip/core/rcu 13/18] rcu: Prepare for consolidating expedited CPU selection "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
  [PATCH tip/core/rcu 07/18] rcu: Invert passed_quiesce and rename to cpu_no_qs "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
  [PATCH tip/core/rcu 04/18] rcu: Use single-stage IPI algorithm for RCU expedited grace period "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
    Re: [PATCH tip/core/rcu 04/18] rcu: Use single-stage IPI algorithm  for RCU expedited grace period Peter Zijlstra <peterz@infradead.org> - 2015-10-07 15:30 +0200
      Re: [PATCH tip/core/rcu 04/18] rcu: Use single-stage IPI algorithm  for RCU expedited grace period "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-07 20:20 +0200
    Re: [PATCH tip/core/rcu 04/18] rcu: Use single-stage IPI algorithm  for RCU expedited grace period Peter Zijlstra <peterz@infradead.org> - 2015-10-07 15:40 +0200
      Re: [PATCH tip/core/rcu 04/18] rcu: Use single-stage IPI algorithm  for RCU expedited grace period "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-07 17:50 +0200
    Re: [PATCH tip/core/rcu 04/18] rcu: Use single-stage IPI algorithm  for RCU expedited grace period Peter Zijlstra <peterz@infradead.org> - 2015-10-07 15:50 +0200
      Re: [PATCH tip/core/rcu 04/18] rcu: Use single-stage IPI algorithm  for RCU expedited grace period "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-07 18:20 +0200
        Re: [PATCH tip/core/rcu 04/18] rcu: Use single-stage IPI algorithm  for RCU expedited grace period Peter Zijlstra <peterz@infradead.org> - 2015-10-08 11:10 +0200
    Re: [PATCH tip/core/rcu 04/18] rcu: Use single-stage IPI algorithm  for RCU expedited grace period Peter Zijlstra <peterz@infradead.org> - 2015-10-07 15:50 +0200
      Re: [PATCH tip/core/rcu 04/18] rcu: Use single-stage IPI algorithm  for RCU expedited grace period "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-07 18:20 +0200
  [PATCH tip/core/rcu 09/18] rcu: Switch synchronize_sched_expedited() to IPI "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
    Re: [PATCH tip/core/rcu 09/18] rcu: Switch  synchronize_sched_expedited() to IPI Peter Zijlstra <peterz@infradead.org> - 2015-10-07 16:20 +0200
      Re: [PATCH tip/core/rcu 09/18] rcu: Switch  synchronize_sched_expedited() to IPI "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-07 18:30 +0200
  [PATCH tip/core/rcu 15/18] rcu: Add online/offline info to expedited stall warning message "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
  [PATCH tip/core/rcu 14/18] rcu: Consolidate expedited CPU selection "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
  [PATCH tip/core/rcu 01/18] rcu: Use rsp->expedited_wq instead of sync_rcu_preempt_exp_wq "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
    [PATCH tip/core/rcu 06/18] rcu: Rename qs_pending to core_needs_qs "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200
    [PATCH tip/core/rcu 17/18] rcu: Enable stall warnings for synchronize_rcu_expedited() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:40 +0200

csiph-web