lkml.org 
[lkml]   [2017]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: locking/atomic: Introduce atomic_try_cmpxchg()
On Fri, Mar 24, 2017 at 12:16 PM, Andy Lutomirski <luto@kernel.org> wrote:
>>
>> Not to mention we cannot use the C11 atomics in kernel because we want
>> to be able to runtime patch LOCK prefixes when only 1 CPU is available.
>
> Is this really a show-stopper? I bet that objtool could be persuaded
> to emit a list of the locations of all those LOCK prefixes.

I doubt it's a show-stopper, if only because nobody cares about UP any
more. Not even the embedded world does.

That said, I'm not convinced that there will ever really be a reason
for the kernel to use the C11 atomics. They just aren't any better
than what we can do ourselves.

The reason for C11 atomics is "portably good atomics". We use
"architecture-specific good atomics" instead, and are willing to
maintain that. We will *have* to maintain that in the forseeable
future anyway, for legacy compiler issues.

So any C11 atomics use by the kernel is realistically at least a
decade away if it *ever* happens.

Don't even worry about it. Planning decades ahead for some detail like
that is stupid.

Linus

\
 
 \ /
  Last update: 2017-03-24 20:23    [W:0.055 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site