From: Jiang Liu <liuj97@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Yinghai Lu <yinghai@kernel.org>
Cc: Jiang Liu <jiang.liu@huawei.com>,
David Rientjes <rientjes@google.com>,
Wen Congyang <wency@cn.fujitsu.com>, Mel Gorman <mgorman@suse.de>,
Minchan Kim <minchan@kernel.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Michal Hocko <mhocko@suse.cz>,
David Howells <dhowells@redhat.com>,
Mark Salter <msalter@redhat.com>,
Jianguo Wu <wujianguo@huawei.com>,
linux-mm@kvack.org, linux-arch@vger.kernel.org,
linux-kernel@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org,
Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>,
Johannes Weiner <hannes@cmpxchg.org>, Tejun Heo <tj@kernel.org>,
sparclinux@vger.kernel.org
Subject: [RFC PATCH v1 19/19] mm: call register_page_bootmem_info_node() from mm core
Date: Sat, 13 Apr 2013 23:36:39 +0800 [thread overview]
Message-ID: <1365867399-21323-20-git-send-email-jiang.liu@huawei.com> (raw)
In-Reply-To: <1365867399-21323-1-git-send-email-jiang.liu@huawei.com>
Function register_page_bootmem_info_node() is suitably defined for
both HOTPLUG and non-HOTPLUG configurations, so we could call it
from mm core instead of arch specific code. This could simplify
arch implementations.
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: sparclinux@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org
---
arch/sparc/mm/init_64.c | 12 ------------
arch/x86/mm/init_64.c | 12 ------------
mm/bootmem.c | 6 ++++++
mm/nobootmem.c | 6 ++++++
4 files changed, 12 insertions(+), 24 deletions(-)
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index b1e35b7..5530c09 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -2027,16 +2027,6 @@ static void __init patch_tlb_miss_handler_bitmap(void)
flushi(&valid_addr_bitmap_insn[0]);
}
-static void __init register_page_bootmem_info(void)
-{
-#ifdef CONFIG_NEED_MULTIPLE_NODES
- int i;
-
- for_each_online_node(i)
- if (NODE_DATA(i)->node_spanned_pages)
- register_page_bootmem_info_node(NODE_DATA(i));
-#endif
-}
void __init mem_init(void)
{
unsigned long addr, last;
@@ -2052,8 +2042,6 @@ void __init mem_init(void)
patch_tlb_miss_handler_bitmap();
high_memory = __va(last_valid_pfn << PAGE_SHIFT);
-
- register_page_bootmem_info();
free_all_bootmem();
/*
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 650264b..72b5141 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1031,24 +1031,12 @@ int __ref arch_remove_memory(u64 start, u64 size)
static struct kcore_list kcore_vsyscall;
-static void __init register_page_bootmem_info(void)
-{
-#ifdef CONFIG_NUMA
- int i;
-
- for_each_online_node(i)
- register_page_bootmem_info_node(NODE_DATA(i));
-#endif
-}
-
void __init mem_init(void)
{
pci_iommu_alloc();
/* clear_bss() already clear the empty_zero_page */
- register_page_bootmem_info();
-
/* this will put all memory onto the freelists */
free_all_bootmem();
after_bootmem = 1;
diff --git a/mm/bootmem.c b/mm/bootmem.c
index fab8f63..3cf36ac 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -273,6 +273,12 @@ unsigned long __init free_all_bootmem(void)
{
unsigned long total_pages = 0;
bootmem_data_t *bdata;
+#ifdef CONFIG_NEED_MULTIPLE_NODES
+ pg_data_t *pgdat;
+
+ for_each_online_pgdat(pgdat)
+ register_page_bootmem_info_node(pgdat);
+#endif
reset_all_zones_managed_pages();
diff --git a/mm/nobootmem.c b/mm/nobootmem.c
index 6b63cd6..ccc6630 100644
--- a/mm/nobootmem.c
+++ b/mm/nobootmem.c
@@ -166,6 +166,12 @@ void __init reset_all_zones_managed_pages(void)
unsigned long __init free_all_bootmem(void)
{
unsigned long pages;
+#ifdef CONFIG_NEED_MULTIPLE_NODES
+ pg_data_t *pgdat;
+
+ for_each_online_pgdat(pgdat)
+ register_page_bootmem_info_node(pgdat);
+#endif
reset_all_zones_managed_pages();
--
1.7.9.5
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2013-04-13 15:44 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-13 15:36 [RFC PATCH v1 00/19] kill free_all_bootmem() and clean up VALID_PAGE() Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 01/19] mm: introduce accessor function set_max_mapnr() Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 02/19] mm/AVR32: prepare for killing free_all_bootmem_node() Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 03/19] mm/IA64: " Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 04/19] mm/m32r: " Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 05/19] mm/m68k: " Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 06/19] mm/metag: " Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 07/19] mm/MIPS: " Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 08/19] mm/PARISC: " Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 09/19] mm/PPC: " Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 10/19] mm/SH: " Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 11/19] mm: kill free_all_bootmem_node() Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 12/19] mm/ALPHA: clean up unused VALID_PAGE() Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 13/19] mm/CRIS: " Jiang Liu
2013-04-15 13:14 ` Jesper Nilsson
2013-04-13 15:36 ` [RFC PATCH v1 14/19] mm/microblaze: " Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 15/19] mm/ARM: fix stale comment about VALID_PAGE() Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 16/19] mm/unicore32: " Jiang Liu
2013-04-15 19:11 ` Xuetao Guan
2013-04-13 15:36 ` [RFC PATCH v1 17/19] mm/m68k: fix build warning of unused variable Jiang Liu
2013-04-13 15:36 ` [RFC PATCH v1 18/19] mm/alpha: unify mem_init() for both UMA and NUMA architectures Jiang Liu
2013-04-13 15:36 ` Jiang Liu [this message]
2013-04-15 4:56 ` [RFC PATCH v1 00/19] kill free_all_bootmem() and clean up VALID_PAGE() Paul Mackerras
2013-04-16 15:04 ` Jiang Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1365867399-21323-20-git-send-email-jiang.liu@huawei.com \
--to=liuj97@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=hpa@zytor.com \
--cc=isimatu.yasuaki@jp.fujitsu.com \
--cc=jiang.liu@huawei.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.cz \
--cc=minchan@kernel.org \
--cc=mingo@redhat.com \
--cc=msalter@redhat.com \
--cc=rientjes@google.com \
--cc=sparclinux@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=wency@cn.fujitsu.com \
--cc=wujianguo@huawei.com \
--cc=x86@kernel.org \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).