linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mm/gup_test: GUP_TEST depends on DEBUG_FS
@ 2020-11-08  8:37 Barry Song
  2020-11-09  7:45 ` John Hubbard
  0 siblings, 1 reply; 3+ messages in thread
From: Barry Song @ 2020-11-08  8:37 UTC (permalink / raw)
  To: akpm, linux-mm, linux-kernel
  Cc: linuxarm, Barry Song, John Hubbard, Ralph Campbell, Randy Dunlap,
	John Garry

Without DEBUG_FS, all the code in gup_test becomes meaningless. For sure
kernel provides debugfs stub while DEBUG_FS is disabled, but the point
here is that GUP_TEST can do nothing without DEBUG_FS.

Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Suggested-by: John Garry <john.garry@huawei.com>
Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
---
 -v2:
 add comment as a prompt to users as commented by John and Randy, thanks!

 mm/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)

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
 
-- 
2.25.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] mm/gup_test: GUP_TEST depends on DEBUG_FS
  2020-11-08  8:37 [PATCH v2] mm/gup_test: GUP_TEST depends on DEBUG_FS Barry Song
@ 2020-11-09  7:45 ` John Hubbard
  2020-11-09  7:52   ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: John Hubbard @ 2020-11-09  7:45 UTC (permalink / raw)
  To: Barry Song, akpm, linux-mm, linux-kernel
  Cc: linuxarm, Ralph Campbell, Randy Dunlap, John Garry

On 11/8/20 12:37 AM, Barry Song wrote:
> Without DEBUG_FS, all the code in gup_test becomes meaningless. For sure
> kernel provides debugfs stub while DEBUG_FS is disabled, but the point
> here is that GUP_TEST can do nothing without DEBUG_FS.
> 
> Cc: John Hubbard <jhubbard@nvidia.com>
> Cc: Ralph Campbell <rcampbell@nvidia.com>
> Cc: Randy Dunlap <rdunlap@infradead.org>
> Suggested-by: John Garry <john.garry@huawei.com>
> Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
> ---
>   -v2:
>   add comment as a prompt to users as commented by John and Randy, thanks!
> 
>   mm/Kconfig | 4 ++++
>   1 file changed, 4 insertions(+)

Thanks for suffering through a lot of discussion about this!

Reviewed-by: John Hubbard <jhubbard@nvidia.com>


thanks,
-- 
John Hubbard
NVIDIA

> 
> 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
>   
> 




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] mm/gup_test: GUP_TEST depends on DEBUG_FS
  2020-11-09  7:45 ` John Hubbard
@ 2020-11-09  7:52   ` Randy Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2020-11-09  7:52 UTC (permalink / raw)
  To: John Hubbard, Barry Song, akpm, linux-mm, linux-kernel
  Cc: linuxarm, Ralph Campbell, John Garry

On 11/8/20 11:45 PM, John Hubbard wrote:
> On 11/8/20 12:37 AM, Barry Song wrote:
>> Without DEBUG_FS, all the code in gup_test becomes meaningless. For sure
>> kernel provides debugfs stub while DEBUG_FS is disabled, but the point
>> here is that GUP_TEST can do nothing without DEBUG_FS.
>>
>> Cc: John Hubbard <jhubbard@nvidia.com>
>> Cc: Ralph Campbell <rcampbell@nvidia.com>
>> Cc: Randy Dunlap <rdunlap@infradead.org>
>> Suggested-by: John Garry <john.garry@huawei.com>
>> Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
>> ---
>>   -v2:
>>   add comment as a prompt to users as commented by John and Randy, thanks!
>>
>>   mm/Kconfig | 4 ++++
>>   1 file changed, 4 insertions(+)
> 
> Thanks for suffering through a lot of discussion about this!
> 
> Reviewed-by: John Hubbard <jhubbard@nvidia.com>
> 
> 
> thanks,

Acked-by: Randy Dunlap <rdunlap@infradead.org>

thanks.

-- 
~Randy


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-09  7:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-08  8:37 [PATCH v2] mm/gup_test: GUP_TEST depends on DEBUG_FS Barry Song
2020-11-09  7:45 ` John Hubbard
2020-11-09  7:52   ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox