All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Paul E. McKenney" <paulmck@us.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [GIT PULL] locking changes for v4.11
Date: Mon, 20 Feb 2017 13:31:22 -0800	[thread overview]
Message-ID: <CA+55aFwVYhWuAaQdU97k2Ru5q4DR7Hzo8aNmDsovFpWwJGSgmw@mail.gmail.com> (raw)
In-Reply-To: <20170220095420.GA17198@gmail.com>

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

  parent reply	other threads:[~2017-02-20 21:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20  9:54 [GIT PULL] locking changes for v4.11 Ingo Molnar
2017-02-20 10:26 ` [GIT PULL v2] " Ingo Molnar
2017-02-20 21:31 ` Linus Torvalds [this message]
2017-02-20 22:38   ` [GIT PULL] " Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+55aFwVYhWuAaQdU97k2Ru5q4DR7Hzo8aNmDsovFpWwJGSgmw@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@us.ibm.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.