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:	Wed, 4 May 2011 14:30:26 -0500 (CDT)
From:	Christoph Lameter <cl@...ux.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
cc:	Pekka Enberg <penberg@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Tejun Heo <tj@...nel.org>, Ingo Molnar <mingo@...e.hu>,
	Jens Axboe <axboe@...nel.dk>,
	Andrew Morton <akpm@...ux-foundation.org>,
	werner <w.landgraf@...ru>, "H. Peter Anvin" <hpa@...or.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [block IO crash] Re: 2.6.39-rc5-git2 boot crashs

On Wed, 4 May 2011, Linus Torvalds wrote:

> On Wed, May 4, 2011 at 11:49 AM, Christoph Lameter <cl@...ux.com> wrote:
> >
> > The unprotected version is the __this_cpu_cmpxchg_double? That currently
> > has no user and could be removed. But all other functions also have __
> > variants so it was put there for symmetries sake.
>
> No, I'm talking about the regular "this_cpu_cmpxchg_double" with no underscores.
>
> Why the f*!@ does that exist?

Because it is useful if the per cpu serialization only requires
safety from preemption during the cmpxchg.

> Why the f*%^ do you have to write "irqsafe", when the whole concept
> DOES NOT MAKE SENSE without the "irqsafe"?

Because that is how the other irq safe this_cpu_xxx functions are named
and I tried to keep it consistent.

> I think we should remove every single version of
> "this_cpu_cmpxchg_double" except for two: the per-cpu one and the
> SMP-safe one.

The smp safe one would be cmpxchg_double() then. This is part of a future
patchset and would be named like other fully atomic ops. Would not be part
of include/linux/percpu.h because it is not a per cpu related function.

> And the per-cpu one doesn't mention "irqsafe" or "preempt" or anything
> like that, because the whole function makes no sense except when it is
> irq-safe and preempt-safe.

It does make sense because arches that do not have the hardware
capabilities must use fallback implementations that can be faster if f.e.
irqs must not be disabled. And this_cpu_xxx ops are usually used in
performance critical paths.

> So I think the fact that we need to say "irqsafe" is a bug. Plain and simple.
>
> The whole (and ONLY) point of "cmpxchg" is atomicity.
>
> This is not like "add one to something". That's an operation that
> makes sense outside of atomicity issues. But "cmpxchg" is all about
> being atomic.

The naming convention came about from the existing this_cpu_xxx
operations (and yes those starting with the problem of the increment). To
do it differently now just for this function would make it more difficult
to comprehend for someone already familiar with  this_cpu
operations on per cpu data.

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