From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 12 Sep 2018 08:13:15 +1000 From: Dave Chinner To: Waiman Long Cc: Alexander Viro , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, "Luis R. Rodriguez" , Kees Cook , Linus Torvalds , Jan Kara , "Paul E. McKenney" , Andrew Morton , Ingo Molnar , Miklos Szeredi , Matthew Wilcox , Larry Woodman , James Bottomley , "Wangkai (Kevin C)" , Michal Hocko Subject: Re: [PATCH v3 4/4] fs/dcache: Eliminate branches in nr_dentry_negative accounting Message-ID: <20180911221315.GH5631@dastard> References: <1536693506-11949-1-git-send-email-longman@redhat.com> <1536693506-11949-5-git-send-email-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1536693506-11949-5-git-send-email-longman@redhat.com> Sender: owner-linux-mm@kvack.org List-ID: On Tue, Sep 11, 2018 at 03:18:26PM -0400, Waiman Long wrote: > Because the accounting of nr_dentry_negative depends on whether a dentry > is a negative one or not, branch instructions are introduced to handle > the accounting conditionally. That may potentially slow down the task > by a noticeable amount if that introduces sizeable amount of additional > branch mispredictions. > > To avoid that, the accounting code is now modified to use conditional > move instructions instead, if supported by the architecture. I think this is a case of over-optimisation. It makes the code harder to read for extremely marginal benefit, and if we ever need to add any more code for negative dentries in these paths the first thing we'll have to do is revert this change. Unless you have numbers demonstrating that it's a clear performance improvement, then NACK for this patch. Cheers, Dave. -- Dave Chinner david@fromorbit.com