From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754701AbbDUKS6 (ORCPT ); Tue, 21 Apr 2015 06:18:58 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:50461 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754572AbbDUKSx (ORCPT ); Tue, 21 Apr 2015 06:18:53 -0400 Message-ID: <55362349.3090406@huawei.com> Date: Tue, 21 Apr 2015 18:15:37 +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: Andrew Morton , Yasuaki Ishimatsu , Kamezawa Hiroyuki , , Tang Chen , Gu Zheng , Xiexiuqi , Mel Gorman , David Rientjes CC: Xishi Qiu , Linux MM , LKML Subject: [PATCH 2/2 V3] memory-hotplug: remove reset_node_managed_pages() and reset_node_managed_pages() in hotadd_new_pgdat() Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.25.179] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.5536234C.0192,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: a353da86a191ee417b0558301f434ad7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After hotadd_new_pgdat()->free_area_init_node(), pgdat's spanned/present are 0, and zone's spanned/present/managed are 0, so remove reset_node_managed_pages() and reset_node_managed_pages(). Signed-off-by: Xishi Qiu --- mm/memory_hotplug.c | 25 ------------------------- 1 files changed, 0 insertions(+), 25 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 49d7c07..ac6462f 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1064,16 +1064,6 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ } #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ -static void reset_node_present_pages(pg_data_t *pgdat) -{ - struct zone *z; - - for (z = pgdat->node_zones; z < pgdat->node_zones + MAX_NR_ZONES; z++) - z->present_pages = 0; - - pgdat->node_present_pages = 0; -} - /* we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG */ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start) { @@ -1108,21 +1098,6 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start) build_all_zonelists(pgdat, NULL); mutex_unlock(&zonelists_mutex); - /* - * zone->managed_pages is set to an approximate value in - * free_area_init_core(), which will cause - * /sys/device/system/node/nodeX/meminfo has wrong data. - * So reset it to 0 before any memory is onlined. - */ - reset_node_managed_pages(pgdat); - - /* - * When memory is hot-added, all the memory is in offline state. So - * clear all zones' present_pages because they will be updated in - * online_pages() and offline_pages(). - */ - reset_node_present_pages(pgdat); - return pgdat; } -- 1.7.1