From: David Laight <David.Laight@ACULAB.COM>
To: 'Kees Cook' <keescook@chromium.org>, Jeff Layton <jlayton@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Jann Horn <jannh@google.com>,
"linux-hardening@vger.kernel.org"
<linux-hardening@vger.kernel.org>,
"Elena Reshetova" <elena.reshetova@intel.com>,
David Windsor <dwindsor@gmail.com>,
Hans Liljestrand <ishkamiel@gmail.com>,
Trond Myklebust <trond.myklebust@hammerspace.com>,
Anna Schumaker <anna@kernel.org>,
"Chuck Lever" <chuck.lever@oracle.com>,
Neil Brown <neilb@suse.de>, Olga Kornievskaia <kolga@netapp.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
"Alexey Gladkov" <legion@kernel.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
"Yu Zhao" <yuzhao@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: RE: [PATCH v2] creds: Convert cred.usage to refcount_t
Date: Mon, 21 Aug 2023 10:18:13 +0000 [thread overview]
Message-ID: <d2bb7f4a8b214e1f8d50176e6d94b118@AcuMS.aculab.com> (raw)
In-Reply-To: <202308181317.66E6C9A5@keescook>
From: Kees Cook
> Sent: Friday, August 18, 2023 9:25 PM
>
> On Fri, Aug 18, 2023 at 04:10:49PM -0400, Jeff Layton wrote:
> > [...]
> > extra checks (supposedly) compile down to nothing. It should be possible
> > to build alternate refcount_t handling functions that are just wrappers
> > around atomic_t with no extra checks, for folks who want to really run
> > "fast and loose".
>
> No -- there's no benefit for this. We already did all this work years
> ago with the fast vs full break-down. All that got tossed out since it
> didn't matter. We did all the performance benchmarking and there was no
> meaningful difference -- refcount _is_ atomic with an added check that
> is branch-predicted away.
Hmmm IIRC recent Intel x86 cpu never do static branch prediction.
So you can't avoid mis-predicted branches in cold code.
David
> Peter Zijlstra and Will Deacon spent a lot of
> time making it run smoothly. :)
>
> -Kees
>
> --
> Kees Cook
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2023-08-21 10:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-18 4:17 [PATCH v2] creds: Convert cred.usage to refcount_t Kees Cook
2023-08-18 17:55 ` Andrew Morton
2023-08-18 18:17 ` Jann Horn
2023-08-18 18:48 ` Kees Cook
2023-08-18 19:31 ` Andrew Morton
2023-08-18 20:10 ` Jeff Layton
2023-08-18 20:24 ` Kees Cook
2023-08-18 21:07 ` Eric W. Biederman
2023-08-21 10:18 ` David Laight [this message]
2023-08-18 20:16 ` Kees Cook
2023-08-18 20:54 ` Jann Horn
2023-08-18 18:46 ` Kees Cook
2023-08-18 20:21 ` David Windsor
2023-08-18 20:12 ` Jeff Layton
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=d2bb7f4a8b214e1f8d50176e6d94b118@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=Dai.Ngo@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=anna@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=davem@davemloft.net \
--cc=dwindsor@gmail.com \
--cc=ebiederm@xmission.com \
--cc=edumazet@google.com \
--cc=elena.reshetova@intel.com \
--cc=ishkamiel@gmail.com \
--cc=jannh@google.com \
--cc=jlayton@kernel.org \
--cc=keescook@chromium.org \
--cc=kolga@netapp.com \
--cc=kuba@kernel.org \
--cc=legion@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=senozhatsky@chromium.org \
--cc=tom@talpey.com \
--cc=trond.myklebust@hammerspace.com \
--cc=yuzhao@google.com \
/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).