/* 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
+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
> >> 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?
> >
> 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
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
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
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
>
>
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
>
>
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
>
>
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
>
>
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
>
>
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
>
>
,
> };
>
> 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.
13 matches
Mail list logo