From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753307AbcLOGlg (ORCPT ); Thu, 15 Dec 2016 01:41:36 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:2256 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751125AbcLOGlf (ORCPT ); Thu, 15 Dec 2016 01:41:35 -0500 Message-ID: <58523AC5.10800@huawei.com> Date: Thu, 15 Dec 2016 14:40:05 +0800 From: Xishi Qiu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Maciej Bielski CC: , , , , , Subject: Re: [RFC PATCH] Memory hotplug support for arm64 platform References: <1481717765-31186-1-git-send-email-m.bielski@virtualopensystems.com> <58523598.3080902@huawei.com> In-Reply-To: <58523598.3080902@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.25.179] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > From mboxrd@z Thu Jan 1 00:00:00 1970 From: qiuxishi@huawei.com (Xishi Qiu) Date: Thu, 15 Dec 2016 14:40:05 +0800 Subject: [RFC PATCH] Memory hotplug support for arm64 platform In-Reply-To: <58523598.3080902@huawei.com> References: <1481717765-31186-1-git-send-email-m.bielski@virtualopensystems.com> <58523598.3080902@huawei.com> Message-ID: <58523AC5.10800@huawei.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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 >