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]
Message-ID: <20090820042124.GC6847@linux.vnet.ibm.com>
Date:	Wed, 19 Aug 2009 21:21:24 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Lai Jiangshan <laijs@...fujitsu.com>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, dipankar@...ibm.com,
	josht@...ux.vnet.ibm.com, akpm@...ux-foundation.org,
	mathieu.desnoyers@...ymtl.ca, dvhltc@...ibm.com, niv@...ibm.com,
	tglx@...utronix.de, peterz@...radead.org, rostedt@...dmis.org,
	hugh.dickins@...cali.co.uk, benh@...nel.crashing.org
Subject: Re: [PATCH -tip/core/rcu 3/6] Simplify RCU CPU-hotplug notification

On Thu, Aug 20, 2009 at 12:02:44PM +0800, Lai Jiangshan wrote:
> Paul E. McKenney wrote:
> > From: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
> > 
> > Use the new cpu_notifier() API to simplify RCU's CPU-hotplug
> > notifiers, collapsing down to a single such notifier.  This
> > makes it trivial to provide the notifier-ordering guarantee
> > that rcu_barrier() depends on.  Also remove redundant
> > open_softirq() calls from Hierarchical RCU notifier.
> > 
> > Signed-off-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
> > ---
> >  kernel/rcupdate.c   |   16 +++++++++++++++-
> >  kernel/rcupreempt.c |   25 ++-----------------------
> >  kernel/rcutree.c    |   17 +++++------------
> >  3 files changed, 22 insertions(+), 36 deletions(-)
> > 
> > diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
> > index eae29c2..8df1156 100644
> > --- a/kernel/rcupdate.c
> > +++ b/kernel/rcupdate.c
> > @@ -217,9 +217,13 @@ static void rcu_migrate_callback(struct rcu_head *notused)
> >  		wake_up(&rcu_migrate_wq);
> >  }
> >  
> > +extern int rcu_cpu_notify(struct notifier_block *self,
> > +			  unsigned long action, void *hcpu);
> > +
> >  static int __cpuinit rcu_barrier_cpu_hotplug(struct notifier_block *self,
> >  		unsigned long action, void *hcpu)
> >  {
> > +	rcu_cpu_notify(self, action, hcpu);
> >  	if (action == CPU_DYING) {
> >  		/*
> >  		 * preempt_disable() in on_each_cpu() prevents stop_machine(),
> > @@ -244,8 +248,18 @@ static int __cpuinit rcu_barrier_cpu_hotplug(struct notifier_block *self,
> >  
> >  void __init rcu_init(void)
> >  {
> > +	int i;
> > +
> >  	__rcu_init();
> > -	hotcpu_notifier(rcu_barrier_cpu_hotplug, 0);
> > +	cpu_notifier(rcu_barrier_cpu_hotplug, 0);
> > +
> > +	/*
> > +	 * We don't need protection against CPU-hotplug here because
> > +	 * this is called early in boot, before either interrupts
> > +	 * or the scheduler are operational.
> > +	 */
> > +	for_each_online_cpu(i)
> > +		rcu_barrier_cpu_hotplug(NULL, CPU_UP_PREPARE, (void *)(long)i);
> 
> I think,
> There is only one cpu in cpu online map at early boot time,
> it is the current cpu.

Indeed there is.  But I wouldn't put it past the fast-boot guys to
parallelize early boot.  ;-)

							Thanx, Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ