linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Will Deacon <will@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Elena Reshetova <elena.reshetova@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Hanjun Guo <guohanjun@huawei.com>,
	Jan Glauber <jglauber@marvell.com>
Subject: Re: [PATCH 4/6] lib/refcount: Move bulk of REFCOUNT_FULL implementation into header
Date: Mon, 12 Aug 2019 11:08:06 -0700	[thread overview]
Message-ID: <201908121107.C3262BBB5@keescook> (raw)
In-Reply-To: <20190809160428.smumdvimrtn7rv6u@willie-the-truck>

On Fri, Aug 09, 2019 at 05:04:28PM +0100, Will Deacon wrote:
> On Fri, Aug 02, 2019 at 07:23:07PM -0700, Kees Cook wrote:
> > On Fri, Aug 02, 2019 at 08:52:22PM +0200, Peter Zijlstra wrote:
> > > On Fri, Aug 02, 2019 at 11:09:58AM +0100, Will Deacon wrote:
> > > > In an effort to improve performance of the REFCOUNT_FULL implementation,
> > > > move the bulk of its functions into linux/refcount.h. This allows them
> > > > to be inlined in the same way as if they had been provided via
> > > > CONFIG_ARCH_HAS_REFCOUNT.
> > > 
> > > Hehe, they started out this way, then Linus said to stuff them in a C
> > > file :-)
> > 
> > I asked this at the time and didn't quite get a straight answer; Linus's
> > request was private:
> > 
> > https://lore.kernel.org/lkml/20170213180020.GK6500@twins.programming.kicks-ass.net/
> > 
> > It seemed sensible to me (then and now) to have them be inline if there
> > were so many performance concerns about it, etc. Was it just the image
> > size bloat due to the WARNs? So... since we're back to this topic. Why
> > should they not be inline?
> 
> I mean, I can always just move this into an arm64-specific implementation
> if I have to, but it seems a shame given that it's completely generic and
> seems to perform just as well as the x86-specific implementation on my
> laptop.

Yeah, I prefer this being generic too. I continue to think the race
isn't meaningful compared to the benefit of gaining a reliable and cheap
"inc from zero" check.

-- 
Kees Cook

  reply	other threads:[~2019-08-12 18:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-02 10:09 [PATCH 0/6] Rework REFCOUNT_FULL using atomic_fetch_* operations Will Deacon
2019-08-02 10:09 ` [PATCH 1/6] lib/refcount: Define constants for saturation and max refcount values Will Deacon
2019-08-02 10:09 ` [PATCH 2/6] lib/refcount: Ensure integer operands are treated as signed Will Deacon
2019-08-02 10:09 ` [PATCH 3/6] lib/refcount: Remove unused refcount_*_checked() variants Will Deacon
2019-08-02 10:09 ` [PATCH 4/6] lib/refcount: Move bulk of REFCOUNT_FULL implementation into header Will Deacon
2019-08-02 18:52   ` Peter Zijlstra
2019-08-03  2:23     ` Kees Cook
2019-08-09 16:04       ` Will Deacon
2019-08-12 18:08         ` Kees Cook [this message]
2019-08-02 10:09 ` [PATCH 5/6] lib/refcount: Improve performance of generic REFCOUNT_FULL code Will Deacon
2019-08-02 18:55   ` Peter Zijlstra
2019-08-09 15:38     ` Will Deacon
2019-08-02 10:10 ` [PATCH 6/6] lib/refcount: Consolidate REFCOUNT_{MAX,SATURATED} definitions Will Deacon
2019-08-02 18:49 ` [PATCH 0/6] Rework REFCOUNT_FULL using atomic_fetch_* operations Peter Zijlstra
2019-08-09 15:34   ` Will Deacon

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=201908121107.C3262BBB5@keescook \
    --to=keescook@chromium.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=elena.reshetova@intel.com \
    --cc=guohanjun@huawei.com \
    --cc=jglauber@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=will@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).