diff options
author | Dan Williams <dan.j.williams@intel.com> | 2017-02-08 10:27:01 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-02-08 10:27:01 +1100 |
commit | 97d11d8fb51ffe27807db971587c5699a902fb25 (patch) | |
tree | 2b2bd9400c1fa443f2abc85e608b1805912af45d /mm/Kconfig | |
parent | 91574eceaad7a937da6edc5ee31b21b87934838d (diff) |
mm, devm_memremap_pages: use multi-order radix for ZONE_DEVICE lookups
devm_memremap_pages() records mapped ranges in pgmap_radix with an entry
per section's worth of memory (128MB). The key for each of those entries
is a section number.
This leads to false positives when devm_memremap_pages() is passed a
section-unaligned range as lookups in the misalignment fail to return
NULL. We can close this hole by using the pfn as the key for entries in
the tree. The number of entries required to describe a remapped range is
reduced by leveraging multi-order entries.
In practice this approach usually yields just one entry in the tree if the
size and starting address are of the same power-of-2 alignment.
Previously we always needed nr_entries = mapping_size / 128MB.
Link: https://lists.01.org/pipermail/linux-nvdimm/2016-August/006666.html
Link: http://lkml.kernel.org/r/148486361197.19694.17322218559382955416.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Reported-by: Toshi Kani <toshi.kani@hpe.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/Kconfig')
-rw-r--r-- | mm/Kconfig | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/Kconfig b/mm/Kconfig index 9b8fccb969dc..4aff67e042f1 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -690,6 +690,7 @@ config ZONE_DEVICE depends on MEMORY_HOTREMOVE depends on SPARSEMEM_VMEMMAP depends on X86_64 #arch_add_memory() comprehends device memory + select RADIX_TREE_MULTIORDER help Device memory hotplug support allows for establishing pmem, |