From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on archive.lwn.net X-Spam-Level: X-Spam-Status: No, score=-5.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable autolearn_force=no version=3.4.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by archive.lwn.net (Postfix) with ESMTP id 60A737D57F for ; Tue, 11 Sep 2018 22:13:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728148AbeILDOk (ORCPT ); Tue, 11 Sep 2018 23:14:40 -0400 Received: from ipmail06.adl2.internode.on.net ([150.101.137.129]:35913 "EHLO ipmail06.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727796AbeILDOk (ORCPT ); Tue, 11 Sep 2018 23:14:40 -0400 Received: from ppp59-167-129-252.static.internode.on.net (HELO dastard) ([59.167.129.252]) by ipmail06.adl2.internode.on.net with ESMTP; 12 Sep 2018 07:43:16 +0930 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1fzquJ-0003ul-E5; Wed, 12 Sep 2018 08:13:15 +1000 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> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org 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