From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85E6DC388F9 for ; Sun, 8 Nov 2020 00:24:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9C629208FE for ; Sun, 8 Nov 2020 00:24:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="AMgxF4iY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C629208FE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C9EB16B0036; Sat, 7 Nov 2020 19:24:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C4E826B005D; Sat, 7 Nov 2020 19:24:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B17F66B0068; Sat, 7 Nov 2020 19:24:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0188.hostedemail.com [216.40.44.188]) by kanga.kvack.org (Postfix) with ESMTP id 84BDF6B0036 for ; Sat, 7 Nov 2020 19:24:54 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 281178249980 for ; Sun, 8 Nov 2020 00:24:54 +0000 (UTC) X-FDA: 77459355708.23.crown51_2e18568272df Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 0019237608 for ; Sun, 8 Nov 2020 00:24:53 +0000 (UTC) X-HE-Tag: crown51_2e18568272df X-Filterd-Recvd-Size: 7795 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Sun, 8 Nov 2020 00:24:53 +0000 (UTC) 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=sty88BTrt0VXwPAWmqAUVdIEgTvdFE2qJcVGa0SOig0=; b=AMgxF4iYOk4ux680wMCOcVrbzS KXrdCYDRM0j9qXR4YtFmzByg2LNQgYlayu8PWaZVVTPOgM7PqaIQiEgAdayoKFqww+zg71eDatb8v Mf/AHlCB+sZzJsxNeEz0Re8KXMSRL/aoF9+D1960JUcrpToqkoYoCwcnG/OdmTL3O17ejAU/8JsbV BWtlTG2c1YVR+MWDm3p1xidMrlad+DdNINzbRP/3HY3WPowuZ+1PlTHoifEWUkBHObCIwiAx+1oHl 9T2HauPE8D5CicpyZ+tydu8p/J7LHwc+f4X/QrNfr81ikXVx5wVD67WlfVqIiJPUSQ/l47QWa4/yf dH5TlEww==; Received: from [2601:1c0:6280:3f0::a1cb] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kbYVa-00047U-O6; Sun, 08 Nov 2020 00:24:39 +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> <2c968615-587c-b978-7961-8391c70382b2@nvidia.com> From: Randy Dunlap Message-ID: <1c8b6d14-7d14-4bd6-0eac-c60fa98aec0b@infradead.org> Date: Sat, 7 Nov 2020 16:24:35 -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: <2c968615-587c-b978-7961-8391c70382b2@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 11/7/20 4:03 PM, John Hubbard wrote: > On 11/7/20 2:20 PM, Randy Dunlap wrote: >> 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] >>> ... >>>>>> =C2=A0=C2=A0=C2=A0 config GUP_BENCHMARK >>>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bool "Enable infrastruc= ture for get_user_pages() and related calls >>>>> benchmarking" >>>>>> +=C2=A0=C2=A0=C2=A0 depends on DEBUG_FS >>>>> >>>>> >>>>> I think "select DEBUG_FS" is better here. "depends on" has the obno= xious >>>>> behavior of hiding the choice from you, if the dependencies aren't = already met. >>>>> Whereas what the developer *really* wants is a no-nonsense activati= on 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 bette= r to use "depends on". >>>> According to >>>> https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0select should be used with care. selec= t will force >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0a symbol to a value without visiting t= he dependencies. >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0By abusing select you are able to sele= ct a symbol FOO even >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if FOO depends on BAR that is not set. >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0In general use select only for non-vis= ible symbols >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(no prompts anywhere) and for symbols = with no dependencies. >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0That will limit the usefulness but on = the other hand avoid >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0the 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 B= arry. >=20 > I ran make menuconfig, and looked at it. Because I want to see the true= end result, > and I didn't trust my grep use, given that the system has interlocking = dependencies, > and I think one select could end up activating others (yes?). >=20 > And sure enough, there are 42 items listed, here they are, cleaned up s= o that there > is one per line: >=20 > ZSMALLOC_STAT [=3Dn] > ZSMALLOC [=3Dm] > BCACHE_CLOSURES_DEBUG [=3Dn] > MD [=3Dy] > BCACHE [=3Dn] > DVB_C8SECTPFE [=3Dn] > MEDIA_SUPPORT [=3Dm] > MEDIA_PLATFORM_SUPPORT [=3Dy] > DVB_PLATFORM_DRIVERS [=3Dn] > PINCT > DRM_I915_DEBUG [=3Dn] > HAS_IOMEM [=3Dy] > EXPERT [=3Dy] > DRM_I915 [=3Dm] > EDAC_DEBUG [=3Dn] > EDAC [=3Dy] > SUNRPC_DEBUG [=3Dn] > NETWORK_FILESYSTEMS [=3Dy] > SUNRPC [=3Dm] > SYSCTL [=3Dy] > PAGE_OWNER [=3Dn] > DEBUG_KERNEL [=3Dy] > STACKTRACE_SUPPORT [=3Dy] > DEBUG_KMEMLEAK [=3Dn] > DEBUG_KERNEL [=3Dy] > HAVE_DEBUG_KMEMLEAK [=3Dy] > BLK_DEV_IO_TRACE [=3Dn] > TRACING_SUPPORT [=3Dy] > FTRACE [=3Dy] > SYSFS [=3Dy] > BLOCK [=3Dy] > PUNIT_ATOM_DEBUG [=3Dn] > PCI [=3Dy] > NOTIFIER_ERROR_INJECTION [=3Dn] > DEBUG_KERNEL [=3Dy] > FAIL_FUTEX [=3Dn] > FAULT_INJECTION [=3Dn] > FUTEX [=3Dy] > KCOV [=3Dn] > ARCH_HAS_KCOV [=3Dy] > CC_HAS_SANCOV_TRACE_PC [=3Dy] > GCC_PLUGINS >=20 OK, thanks, I see how you get that list now. JFTR, those are not 42 independent users of DEBUG_FS. There are lots of &= &s and a few ||s in that list. xconfig shows this for DEBUG_FS: (13 selects for x86_64 allmodconfig) Selected by [y]: - PAGE_OWNER [=3Dy] && DEBUG_KERNEL [=3Dy] && STACKTRACE_SUPPORT [=3Dy] - DEBUG_KMEMLEAK [=3Dy] && DEBUG_KERNEL [=3Dy] && HAVE_DEBUG_KMEMLEAK [=3D= y] - BLK_DEV_IO_TRACE [=3Dy] && TRACING_SUPPORT [=3Dy] && FTRACE [=3Dy] && S= YSFS [=3Dy] && BLOCK [=3Dy] - FAIL_FUTEX [=3Dy] && FAULT_INJECTION [=3Dy] && FUTEX [=3Dy] - KCOV [=3Dy] && ARCH_HAS_KCOV [=3Dy] && (CC_HAS_SANCOV_TRACE_PC [=3Dy] |= | GCC_PLUGINS [=3Dn]) Selected by [m]: - ZSMALLOC_STAT [=3Dy] && ZSMALLOC [=3Dm] - BCACHE_CLOSURES_DEBUG [=3Dy] && MD [=3Dy] && BCACHE [=3Dm] - DVB_C8SECTPFE [=3Dm] && MEDIA_SUPPORT [=3Dm] && MEDIA_PLATFORM_SUPPORT = [=3Dy] && DVB_PLATFORM_DRIVERS [=3Dy] && PINCTRL [=3Dy] && DVB_CORE [=3Dm= ] && I2C [=3Dy] && (ARCH_STI || ARCH_MULTIPLATFORM || COMPILE_TEST [=3Dy]= ) - DRM_I915_DEBUG [=3Dy] && HAS_IOMEM [=3Dy] && EXPERT [=3Dy] && DRM_I915 = [=3Dm] - EDAC_DEBUG [=3Dy] && EDAC [=3Dm] - SUNRPC_DEBUG [=3Dy] && NETWORK_FILESYSTEMS [=3Dy] && SUNRPC [=3Dm] && S= YSCTL [=3Dy] - PUNIT_ATOM_DEBUG [=3Dm] && PCI [=3Dy] - NOTIFIER_ERROR_INJECTION [=3Dm] && DEBUG_KERNEL [=3Dy] Some other $ARCH could be more... >> >> 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. >> >=20 > I agree with the "in general" point, yes. And my complaint is really 80= % due to the > very unhappy situation with Kconfig, where we seem to get a choice betw= een *hiding* > a feature, or forcing a dependency break. What we really want is a way = to indicate > a dependency that doesn't hide entire features, unless we want that. (M= aybe I should > attempt to get into the implementation, although I suspect it's harder = than I > realize.) >=20 > But the other 20% of my complaint is, given what we have, I think the a= ppropriate > adaptation for GUP_BENCHMARK's relationship to DEBUG_FS *in particular*= , is: select. >=20 > And 42 other committers have chosen the same thing, for their relations= hip to > DEBUG_FS. I'm in good company. >=20 > But if you really disagree, then I'd go with, just drop the patch entir= ely, because > it doesn't really make things better as written...IMHO anyway. :) >=20 > thanks, thanks. --=20 ~Randy