linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] mm/hmm: Kconfig improvements for device memory and HMM interaction
@ 2017-07-22  2:33 john.hubbard
  2017-07-22  2:33 ` [PATCH 1/1] " john.hubbard
  0 siblings, 1 reply; 2+ messages in thread
From: john.hubbard @ 2017-07-22  2:33 UTC (permalink / raw)
  To: Jerome Glisse, linux-mm; +Cc: John Hubbard

From: John Hubbard <jhubbard@nvidia.com>

Hi Jerome,

This applies on top of your hmm-next branch at
git://people.freedesktop.org/~glisse/linux.

Related point: even after this patch is applied, I'm still a bit unhappy
about another minor point, which is:

If you select CONFIG_ZONE_DEVICE and CONFIG_HMM_MIRROR, then
CONFIG_DEVICE_PRIVATE is still not selected. As I mentioned earlier,
this configures HMM in a way that is essentially useless. Therefore,
I'm still tempted to have CONFIG_HMM_MIRROR do an auto-select of
CONFIG_DEVICE_PRIVATE, or something like that.

Thoughts on that?

John Hubbard (1):
  mm/hmm: Kconfig improvements for device memory and HMM interaction

 mm/Kconfig | 52 ++++++++++++++++++++++++++--------------------------
 1 file changed, 26 insertions(+), 26 deletions(-)

-- 
2.13.3

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [PATCH 1/1] mm/hmm: Kconfig improvements for device memory and HMM interaction
  2017-07-22  2:33 [PATCH 0/1] mm/hmm: Kconfig improvements for device memory and HMM interaction john.hubbard
@ 2017-07-22  2:33 ` john.hubbard
  0 siblings, 0 replies; 2+ messages in thread
From: john.hubbard @ 2017-07-22  2:33 UTC (permalink / raw)
  To: Jerome Glisse, linux-mm; +Cc: John Hubbard

From: John Hubbard <jhubbard@nvidia.com>

The kernel's configuration for HMM is not perfect. You have to
select "device memory" in order to even see the HMM option, and
then it appears much earlier in the "make menuconfig" settings,
so it's easy to miss. Furthermore, the "device memory" option
doesn't mention that HMM requires it. So basically, HMM is
invisible unless You Know How To Reveal It.

Improve the kernel configuration experience for HMM, by:

1) Moving the HMM section of mm/Kconfig down to just below the
   ZONE_DEVICE option that is a prerequisite to HMM.

2) Adding "HMM" to the one-line Kconfig summary in ZONE_DEVICE

Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
 mm/Kconfig | 52 ++++++++++++++++++++++++++--------------------------
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/mm/Kconfig b/mm/Kconfig
index 424ef60547f8..12007400b7d7 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -262,31 +262,6 @@ config MIGRATION
 config ARCH_ENABLE_HUGEPAGE_MIGRATION
 	bool
 
-config ARCH_HAS_HMM
-	bool
-	default y
-	depends on X86_64
-	depends on ZONE_DEVICE
-	depends on MMU && 64BIT
-	depends on MEMORY_HOTPLUG
-	depends on MEMORY_HOTREMOVE
-	depends on SPARSEMEM_VMEMMAP
-
-config HMM
-	bool
-
-config HMM_MIRROR
-	bool "HMM mirror CPU page table into a device page table"
-	depends on ARCH_HAS_HMM
-	select MMU_NOTIFIER
-	select HMM
-	help
-	  Select HMM_MIRROR if you want to mirror range of the CPU page table of a
-	  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.
-
 config PHYS_ADDR_T_64BIT
 	def_bool 64BIT || ARCH_PHYS_ADDR_T_64BIT
 
@@ -698,7 +673,7 @@ config ARCH_HAS_ZONE_DEVICE
 	bool
 
 config ZONE_DEVICE
-	bool "Device memory (pmem, etc...) hotplug support"
+	bool "Device memory (pmem, HMM, etc...) hotplug support"
 	depends on MEMORY_HOTPLUG
 	depends on MEMORY_HOTREMOVE
 	depends on SPARSEMEM_VMEMMAP
@@ -733,6 +708,31 @@ config DEVICE_PUBLIC
 	  memory; i.e., memory that is accessible from both the device and
 	  the CPU
 
+config ARCH_HAS_HMM
+	bool
+	default y
+	depends on X86_64
+	depends on ZONE_DEVICE
+	depends on MMU && 64BIT
+	depends on MEMORY_HOTPLUG
+	depends on MEMORY_HOTREMOVE
+	depends on SPARSEMEM_VMEMMAP
+
+config HMM
+	bool
+
+config HMM_MIRROR
+	bool "HMM mirror CPU page table into a device page table"
+	depends on ARCH_HAS_HMM
+	select MMU_NOTIFIER
+	select HMM
+	help
+	  Select HMM_MIRROR if you want to mirror range of the CPU page table of a
+	  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.
+
 config FRAME_VECTOR
 	bool
 
-- 
2.13.3

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2017-07-22  2:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-22  2:33 [PATCH 0/1] mm/hmm: Kconfig improvements for device memory and HMM interaction john.hubbard
2017-07-22  2:33 ` [PATCH 1/1] " john.hubbard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).