Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2232291pxb; Sat, 7 Nov 2020 14:25:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0c+5UCZN3EzLzship8w7kEkXd+8pjZN3H5iFidj1jByHW3ngCW2sSFzSXvmNfUtEE3xNk X-Received: by 2002:a05:6402:1542:: with SMTP id p2mr8458064edx.298.1604787935172; Sat, 07 Nov 2020 14:25:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604787935; cv=none; d=google.com; s=arc-20160816; b=bMe2PecUctvmDZWylbMyu3CJaVskecGRBzGv4lZlQRv/Gp++mD1gVuthKpz+pHYj4e T/+jzVaPR1eXeM626wpV93axA7KQCETCZ1rLVsoAzL6+speOl/FPq/UyQg9XmB1fbRnO YswuOCASwF0CMOMyNTGoyQm/4hVF616RDmt0TiVr5Ayl0VENeZwp/pgVGzk9HWXkis/h GGGBXOsKFS4qfo48L+ZMiZSVElyu+buz9jkrIORj+DO+7Nppf9RD8uSGWYaS5RHaIOO0 RjjOoACaEpzC1tbIoukdjvmjee7YzggCRMJljDhhBZdfFBDmkq3aBdENAfB/SQFQnq+R LWyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=bu8yT7HYn3OwlgueptTlX3p5x8+22WhUMml2fA/1UvE=; b=rZawefHopGPNhlMrBzd24CxQ1Ss/4JyWdyAHg9JopVNjVowaDY9YOe0BDt9G6oR71g RHVaz69aPxZqbaeCQmOyV11IzrH/ladgghwA6k5jO+OvYgv/rU0CxlpTXjGwFEa9kaOD cUsU5WFltzH883t/6XzJ6dc5kELaeH+uudNm0KhihsFyrfLiEP4C+a/94GRYD4FLHrAe lmuJcmZ8Z/r/hAeDgrhqut50nJgqA8Y1iURy/OPIkneck/LinNxwnrlCc+sUNUzMewu5 1eSwj5dXZyeiQdNCtriuG2JxfjZuRtd5Oe+3ZrbbJs/kX3CIqLGxBHXJWq3xAfUharkZ lnBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qexLaU9E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si3973185edm.477.2020.11.07.14.25.11; Sat, 07 Nov 2020 14:25:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qexLaU9E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728649AbgKGWVR (ORCPT + 99 others); Sat, 7 Nov 2020 17:21:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725838AbgKGWVQ (ORCPT ); Sat, 7 Nov 2020 17:21:16 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 971BAC0613CF for ; Sat, 7 Nov 2020 14:21:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=bu8yT7HYn3OwlgueptTlX3p5x8+22WhUMml2fA/1UvE=; b=qexLaU9EdvqFZJYsCPLzWkJ5XL ZO17Dbh/WcXqQDaWcXfLnTeUMSjE/4jGsxcxGvzfxHLXWEF66UlqzRAg/jnuyxZQwgyyQKwZXiRzd 8iB4DC57YVaQOrS09N0aE0ksVo1a1uivMqNh14SzadhuZUmXnY8GukpbZNRsiJwcdNeGRp97x8R3S KUIGajliM6aXx6IWFp1lnyDvwCJlXf7SYiNUJybZ5c8Y1PiBtoXxSSp7uLdZXhngbDA54t9YuhePe MTYyibatSobwG/KT64edht5NufqLNeZBvFDy721cN7ikHmn629+SyznrNCswnqjek/YPhg/S7eU+E GhA7eALA==; Received: from [2601:1c0:6280:3f0::a1cb] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kbWZw-0005yX-Ad; Sat, 07 Nov 2020 22:21:00 +0000 Subject: Re: [PATCH] mm/gup_benchmark: GUP_BENCHMARK depends on DEBUG_FS To: John Hubbard , "Song Bao Hua (Barry Song)" , "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Cc: Linuxarm , Ralph Campbell , John Garry References: <20201104100552.20156-1-song.bao.hua@hisilicon.com> <9286e2d0e17a47a1874dc4a96d83a38f@hisilicon.com> From: Randy Dunlap Message-ID: Date: Sat, 7 Nov 2020 14:20:56 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/7/20 11:16 AM, John Hubbard wrote: > On 11/7/20 11:05 AM, Song Bao Hua (Barry Song) wrote: >>> -----Original Message----- >>> From: John Hubbard [mailto:jhubbard@nvidia.com] > ... >>>>    config GUP_BENCHMARK >>>>        bool "Enable infrastructure for get_user_pages() and related calls >>> benchmarking" >>>> +    depends on DEBUG_FS >>> >>> >>> I think "select DEBUG_FS" is better here. "depends on" has the obnoxious >>> behavior of hiding the choice from you, if the dependencies aren't already met. >>> Whereas what the developer *really* wants is a no-nonsense activation of the >>> choice: "enable GUP_BENCHMARK and the debug fs that it requires". >>> >> >> To some extent, I agree with you. But I still think here it is better to use "depends on". >> According to >> https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt >> >>     select should be used with care. select will force >>     a symbol to a value without visiting the dependencies. >>     By abusing select you are able to select a symbol FOO even >>     if FOO depends on BAR that is not set. >>     In general use select only for non-visible symbols >>     (no prompts anywhere) and for symbols with no dependencies. >>     That will limit the usefulness but on the other hand avoid >>     the illegal configurations all over. >> >> On the other hand, in kernel there are 78 "depends on DEBUG_FS" and >> only 14 "select DEBUG_FS". >> > > You're not looking at the best statistics. Go look at what *already* selects > DEBUG_FS, and you'll find about 50 items. Sorry, I'm not following you. I see the same 14 "select DEBUG_FS" as Barry. In general we don't want any one large "feature" (or subsystem) to be enabled by one driver. If someone has gone to the trouble to disable DEBUG_FS (or whatever), then a different Kconfig symbol shouldn't undo that. -- ~Randy