Re: [RFC PATCH] Memory hotplug support for arm64 platform

From: Xishi Qiu
Date: Thu Dec 15 2016 - 01:41:39 EST


On 2016/12/15 14:18, Xishi Qiu wrote:

> On 2016/12/14 20:16, Maciej Bielski wrote:
>
>>
>>
>> -#ifdef CONFIG_MEMORY_HOTREMOVE
>> -int arch_remove_memory(u64 start, u64 size)
>> -{
>> - unsigned long start_pfn = start >> PAGE_SHIFT;
>> - unsigned long nr_pages = size >> PAGE_SHIFT;
>> - struct zone *zone;
>> - int ret;
>> + SetPageReserved(pfn_to_page(pfn));
>> + }
>
> Hi Maciej,
>
> Why we need to set reserved here?
> I think the new pages are already reserved in __add_zone() -> memmap_init_zone(), right?
>

Hi Maciej,

The reason is as follows, right?

It's because that in memmap_init_zone() -> early_pfn_valid(), the new page is still
invalid, so we need to init it after memblock_clear_nomap()

So why not use __init_single_page() and set_pageblock_migratetype()?

> Thanks,
> Xishi Qiu
>