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: <20140723182518.GD3935@laptop>
Date:	Wed, 23 Jul 2014 20:25:18 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Dietmar Eggemann <dietmar.eggemann@....com>,
	Michel Dänzer <michel@...nzer.net>,
	Ingo Molnar <mingo@...hat.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Random panic in load_balance() with 3.16-rc

On Wed, Jul 23, 2014 at 10:26:21AM -0700, Linus Torvalds wrote:
> On Wed, Jul 23, 2014 at 10:12 AM, Linus Torvalds
> <torvalds@...ux-foundation.org> wrote:
> >
> > sched_init() definitely does _not_ allocate a cpumask_var.
> 
> Side note: another good rule of thumb for per-cpu variables is:
> 
>  - if you use __get_cpu_var() without taking the address of it, you're
> doing something wrong and stupid.
> 
> The whole - and really *only* - point of __get_cpu_var is to get the
> address of a a cpu variable. If you want to read the *value* of the
> variable, you should use "this_cpu_read()", which can use things like
> special instructions or segments to read the percpu area.

I think this code predates all the this_cpu* magic. But yes, agreed.

> I agree that the interface is not all that great, there's historical
> baggage there. We would have been better off with
> "__this_cpu_ptr(var)" instead of "&__get_cpu_var(var)". But that
> "__get_cpu_var()" is the old way of doing things (predating the new
> and better "this_cpu_read/write/ops()" stuff), which is why we have
> that odd interface with "&__get_cpu_var()".

I think there's a whole bunch of patches by Christoph Lameter, queued by
TJ that remove all __get_cpu_var usage and eventually the interface.
--
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