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]
Date:	Tue, 20 Sep 2011 12:56:48 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Christoph Lameter <cl@...two.org>
Cc:	Valdis.Kletnieks@...edu, linux-kernel@...r.kernel.org,
	Ingo Molnar <mingo@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [RFC][PATCH 0/5] Introduce checks for preemptable code for
 this_cpu_read/write()

On Tue, 2011-09-20 at 12:31 -0400, Steven Rostedt wrote:

> I personally believe that we shouldn't even have a modification version
> of the snapshot code. But perhaps it is fine for inc and dec and
> cmpxchg. Put "snapshot" in the name to document that this is a hack to
> make things work, and let all other users in the kernel use a name that
> is not confusing.

Looking at some of the uses that this_cpu() is used outside of
preemption seems to be just statistic counters (or buggy). Talking with
Peter and Thomas on IRC, we come to realize that the entire problem with
your API is the "this_cpu". Because it has nothing to do with the
current CPU.

Here are some names that we should change it to:

snapshot_cpu_*()  // my idea

random_cpu_*()    // Thomas's idea

any_cpu_*()       // Thomas's idea


Basically, the English term of "this_cpu" is patently wrong. It has
nothing to do with this cpu as you could be on any cpu at the time.

Lets rename the this_cpu() to something not so confusing and use them in
really the only locations that need them, and change all the
__this_cpu() users into this_cpu() which is exactly what they mean, and
also include the debug checking that we lost with the initial
conversions.

-- Steve


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