public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Will Deacon <will@kernel.org>
Cc: linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.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 v2 0/6] Rework REFCOUNT_FULL using atomic_fetch_* operations
Date: Wed, 28 Aug 2019 09:30:52 +0200	[thread overview]
Message-ID: <20190828073052.GL2332@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190827163204.29903-1-will@kernel.org>

On Tue, Aug 27, 2019 at 05:31:58PM +0100, Will Deacon wrote:
> Will Deacon (6):
>   lib/refcount: Define constants for saturation and max refcount values
>   lib/refcount: Ensure integer operands are treated as signed
>   lib/refcount: Remove unused refcount_*_checked() variants
>   lib/refcount: Move bulk of REFCOUNT_FULL implementation into header
>   lib/refcount: Improve performance of generic REFCOUNT_FULL code
>   lib/refcount: Consolidate REFCOUNT_{MAX,SATURATED} definitions

So I'm not a fan; I itch at the whole racy nature of this thing and I
find the code less than obvious. Yet, I have to agree it is exceedingly
unlikely the race will ever actually happen, I just don't want to be the
one having to debug it.

I've not looked at the implementation much; does it do all the same
checks the FULL one does? The x86-asm one misses a few iirc, so if this
is similarly fast but has all the checks, it is in fact better.

Can't we make this a default !FULL implementation?

  parent reply	other threads:[~2019-08-28  7:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27 16:31 [PATCH v2 0/6] Rework REFCOUNT_FULL using atomic_fetch_* operations Will Deacon
2019-08-27 16:31 ` [PATCH v2 1/6] lib/refcount: Define constants for saturation and max refcount values Will Deacon
2019-08-27 16:32 ` [PATCH v2 2/6] lib/refcount: Ensure integer operands are treated as signed Will Deacon
2019-08-27 16:32 ` [PATCH v2 3/6] lib/refcount: Remove unused refcount_*_checked() variants Will Deacon
2019-08-27 16:32 ` [PATCH v2 4/6] lib/refcount: Move bulk of REFCOUNT_FULL implementation into header Will Deacon
2019-08-27 16:32 ` [PATCH v2 5/6] lib/refcount: Improve performance of generic REFCOUNT_FULL code Will Deacon
2019-08-27 16:32 ` [PATCH v2 6/6] lib/refcount: Consolidate REFCOUNT_{MAX,SATURATED} definitions Will Deacon
2019-08-27 17:51 ` [PATCH v2 0/6] Rework REFCOUNT_FULL using atomic_fetch_* operations Kees Cook
2019-08-28  7:30 ` Peter Zijlstra [this message]
2019-08-28 14:14   ` Will Deacon
2019-08-28 21:03     ` Kees Cook
2019-08-31 17:48       ` Ard Biesheuvel
2019-08-31 19:02         ` Kees Cook
2019-08-31 20:54           ` Ard Biesheuvel
2019-09-06 13:43       ` Will Deacon
2019-09-07  1:57         ` Hanjun Guo

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=20190828073052.GL2332@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=elena.reshetova@intel.com \
    --cc=guohanjun@huawei.com \
    --cc=jglauber@marvell.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.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