Re: [HMM 01/16] mm/memory/hotplug: add memory type parameter to arch_add/remove_memory
From: Anshuman Khandual
Date: Thu Apr 06 2017 - 05:46:17 EST
> diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
> index 5f84433..0933261 100644
> --- a/arch/powerpc/mm/mem.c
> +++ b/arch/powerpc/mm/mem.c
> @@ -126,14 +126,31 @@ int __weak remove_section_mapping(unsigned long start, unsigned long end)
> return -ENODEV;
> }
>
> -int arch_add_memory(int nid, u64 start, u64 size, bool for_device)
> +int arch_add_memory(int nid, u64 start, u64 size, enum memory_type type)
> {
> struct pglist_data *pgdata;
> - struct zone *zone;
> unsigned long start_pfn = start >> PAGE_SHIFT;
> unsigned long nr_pages = size >> PAGE_SHIFT;
> + bool for_device = false;
> + struct zone *zone;
> int rc;
>
> + /*
> + * Each memory_type needs special handling, so error out on an
> + * unsupported type. In particular, MEMORY_DEVICE_UNADDRESSABLE
> + * is not supported on this architecture.
The concept of MEMORY_DEVICE_UNADDRESSABLE has not been
introduced yet in this patch if I read correctly.