From: Al Viro <viro@zeniv.linux.org.uk>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>, linux-fsdevel@vger.kernel.org
Subject: Re: fs/namei.c: Make status likely to be ECHILD in lookup_fast()
Date: Wed, 9 Dec 2020 20:35:00 +0000 [thread overview]
Message-ID: <20201209203500.GQ3579531@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20201209152403.6d6cf9ba@gandalf.local.home>
On Wed, Dec 09, 2020 at 03:24:03PM -0500, Steven Rostedt wrote:
> From: Steven Rostedt (VMware) <rostedt@goodmis.org>
>
> Running my yearly branch profiling code, it detected a 100% wrong branch
> condition in name.c for lookup_fast(). The code in question has:
>
> status = d_revalidate(dentry, nd->flags);
> if (likely(status > 0))
> return dentry;
> if (unlazy_child(nd, dentry, seq))
> return ERR_PTR(-ECHILD);
> if (unlikely(status == -ECHILD))
> /* we'd been told to redo it in non-rcu mode */
> status = d_revalidate(dentry, nd->flags);
>
> If the status of the d_revalidate() is greater than zero, then the function
> finishes. Otherwise, if it is an "unlazy_child" it returns with -ECHILD.
> After the above two checks, the status is compared to -ECHILD, as that is
> what is returned if the original d_revalidate() needed to be done in a
> non-rcu mode.
>
> Especially this path is called in a condition of:
>
> if (nd->flags & LOOKUP_RCU) {
>
> And most of the d_revalidate() functions have:
>
> if (flags & LOOKUP_RCU)
> return -ECHILD;
Umm... That depends upon the filesystem mix involved; said that, I'd rather
drop that "unlikely"...
next prev parent reply other threads:[~2020-12-09 20:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-09 20:24 fs/namei.c: Make status likely to be ECHILD in lookup_fast() Steven Rostedt
2020-12-09 20:35 ` Al Viro [this message]
2020-12-09 20:58 ` Steven Rostedt
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=20201209203500.GQ3579531@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.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;
as well as URLs for NNTP newsgroup(s).