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 1EA777D87C for ; Wed, 29 Aug 2018 01:18:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726889AbeH2FMm (ORCPT ); Wed, 29 Aug 2018 01:12:42 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55428 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725723AbeH2FMl (ORCPT ); Wed, 29 Aug 2018 01:12:41 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 285BD40201C3; Wed, 29 Aug 2018 01:18:21 +0000 (UTC) Received: from llong.remote.csb (ovpn-123-12.rdu2.redhat.com [10.10.123.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id D78642166B41; Wed, 29 Aug 2018 01:18:18 +0000 (UTC) Subject: Re: [PATCH 2/2] fs/dcache: Make negative dentries easier to be reclaimed To: Linus Torvalds Cc: Matthew Wilcox , Al Viro , Jonathan Corbet , Linux Kernel Mailing List , linux-fsdevel , linux-mm , "open list:DOCUMENTATION" , "Luis R. Rodriguez" , Kees Cook , Jan Kara , Paul McKenney , Andrew Morton , Ingo Molnar , Miklos Szeredi , Larry Woodman , James Bottomley , "Wangkai (Kevin,C)" , Michal Hocko References: <1535476780-5773-1-git-send-email-longman@redhat.com> <1535476780-5773-3-git-send-email-longman@redhat.com> <20180828221352.GC11400@bombadil.infradead.org> <6873378b-3202-e738-2366-5fb818b4a013@redhat.com> From: Waiman Long Organization: Red Hat Message-ID: <644e34e7-48b0-3bf4-49c9-a04024d3ca1b@redhat.com> Date: Tue, 28 Aug 2018 21:18:18 -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: 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.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 29 Aug 2018 01:18:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 29 Aug 2018 01:18:21 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.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 08/28/2018 07:10 PM, Linus Torvalds wrote: > On Tue, Aug 28, 2018 at 3:29 PM Waiman Long wrote: >> Yes, I can rewrite it. What is the problem with the abbreviated form? > Either gcc rewrites it for you, or you end up _actually_ using a > function pointer and calling through it. Yes, function pointer will be really bad. > > The latter would be absolutely horribly bad for something like > "list_add()", which should expand to just a couple of instructions. > > And the former would be ok, except for the "you wrote code the garbage > way, and then depended on the compiler fixing it up". Which we > generally try to avoid in the kernel. > > (Don't get me wrong - we definitely depend on the compiler doing a > good job at CSE and dead code elimination etc, but generally we try to > avoid the whole "compiler has to rewrite code to be good" model). > > Linus I see your point here. I will rewrite to use the regular if-then-else. Thanks, Longman