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: <1316538516.29966.103.camel@gandalf.stny.rr.com>
Date:	Tue, 20 Sep 2011 13:08:36 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	Christoph Lameter <cl@...two.org>,
	LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Christoph Lameter <cl@...ux.com>, Tejun Heo <htejun@...il.com>
Subject: Re: [RFC][PATCH 2/5] mm: Switch mod_state() to __this_cpu_read()

On Tue, 2011-09-20 at 18:51 +0200, Thomas Gleixner wrote:

> this_cpu_*() is patently wrong. It should be: random_cpu_*() or
> any_cpu_*(). This way you could have avoided confusion in the first
> place and made it entirely clear what the interfaces are about.

Thinking about this, my vote is for "any_cpu_*()". I initially liked my
own snapshot_cpu_*(), and even random_cpu_*() is humorous. But truly,
the "any_cpu_*()" has the best meaning. As you really don't seem to care
about which CPU you access. Sure you can document something like:

/*
 * Will modify the per cpu data on the current CPU, but there is no
 * guarantee which CPU you may be on, as you can migrate just before
 * or after calling this function. Only the scope of this function
 * will be atomic to the CPU the task is currently on, but no guarantee
 * before or after the function. If you care about that, disable
 * preemption and use the this_cpu_*() variants.
 */

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