Dan Williams <dan.j.willi...@intel.com> writes:

> Allow sub-section sized ranges to be added to the memmap.
> populate_section_memmap() takes an explict pfn range rather than
> assuming a full section, and those parameters are plumbed all the way
> through to vmmemap_populate(). There should be no sub-section usage in
> current deployments. New warnings are added to clarify which memmap
> allocation paths are sub-section capable.
>
> Cc: Michal Hocko <mho...@suse.com>
> Cc: David Hildenbrand <da...@redhat.com>
> Cc: Logan Gunthorpe <log...@deltatee.com>
> Cc: Oscar Salvador <osalva...@suse.de>
> Reviewed-by: Pavel Tatashin <pasha.tatas...@soleen.com>
> Signed-off-by: Dan Williams <dan.j.willi...@intel.com>
> ---
>  arch/x86/mm/init_64.c |    4 ++-
>  include/linux/mm.h    |    4 ++-
>  mm/sparse-vmemmap.c   |   21 +++++++++++------
>  mm/sparse.c           |   61 
> +++++++++++++++++++++++++++++++------------------
>  4 files changed, 57 insertions(+), 33 deletions(-)
>
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 8335ac6e1112..688fb0687e55 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -1520,7 +1520,9 @@ int __meminit vmemmap_populate(unsigned long start, 
> unsigned long end, int node,
>  {
>       int err;
>  
> -     if (boot_cpu_has(X86_FEATURE_PSE))
> +     if (end - start < PAGES_PER_SECTION * sizeof(struct page))
> +             err = vmemmap_populate_basepages(start, end, node);
> +     else if (boot_cpu_has(X86_FEATURE_PSE))
>               err = vmemmap_populate_hugepages(start, end, node, altmap);
>       else if (altmap) {
>               pr_err_once("%s: no cpu support for altmap allocations\n",

Can we move this to another patch? I am wondering what the x86 behaviour
here is? If the range is less that PAGES_PER_SECTION we don't allow to
use pmem as the map device? We sliently use memory range?

-aneesh

Reply via email to