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  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:   Mon, 20 Feb 2017 13:31:22 -0800
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     Ingo Molnar <mingo@...nel.org>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Thomas Gleixner <tglx@...utronix.de>,
        "Paul E. McKenney" <paulmck@...ibm.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [GIT PULL] locking changes for v4.11

On Mon, Feb 20, 2017 at 1:54 AM, Ingo Molnar <mingo@...nel.org> wrote:
>
>  - Implement wraparound-safe refcount_t and kref_t types based on generic atomic
>    primitives (Peter Zijlstra)

Ugh. This apparently never got the uninlining fixes?

I've pulled it, but I still don't like the inlining. Particularly with
CONFIG_DEBUG_REFCOUNT it generates obnnoxious code, but even without
the debugging there's just no point in it.

Being inlined also means that architectures cannot optimize it, which
is sad. If you have a LL/SC model for atomics, then using
atomic_cmpxchg_relaxed() for the refcounting is just too stupid for
words.

So I continue to think this code should

 (a) be in lib/refcount.c, with just the declarations in the header
file (oh, keep the "set" and "read" functions inline by all means)

 (b) be marked __weak, so that architectures like ARM/PPC can decide
to do their own improved implementations.

But as mentioned, it's in my tree as-is now and going through the build test.

              Linus

Powered by blists - more mailing lists