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] [day] [month] [year] [list]
Message-ID: <20120324044830.GF2450@linux.vnet.ibm.com>
Date:	Fri, 23 Mar 2012 21:48:30 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Thomas Gleixner <tglx@...utronix.de>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [GIT PULL] RCU changes for v3.4

On Fri, Mar 23, 2012 at 09:25:04PM -0700, Linus Torvalds wrote:
> On Fri, Mar 23, 2012 at 9:17 PM, Paul E. McKenney
> <paulmck@...ux.vnet.ibm.com> wrote:
> >
> > I must admit that __this_cpu_inc() would be nicer than __this_cpu_add(),
> > though, will fix.  I need the leading "__" to avoid disabling preemption
> > needlessly on non-x86 platforms.
> 
> Yeah, that's just bogus. Ok on that.
> 
> > The reason that the "__raw" forms are
> > safe in this case is because the per-CPU variable is saved and restored
> > at context-switch time.
> >
> > Or am I still missing something here?
> 
> It's not that the "__raw" forms are "safe". It's that they are SH*T.
> 
> Don't use them. They are crap. Why would you do
> 
> +       __raw_get_cpu_var(rcu_read_lock_nesting) =
> +               current->rcu_read_lock_nesting_save;
> 
> which is just crazy and cannot use the actual sane "%fs:" segment
> overrides, but instead has to do idiotic "ready the per-cpu offset
> pointer and add it in".
> 
>  We've got "__this_cpu_write()" which generates the correct code.
> 
> Rule of thumb: there is _never_ any good reason to use
> __raw_get_cpu_var. It's a broken interface.

OK, I will switch to __this_cpu_write(), thank you for the tip.

							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