Re: [PATCH v1 2/4] mm/memory_hotplug: remove nid parameter from arch_remove_memory()

2021-07-14 Thread Pankaj Gupta
/* make sure to access a memmap that was actually initialized */ > first_page = pfn_to_page(pfn_first(pgmap, range_id)); > > /* pages are dead and unused, undo the arch mapping */ > - nid = page_to_nid(first_page); > - > mem_hotplug_begin(); > remove_pfn_range_from_zone(page_zone(first_page), > PHYS_PFN(range->start), >PHYS_PFN(range_len(range))); > @@ -155,7 +152,7 @@ static void pageunmap_range(struct dev_pagemap *pgmap, > int range_id) > __remove_pages(PHYS_PFN(range->start), >PHYS_PFN(range_len(range)), NULL); > } else { > - arch_remove_memory(nid, range->start, range_len(range), > + arch_remove_memory(range->start, range_len(range), > pgmap_altmap(pgmap)); > kasan_remove_zero_shadow(__va(range->start), > range_len(range)); > } Reviewed-by: Pankaj Gupta

Re: [PATCH] mm/pmem: Avoid inserting hugepage PTE entry with fsdax if hugepage support is disabled

2021-02-09 Thread Pankaj Gupta
+386,11 @@ static int __init hugepage_init(void) > struct kobject *hugepage_kobj; > > if (!has_transparent_hugepage()) { > - transparent_hugepage_flags = 0; > + /* > +* Hardware doesn't support hugepages, hence disable > +* DAX PMD support. > +*/ > + transparent_hugepage_flags = 1 << > TRANSPARENT_HUGEPAGE_NEVER_DAX; > return -EINVAL; > } Reviewed-by: Pankaj Gupta

Re: [RFC PATCH] powerpc/papr_scm: Implement scm async flush

2020-12-01 Thread Pankaj Gupta
> >> Tha patch implements SCM async-flush hcall and sets the > >> ND_REGION_ASYNC capability when the platform device tree > >> has "ibm,async-flush-required" set. > > > > So, you are reusing the existing ND_REGION_ASYNC flag for the > > hypercall based async flush with device tree discovery? > >

Re: [RFC PATCH] powerpc/papr_scm: Implement scm async flush

2020-12-01 Thread Pankaj Gupta
> Tha patch implements SCM async-flush hcall and sets the > ND_REGION_ASYNC capability when the platform device tree > has "ibm,async-flush-required" set. So, you are reusing the existing ND_REGION_ASYNC flag for the hypercall based async flush with device tree discovery? Out of curiosity, does

Re: [PATCH v3 3/7] mm/memory_hotplug: prepare passing flags to add_memory() and friends

2020-09-10 Thread Pankaj Gupta
ed-by: Juergen Gross # Xen related part > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Dan Williams > Cc: Jason Gunthorpe > Cc: Pankaj Gupta > Cc: Baoquan He > Cc: Wei Yang > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: "Ra

Re: [PATCH v2] mm/sparse: Fix kernel crash with pfn_section_valid check

2020-03-26 Thread Pankaj Gupta
vmemmap mapping can cover multiple sections. Hence before a vmemmap > mapping page can be freed, the kernel needs to make sure there are no valid > sections > within that mapping. Clearing the section valid bit before > depopulate_section_memap enables this. > > Fixes: d41e2f3bd546

Re: [PATCH v3 8/8] mm/memory_hotplug: allow to specify a default online_type

2020-03-19 Thread Pankaj Gupta
m/memory_hotplug.c > @@ -74,10 +74,10 @@ int memhp_default_online_type = MMOP_ONLINE; > > static int __init setup_memhp_default_state(char *str) > { > - if (!strcmp(str, "online")) > - memhp_default_online_type = MMOP_ONLINE; > - else if (!strcmp(str, "offline")) > - memhp_default_online_type = MMOP_OFFLINE; > + const int online_type = memhp_online_type_from_str(str); > + > + if (online_type >= 0) > + memhp_default_online_type = online_type; > > return 1; > } > -- Acked-by: Pankaj Gupta > 2.24.1 > >

Re: [PATCH v3 7/8] mm/memory_hotplug: convert memhp_auto_online to store an online_type

2020-03-19 Thread Pankaj Gupta
line(>dev); > } > > @@ -1065,7 +1066,7 @@ int __ref add_memory_resource(int nid, struct resource > *res) > mem_hotplug_done(); > > /* online pages if requested */ > - if (memhp_auto_online) > + if (memhp_default_online_type != MMOP_OFFLINE) > walk_memory_blocks(start, size, NULL, online_memory_block); > > return ret; > -- Acked-by: Pankaj Gupta > 2.24.1 > >

Re: [PATCH v3 6/8] mm/memory_hotplug: unexport memhp_auto_online

2020-03-19 Thread Pankaj Gupta
6 @@ bool memhp_auto_online; > #else > bool memhp_auto_online = true; > #endif > -EXPORT_SYMBOL_GPL(memhp_auto_online); > > static int __init setup_memhp_default_state(char *str) > { > -- > 2.24.1 Acked-by: Pankaj Gupta > >

Re: [PATCH v3 3/8] drivers/base/memory: store mapping between MMOP_* and string in an array

2020-03-19 Thread Pankaj Gupta
ret = -EINVAL; > - goto err; > - } > - > switch (online_type) { > case MMOP_ONLINE_KERNEL: > case MMOP_ONLINE_MOVABLE: > @@ -271,7 +280,6 @@ static ssize_t state_store(struct device *dev, struct > device_attribute *attr, > ret = -EINVAL; /* should never happen */ > } > > -err: > unlock_device_hotplug(); > > if (ret < 0) > -- Nice cleanup patch. Acked-by: Pankaj Gupta > 2.24.1 > >

Re: [PATCH v3 2/8] drivers/base/memory: map MMOP_OFFLINE to 0

2020-03-19 Thread Pankaj Gupta
7a8ab 100644 > --- a/include/linux/memory_hotplug.h > +++ b/include/linux/memory_hotplug.h > @@ -48,7 +48,7 @@ enum { > /* Types for control the zone type of onlined and offlined memory */ > enum { > /* Offline the memory. */ > - MMOP_OFFLINE = -1, > + MMOP_OFFLINE = 0, > /* Online the memory. Zone depends, see default_zone_for_pfn(). */ > MMOP_ONLINE, > /* Online the memory to ZONE_NORMAL. */ > -- > 2.24.1 Looks good to me. Acked-by: Pankaj Gupta > >

Re: [PATCH v3 1/8] drivers/base/memory: rename MMOP_ONLINE_KEEP to MMOP_ONLINE

2020-03-19 Thread Pankaj Gupta
the zone type of onlined and offlined memory */ > enum { > + /* Offline the memory. */ > MMOP_OFFLINE = -1, > - MMOP_ONLINE_KEEP, > + /* Online the memory. Zone depends, see default_zone_for_pfn(). */ > + MMOP_ONLINE, > + /* Online the memory to ZONE_NORMAL. */ > MMOP_ONLINE_KERNEL, > + /* Online the memory to ZONE_MOVABLE. */ > MMOP_ONLINE_MOVABLE, > }; > > -- Looks good to me. Acked-by: Pankaj Gupta > 2.24.1 > >

Re: [PATCH 1/2] libnvdimm/altmap: Track namespace boundaries in altmap

2019-09-10 Thread Pankaj Gupta
, > }; > > memcpy(res, >res, sizeof(*res)); > diff --git a/include/linux/memremap.h b/include/linux/memremap.h > index f8a5b2a19945..c70996fe48c8 100644 > --- a/include/linux/memremap.h > +++ b/include/linux/memremap.