public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Uros Bizjak <ubizjak@gmail.com>,
	linux-fsdevel@vger.kernel.org,  linux-kernel@vger.kernel.org,
	Jan Kara <jack@suse.cz>
Subject: Re: [PATCH] namespace: Use atomic64_inc_return() in alloc_mnt_ns()
Date: Mon, 7 Oct 2024 16:56:51 +0200	[thread overview]
Message-ID: <20241007-unklar-wurzel-ce2d0693dfc8@brauner> (raw)
In-Reply-To: <20241007145034.GM4017910@ZenIV>

On Mon, Oct 07, 2024 at 03:50:34PM GMT, Al Viro wrote:
> On Mon, Oct 07, 2024 at 10:52:37AM +0200, Uros Bizjak wrote:
> > Use atomic64_inc_return(&ref) instead of atomic64_add_return(1, &ref)
> > to use optimized implementation and ease register pressure around
> > the primitive for targets that implement optimized variant.
> > 
> > Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> > Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> > Cc: Christian Brauner <brauner@kernel.org>
> > Cc: Jan Kara <jack@suse.cz>
> > ---
> >  fs/namespace.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fs/namespace.c b/fs/namespace.c
> > index 93c377816d75..9a3c251d033d 100644
> > --- a/fs/namespace.c
> > +++ b/fs/namespace.c
> > @@ -3901,7 +3901,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns, bool a
> >  	}
> >  	new_ns->ns.ops = &mntns_operations;
> >  	if (!anon)
> > -		new_ns->seq = atomic64_add_return(1, &mnt_ns_seq);
> > +		new_ns->seq = atomic64_inc_return(&mnt_ns_seq);
> 
> On which load do you see that path hot enough for the change to
> make any difference???

I don't think that's really an issue. Imho, *inc_return() is just
straightforward compared to the add variant. That can easily be
reflected in the commit message when I push out.

  reply	other threads:[~2024-10-07 14:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-07  8:52 [PATCH] namespace: Use atomic64_inc_return() in alloc_mnt_ns() Uros Bizjak
2024-10-07 11:39 ` Christian Brauner
2024-10-07 14:50 ` Al Viro
2024-10-07 14:56   ` Christian Brauner [this message]
2024-10-07 15:02   ` Uros Bizjak

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=20241007-unklar-wurzel-ce2d0693dfc8@brauner \
    --to=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ubizjak@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /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