linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] namei: Remove unlikely annotation for revalidate check in lookup_fast()
@ 2017-02-06 22:17 Steven Rostedt
  2017-02-07  0:06 ` Al Viro
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2017-02-06 22:17 UTC (permalink / raw)
  To: LKML, Al Viro

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

The likely/unlikely profiler showed that the unlikely around the
dentry->d_flags & DCACHE_OP_REVALIDATE was wrong 95% of the time. Adding
trace_printk()s, it revealed that the dentry ops had hooks to:

 kernfs_dop_revalidate
 pid_revalidate
 proc_sys_revalidate
 tid_fd_revalidate

As tools today now access files that have these operations often, it's best
just to remove the annotation, as it is more dependent on use cases and not
normal mode of operation if it will be true or not.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 fs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/namei.c b/fs/namei.c
index ad74877..23ce3e8 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1599,7 +1599,7 @@ static int lookup_fast(struct nameidata *nd,
 		dentry = __d_lookup(parent, &nd->last);
 		if (unlikely(!dentry))
 			return 0;
-		if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE))
+		if (dentry->d_flags & DCACHE_OP_REVALIDATE)
 			status = d_revalidate(dentry, nd->flags);
 	}
 	if (unlikely(status <= 0)) {
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] namei: Remove unlikely annotation for revalidate check in lookup_fast()
  2017-02-06 22:17 [PATCH] namei: Remove unlikely annotation for revalidate check in lookup_fast() Steven Rostedt
@ 2017-02-07  0:06 ` Al Viro
  2017-02-07  1:34   ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2017-02-07  0:06 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML

On Mon, Feb 06, 2017 at 05:17:35PM -0500, Steven Rostedt wrote:
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> 
> The likely/unlikely profiler showed that the unlikely around the
> dentry->d_flags & DCACHE_OP_REVALIDATE was wrong 95% of the time. Adding
> trace_printk()s, it revealed that the dentry ops had hooks to:
> 
>  kernfs_dop_revalidate
>  pid_revalidate
>  proc_sys_revalidate
>  tid_fd_revalidate
> 
> As tools today now access files that have these operations often, it's best
> just to remove the annotation, as it is more dependent on use cases and not
> normal mode of operation if it will be true or not.

"Tools" being what, exactly?  What kind of load had that been measured on?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] namei: Remove unlikely annotation for revalidate check in lookup_fast()
  2017-02-07  0:06 ` Al Viro
@ 2017-02-07  1:34   ` Steven Rostedt
  0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2017-02-07  1:34 UTC (permalink / raw)
  To: Al Viro; +Cc: LKML

On Tue, 7 Feb 2017 00:06:42 +0000
Al Viro <viro@ZenIV.linux.org.uk> wrote:

> On Mon, Feb 06, 2017 at 05:17:35PM -0500, Steven Rostedt wrote:
> > From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> > 
> > The likely/unlikely profiler showed that the unlikely around the
> > dentry->d_flags & DCACHE_OP_REVALIDATE was wrong 95% of the time. Adding
> > trace_printk()s, it revealed that the dentry ops had hooks to:
> > 
> >  kernfs_dop_revalidate
> >  pid_revalidate
> >  proc_sys_revalidate
> >  tid_fd_revalidate
> > 
> > As tools today now access files that have these operations often, it's best
> > just to remove the annotation, as it is more dependent on use cases and not
> > normal mode of operation if it will be true or not.  
> 
> "Tools" being what, exactly?  What kind of load had that been measured on?

I first saw it on my system that I ran for 3 weeks. But I investigated
it more on a test box that was mostly idle. On the test box the "tools"
was mostly systemd and journald. I can look deeper into it if you like.

-- Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-07  1:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-06 22:17 [PATCH] namei: Remove unlikely annotation for revalidate check in lookup_fast() Steven Rostedt
2017-02-07  0:06 ` Al Viro
2017-02-07  1:34   ` Steven Rostedt

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).