From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751961AbdBFWRl (ORCPT ); Mon, 6 Feb 2017 17:17:41 -0500 Received: from mail.kernel.org ([198.145.29.136]:48188 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbdBFWRj (ORCPT ); Mon, 6 Feb 2017 17:17:39 -0500 Date: Mon, 6 Feb 2017 17:17:35 -0500 From: Steven Rostedt To: LKML , Al Viro Subject: [PATCH] namei: Remove unlikely annotation for revalidate check in lookup_fast() Message-ID: <20170206171735.17d2a5c8@gandalf.local.home> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Steven Rostedt (VMware)" 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) --- 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