[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241007145034.GM4017910@ZenIV>
Date: Mon, 7 Oct 2024 15:50:34 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Uros Bizjak <ubizjak@...il.com>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>
Subject: Re: [PATCH] namespace: Use atomic64_inc_return() in alloc_mnt_ns()
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@...il.com>
> Cc: Alexander Viro <viro@...iv.linux.org.uk>
> Cc: Christian Brauner <brauner@...nel.org>
> Cc: Jan Kara <jack@...e.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???
Seriously, if we have something that manages that, I would like
to know - the same load would be a great way to stress a lot of
stuff in fs/namespace.c and fs/pnode.c...
Powered by blists - more mailing lists