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=ham 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 815D67D57F for ; Wed, 12 Sep 2018 15:44:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726672AbeILUtb (ORCPT ); Wed, 12 Sep 2018 16:49:31 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44224 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726640AbeILUtb (ORCPT ); Wed, 12 Sep 2018 16:49:31 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8B9C38011059; Wed, 12 Sep 2018 15:44:25 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-55.bos.redhat.com [10.18.17.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id B400810DCF46; Wed, 12 Sep 2018 15:44:24 +0000 (UTC) Subject: Re: [PATCH v3 4/4] fs/dcache: Eliminate branches in nr_dentry_negative accounting To: Dave Chinner 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 References: <1536693506-11949-1-git-send-email-longman@redhat.com> <1536693506-11949-5-git-send-email-longman@redhat.com> <20180911221315.GH5631@dastard> From: Waiman Long Organization: Red Hat Message-ID: Date: Wed, 12 Sep 2018 11:44:24 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20180911221315.GH5631@dastard> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 12 Sep 2018 15:44:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 12 Sep 2018 15:44:25 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'longman@redhat.com' RCPT:'' Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On 09/11/2018 06:13 PM, Dave Chinner wrote: > 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. Yes, this is an optimization. Unfortunately I don't have any performance number as I had not seen any significant performance difference outside of the noise range with these set of changes. I am not fine with not taking this patch. Cheers, Longman