[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260105160545.GK1712166@ZenIV>
Date: Mon, 5 Jan 2026 16:05:45 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Breno Leitao <leitao@...ian.org>
Cc: Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
jlayton@...nel.org, rostedt@...dmis.org, kernel-team@...a.com
Subject: Re: [PATCH] fs/namei: Remove redundant DCACHE_MANAGED_DENTRY check
in __follow_mount_rcu
On Mon, Jan 05, 2026 at 07:10:27AM -0800, Breno Leitao wrote:
> The check for DCACHE_MANAGED_DENTRY at the start of __follow_mount_rcu()
> is redundant because the only caller (handle_mounts) already verifies
> d_managed(dentry) before calling this function, so, dentry in
> __follow_mount_rcu() has always DCACHE_MANAGED_DENTRY set.
... since 9d2a6211a7b9 "fs: tidy up step_into() & friends before inlining",
when the check got duplicated into the caller.
> This early-out optimization never fires in practice - but it is marking
> as likely().
>
> This was detected with branch profiling, which shows 100% misprediction
> in this likely.
>
> Remove the whole if clause instead of removing the likely, given we
> know for sure that dentry is not DCACHE_MANAGED_DENTRY.
AFAICS, that's OK, for the same reason why we didn't need barriers in
the original...
Acked-by: Al Viro <viro@...iv.linux.org.uk>
Powered by blists - more mailing lists