[lkml]   [2017]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 3/4] mm/hmm: fix Kconfig to have valid usage of "select"
The use of "select" like this will most likely cause new
randconfig warnings and failures because the child categories
get chosen, and force select the parent, even though the parent
dependencies are not met. For further details, see "select"
in Documentation/kbuild/kconfig-language.txt file.

But we also don't want to be duplicating the main feature dependencies
across all the child options, which is annoying when the dependencies
change. So we use the typical ARCH_HAS as a dependency collector,
and the existing HMM option is now dependency free, and hence a
valid option for use with "select". It retains its original purpose
which is to be set if and only if any of the child options are set.

Finally, the existing help text is currently orphaned, since the
HMM bool doesn't have a following short description, and hence it
will never be offered to the end user. So delete it, but ensure
the two child options point to the Documentation/vm/hmm.txt file.

Cc: Jérôme Glisse <>
Cc: Evgeny Baskakov <>
Cc: John Hubbard <>
Cc: Mark Hairgrove <>
Cc: Sherry Cheung <>
Cc: Subhash Gutti <>
Cc: Andrew Morton <>
Signed-off-by: Paul Gortmaker <>
mm/Kconfig | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/mm/Kconfig b/mm/Kconfig
index 43d000e44424..3e9c31bf9aaa 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -289,23 +289,17 @@ config MIGRATION

-config HMM
+config ARCH_HAS_HMM
+ default y
depends on MMU && 64BIT
- help
- HMM provides a set of helpers to share a virtual address
- space between CPU and a device, so that the device can access any valid
- address of the process (while still obeying memory protection). HMM also
- provides helpers to migrate process memory to device memory, and back.
- Each set of functionality (address space mirroring, and migration to and
- from device memory) can be used independently of the other.

- This is primarily useful for devices like GPU, for GPGPU compute workload,
- with APIs such as OpenCL or CUDA. See Documentation/vm/hmm.txt.
+config HMM
+ bool

bool "HMM mirror CPU page table into a device page table"
- depends on MMU && 64BIT
+ depends on ARCH_HAS_HMM
select HMM
@@ -313,16 +307,16 @@ config HMM_MIRROR
process into a device page table. Here, mirror means "keep synchronized".
Prerequisites: the device must provide the ability to write-protect its
page tables (at PAGE_SIZE granularity), and must be able to recover from
- the resulting potential page faults.
+ the resulting potential page faults. See Documentation/vm/hmm.txt.

bool "HMM device memory helpers (to leverage ZONE_DEVICE)"
- depends on MMU && 64BIT
+ depends on ARCH_HAS_HMM
select HMM
HMM devmem is a set of helper routines to leverage the ZONE_DEVICE
feature. This is just to avoid having device drivers to replicating a lot
- of boiler plate code.
+ of boiler plate code. See Documentation/vm/hmm.txt.

config PHYS_ADDR_T_64BIT
def_bool 64BIT || ARCH_PHYS_ADDR_T_64BIT
 \ /
  Last update: 2017-04-13 02:33    [W:0.091 / U:10.564 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site