From: John Hubbard <jhubbard@nvidia.com>
To: "Song Bao Hua (Barry Song)" <song.bao.hua@hisilicon.com>,
Randy Dunlap <rdunlap@infradead.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Linuxarm <linuxarm@huawei.com>,
Ralph Campbell <rcampbell@nvidia.com>,
John Garry <john.garry@huawei.com>
Subject: Re: [PATCH] mm/gup_benchmark: GUP_BENCHMARK depends on DEBUG_FS
Date: Sat, 7 Nov 2020 23:53:07 -0800 [thread overview]
Message-ID: <8d2a373c-d88f-9db2-766d-96bd54e69a40@nvidia.com> (raw)
In-Reply-To: <a7a56afecfd7484cb0cce8e1d51a8242@hisilicon.com>
On 11/7/20 11:35 PM, Song Bao Hua (Barry Song) wrote:
> Or do you want this ?
>
> (Code B)
> diff --git a/mm/Kconfig b/mm/Kconfig
> index 01b0ae0cd9d3..a7ff0d31afd5 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -836,6 +836,7 @@ config PERCPU_STATS
>
> config GUP_TEST
> bool "Enable infrastructure for get_user_pages()-related unit tests"
> + depends on DEBUG_FS
> help
> Provides /sys/kernel/debug/gup_test, which in turn provides a way
> to make ioctl calls that can launch kernel-based unit tests for
> @@ -853,6 +854,9 @@ config GUP_TEST
>
> See tools/testing/selftests/vm/gup_test.c
>
> +comment "GUP_TEST needs to have DEBUG_FS enabled"
> + depends on !GUP_TEST && !DEBUG_FS
> +
> config GUP_GET_PTE_LOW_HIGH
> bool
The above, please. It's your original patch, plus a way to display something
if the "depends on" is not met.
>
> To be honest, I am not a big fan of both of code A and B. I think "depends on" has
> clearly said everything the redundant comment wants to say.
It's not really just a "comment", in the sense of commenting the Kconfig sources.
It actually has an effect, which is that it displays something in "make menuconfig".
So it's not redundant, because it provides that output *instead* of hiding the
option entirely, when !DEBUG_FS.
Try it out, it's nice.
>
> │ Symbol: GUP_TEST [=]
> │ Type : bool
> │ Defined at mm/Kconfig:837
> │ Prompt: Enable infrastructure for get_user_pages()-related unit tests
> │ Depends on: DEBUG_FS [=n]
> │ Location:
> │ (1) -> Memory Management option
>
> Menuconfig shows GUP_TEST depends on DEBUG_FS and right now DEBUG_FS is
> "n". so it is impossible to enable GUP_TEST.
>
> "comment" is a good thing, but it is more likely to be used for a menu or a group
> of configurations to extend a bundle of things.
>
> On the other hand, If this particular case needs this comment, so do countless
> other configurations in hundreds of Kconfig files.
Well, maybe, yes.
I personally find it quite difficult, having options appear and disappear on me,
in this system. If they all had this "comment" behavior by default, to show up
as a placeholder, I think it would be a better user experience.
thanks,
--
John Hubbard
NVIDIA
next prev parent reply other threads:[~2020-11-08 7:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-04 10:05 Barry Song
2020-11-07 0:12 ` John Hubbard
2020-11-07 19:05 ` Song Bao Hua (Barry Song)
2020-11-07 19:16 ` John Hubbard
2020-11-07 22:20 ` Randy Dunlap
2020-11-08 0:03 ` John Hubbard
2020-11-08 0:24 ` Randy Dunlap
2020-11-08 1:10 ` John Hubbard
2020-11-08 2:58 ` Song Bao Hua (Barry Song)
2020-11-08 3:14 ` John Hubbard
2020-11-08 3:22 ` John Hubbard
2020-11-08 4:11 ` Randy Dunlap
2020-11-08 4:34 ` Song Bao Hua (Barry Song)
2020-11-08 4:55 ` John Hubbard
2020-11-08 7:35 ` Song Bao Hua (Barry Song)
2020-11-08 7:53 ` John Hubbard [this message]
2020-11-08 4:05 ` Song Bao Hua (Barry Song)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d2a373c-d88f-9db2-766d-96bd54e69a40@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=john.garry@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxarm@huawei.com \
--cc=rcampbell@nvidia.com \
--cc=rdunlap@infradead.org \
--cc=song.bao.hua@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox