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: <20120426144910.GC2407@linux.vnet.ibm.com>
Date:	Thu, 26 Apr 2012 07:49:10 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, laijs@...fujitsu.com,
	dipankar@...ibm.com, akpm@...ux-foundation.org,
	mathieu.desnoyers@...ymtl.ca, josh@...htriplett.org,
	niv@...ibm.com, tglx@...utronix.de, rostedt@...dmis.org,
	Valdis.Kletnieks@...edu, dhowells@...hat.com,
	eric.dumazet@...il.com, darren@...art.com, fweisbec@...il.com,
	patches@...aro.org, "Paul E. McKenney" <paul.mckenney@...aro.org>
Subject: Re: [PATCH RFC tip/core/rcu 3/4] rcu: Make RCU_FAST_NO_HZ account
 for pauses out of idle

On Thu, Apr 26, 2012 at 03:00:42PM +0200, Peter Zijlstra wrote:
> On Mon, 2012-04-23 at 09:16 -0700, Paul E. McKenney wrote:
> >  static DEFINE_PER_CPU(int, rcu_dyntick_drain);
> >  static DEFINE_PER_CPU(unsigned long, rcu_dyntick_holdoff);
> >  static DEFINE_PER_CPU(struct timer_list, rcu_idle_gp_timer);
> > +static DEFINE_PER_CPU(unsigned long, rcu_idle_gp_timer_expires);
> > +static DEFINE_PER_CPU(bool, rcu_idle_first_pass);
> > +static DEFINE_PER_CPU(unsigned long, rcu_nonlazy_posted);
> > +static DEFINE_PER_CPU(unsigned long, rcu_nonlazy_posted_snap);
> 
> 
> Wouldn't that all be prettier if it were in a struct of sorts?
> 
> struct rcu_dyntick {
> 	int			drain;
> 	unsigned long		holdoff;
> 	struct timer_list	gp_timer;
> 	unsigned long		gp_timer_expires;
> 	bool			first_pass;
> 	unsigned long		posted;
> 	unsigned long		posted_snap;
> };
> 
> static DEFINE_PER_CPU(struct rcu_dyntick, rcu_dyntick);
> 
> ( fwiw, bool doesn't have a well specified storage type )
> 
> This way you have more control over the placement, variables are forced
> to be together, instead of at the mercy of whatever per_cpu and the
> linker do, and you more clearly see the holes in the structure.
> 
> All the per_cpu() usage should still work like:
> 
>   per_cpu(rcu_dyntick.first_pass, cpu) = 0;

Excellent point -- I have added that transformation to the todo list for 3.6.

I must confess that I had no idea that you could say the above.  I would
have expected to have to say the following:

    per_cpu(rcu_dyntick, cpu).first_pass = 0;

Not much difference either way, though.

							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