Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1584920 > unrolled thread
| Started by | Linus Torvalds <torvalds@linux-foundation.org> |
|---|---|
| First post | 2017-02-20 22:40 +0100 |
| Last post | 2017-02-20 23:40 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [GIT PULL] locking changes for v4.11 Linus Torvalds <torvalds@linux-foundation.org> - 2017-02-20 22:40 +0100
Re: [GIT PULL] locking changes for v4.11 Ingo Molnar <mingo@kernel.org> - 2017-02-20 23:40 +0100
| From | Linus Torvalds <torvalds@linux-foundation.org> |
|---|---|
| Date | 2017-02-20 22:40 +0100 |
| Subject | Re: [GIT PULL] locking changes for v4.11 |
| Message-ID | <td3QB-1zq-1@gated-at.bofh.it> |
On Mon, Feb 20, 2017 at 1:54 AM, Ingo Molnar <mingo@kernel.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
[toc] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2017-02-20 23:40 +0100 |
| Message-ID | <td4MG-2a7-23@gated-at.bofh.it> |
| In reply to | #1584920 |
* Linus Torvalds <torvalds@linux-foundation.org> wrote: > On Mon, Feb 20, 2017 at 1:54 AM, Ingo Molnar <mingo@kernel.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? Yeah, will fix it ASAP! > 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. Yeah, agreed, will do. > But as mentioned, it's in my tree as-is now and going through the build test. Thanks! Ingo
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web