[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFx0u8SpEYOkNymXBu7_q5uF-MitrjmpDx9+Uj3fgnxgRg@mail.gmail.com>
Date: Tue, 31 Jan 2017 13:41:17 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Tejun Heo <tj@...nel.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
dougmill@...ux.vnet.ibm.com
Subject: Re: [GIT PULL] percpu fix for v4.10-rc6
On Tue, Jan 31, 2017 at 1:32 PM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> I've pulled this, but I really think it's papering over the real
> issue. Adding "linux-arch" mailing list to ask architecture
> maintainers to check their implementation of the atomic ops that
> return a truth value.
For example, looking at the x86-32 version, I see this:
static inline int atomic64_add_unless(atomic64_t *v, long long a, long long u)
...
return (int)a;
which looks really horribly wrong, but the assembly implementation
actually returns 0/1 in %eax so it ends up being right - just
confusingly so.
Also, to make things more confusing, the underscore version
(__atomic_add_unless()) actually returns the old value, not the truth
value of the comparison.
So this area definitely is messy. The x86-64 versions actually look
fairly clean and return nice boolean values.
Linus
Powered by blists - more mailing lists