[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTikEgDGt+KrBsZcinKVom5E63Ma6gg@mail.gmail.com>
Date: Wed, 4 May 2011 12:07:42 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Christoph Lameter <cl@...ux.com>
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, 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?
Why the f*%^ do you have to write "irqsafe", when the whole concept
DOES NOT MAKE SENSE without the "irqsafe"?
Why did we have this bug in the first place, in other words? The whole
interface was mis-designed, and pretty much designed to cause bugs.
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.
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.
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.
Linus
--
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