Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758791Ab3FMNls (ORCPT ); Thu, 13 Jun 2013 09:41:48 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:54674 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1756533Ab3FMN14 (ORCPT ); Thu, 13 Jun 2013 09:27:56 -0400 X-IronPort-AV: E=Sophos;i="4.87,858,1363104000"; d="scan'208";a="7537673" From: Tang Chen To: tglx@linutronix.de, mingo@elte.hu, hpa@zytor.com, akpm@linux-foundation.org, tj@kernel.org, trenn@suse.de, yinghai@kernel.org, jiang.liu@huawei.com, wency@cn.fujitsu.com, laijs@cn.fujitsu.com, isimatu.yasuaki@jp.fujitsu.com, mgorman@suse.de, minchan@kernel.org, mina86@mina86.com, gong.chen@linux.intel.com, vasilis.liaskovitis@profitbricks.com, lwoodman@redhat.com, riel@redhat.com, jweiner@redhat.com, prarit@redhat.com Cc: x86@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [Part3 PATCH v2 4/4] mem-hotplug: Do not free LOCAL_NODE_DATA pages to buddy system in hot-remove procedure. Date: Thu, 13 Jun 2013 21:03:56 +0800 Message-Id: <1371128636-9027-5-git-send-email-tangchen@cn.fujitsu.com> X-Mailer: git-send-email 1.7.10.1 In-Reply-To: <1371128636-9027-1-git-send-email-tangchen@cn.fujitsu.com> References: <1371128636-9027-1-git-send-email-tangchen@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/06/13 20:59:03, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/06/13 20:59:04, Serialize complete at 2013/06/13 20:59:04 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1547 Lines: 41 In memory hot-remove procedure, we free pagetable pages to buddy system. But for local pagetable pages, do not free them to buddy system because they were skipped in offline procedure. The memory block they reside in could have been offlined, and we won't offline it again. v1 -> v2: Prevent freeing LOCAL_NODE_DATA pages in free_pagetable() instead of in put_page_bootmem(). Suggested-by: Wu Jianguo Signed-off-by: Tang Chen --- arch/x86/mm/init_64.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 25de304..ffaf24a 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -726,7 +726,13 @@ static void __meminit free_pagetable(struct page *page, int order) if (magic == SECTION_INFO || magic == MIX_SECTION_INFO) { while (nr_pages--) put_page_bootmem(page++); - } else + } else if (!is_local_node_data(page)) + /* + * Do not free pages with local node kernel data + * (for now, just local pagetables) to the buddy + * system because we skipped these pages when + * offlining the corresponding block. + */ __free_pages_bootmem(page, order); } else free_pages((unsigned long)page_address(page), order); -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/