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: <20120616051712.GA8252@leaf>
Date:	Fri, 15 Jun 2012 22:17:12 -0700
From:	Josh Triplett <josh@...htriplett.org>
To:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, laijs@...fujitsu.com,
	dipankar@...ibm.com, akpm@...ux-foundation.org,
	mathieu.desnoyers@...ymtl.ca, niv@...ibm.com, tglx@...utronix.de,
	peterz@...radead.org, rostedt@...dmis.org, Valdis.Kletnieks@...edu,
	dhowells@...hat.com, eric.dumazet@...il.com, darren@...art.com,
	fweisbec@...il.com, patches@...aro.org
Subject: Re: [PATCH tip/core/rcu 02/15] rcu: Size rcu_node tree from
 nr_cpu_ids rather than NR_CPUS

On Fri, Jun 15, 2012 at 05:37:14PM -0700, Paul E. McKenney wrote:
> On Fri, Jun 15, 2012 at 02:47:26PM -0700, Josh Triplett wrote:
> > On Fri, Jun 15, 2012 at 02:05:57PM -0700, Paul E. McKenney wrote:
> > > From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
> > > 
> > > The rcu_node tree array is sized based on compile-time constants,
> > > including NR_CPUS.  Although this approach has worked well in the past,
> > > the recent trend by many distros to define NR_CPUS=4096 results in
> > > excessive grace-period-initialization latencies.
> > > 
> > > This commit therefore substitutes the run-time computed nr_cpu_ids for
> > > the compile-time NR_CPUS when building the tree.  This can result in
> > > much of the compile-time-allocated rcu_node array being unused.  If
> > > this is a major problem, you are in a specialized situation anyway,
> > > so you can manually adjust the NR_CPUS, RCU_FANOUT, and RCU_FANOUT_LEAF
> > > kernel config parameters.
> > > 
> > > Signed-off-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
> > > ---
> > >  kernel/rcutree.c        |    2 +-
> > >  kernel/rcutree_plugin.h |    2 ++
> > >  2 files changed, 3 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/kernel/rcutree.c b/kernel/rcutree.c
> > > index a151184..9098910 100644
> > > --- a/kernel/rcutree.c
> > > +++ b/kernel/rcutree.c
> > > @@ -2672,7 +2672,7 @@ static void __init rcu_init_geometry(void)
> > >  {
> > >  	int i;
> > >  	int j;
> > > -	int n = NR_CPUS;
> > > +	int n = nr_cpu_ids;
> > 
> > Same question as before: why have this as a variable when it never
> > changes?
> 
> Ah, that explains why.  This prevented me from forgetting the random
> NR_CPUS.

Does that mean it can go away now that you've written the patches?

- Josh Triplett
--
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