mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Dobson <colpatch@us.ibm.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: LSE Tech <lse-tech@lists.sourceforge.net>, Andrew Morton <akpm@osdl.org>
Subject: [RFC PATCH 2/10] Replace 'numnodes' with 'node_online_map' - arm
Date: Thu, 23 Dec 2004 14:37:37 -0800	[thread overview]
Message-ID: <1103841457.3945.20.camel@arrakis> (raw)
In-Reply-To: <1103838712.3945.12.camel@arrakis>

2/10 - Replace numnodes with node_online_map for arm

[mcd@arrakis node_online_map]$ diffstat arch-arm.patch
 arch/arm/mm/init.c                |   34 +++++++++++++++-------------------
 arch/arm/mm/mm-armv.c             |    2 +-
 arch/arm26/mm/init.c              |    3 ++-
 include/asm-arm/arch-pxa/memory.h |    2 --
 4 files changed, 18 insertions(+), 23 deletions(-)


-Matt

diff -Nurp --exclude-from=/home/mcd/.dontdiff linux-2.6.10-rc3-mm1/arch/arm/mm/init.c linux-2.6.10-rc3-mm1-nom.arm/arch/arm/mm/init.c
--- linux-2.6.10-rc3-mm1/arch/arm/mm/init.c	2004-12-13 16:22:55.000000000 -0800
+++ linux-2.6.10-rc3-mm1-nom.arm/arch/arm/mm/init.c	2004-12-15 16:17:24.000000000 -0800
@@ -55,7 +55,7 @@ void show_mem(void)
 	show_free_areas();
 	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 
-	for (node = 0; node < numnodes; node++) {
+	for_each_online_node(node) {
 		struct page *page, *end;
 
 		page = NODE_MEM_MAP(node);
@@ -178,18 +178,14 @@ find_memend_and_nodes(struct meminfo *mi
 
 		node = mi->bank[i].node;
 
-		if (node >= numnodes) {
-			numnodes = node + 1;
-
-			/*
-			 * Make sure we haven't exceeded the maximum number
-			 * of nodes that we have in this configuration.  If
-			 * we have, we're in trouble.  (maybe we ought to
-			 * limit, instead of bugging?)
-			 */
-			if (numnodes > MAX_NUMNODES)
-				BUG();
-		}
+		/*
+		 * Make sure we haven't exceeded the maximum number of nodes
+		 * that we have in this configuration.  If we have, we're in
+		 * trouble.  (maybe we ought to limit, instead of bugging?)
+		 */
+		if (node >= MAX_NUMNODES)
+			BUG();
+		node_set_online(node);
 
 		/*
 		 * Get the start and end pfns for this bank
@@ -211,7 +207,7 @@ find_memend_and_nodes(struct meminfo *mi
 	 * Calculate the number of pages we require to
 	 * store the bootmem bitmaps.
 	 */
-	for (i = 0; i < numnodes; i++) {
+	for_each_online_node(i) {
 		if (np[i].end == 0)
 			continue;
 
@@ -380,13 +376,13 @@ static void __init bootmem_init(struct m
 	 * (we could also do with rolling bootmem_init and paging_init
 	 * into one generic "memory_init" type function).
 	 */
-	np += numnodes - 1;
-	for (node = numnodes - 1; node >= 0; node--, np--) {
+	np += num_online_nodes() - 1;
+	for (node = num_online_nodes() - 1; node >= 0; node--, np--) {
 		/*
 		 * If there are no pages in this node, ignore it.
 		 * Note that node 0 must always have some pages.
 		 */
-		if (np->end == 0) {
+		if (np->end == 0 || !node_online(node)) {
 			if (node == 0)
 				BUG();
 			continue;
@@ -449,7 +445,7 @@ void __init paging_init(struct meminfo *
 	/*
 	 * initialise the zones within each node
 	 */
-	for (node = 0; node < numnodes; node++) {
+	for_each_online_node(node) {
 		unsigned long zone_size[MAX_NR_ZONES];
 		unsigned long zhole_size[MAX_NR_ZONES];
 		struct bootmem_data *bdata;
@@ -558,7 +554,7 @@ void __init mem_init(void)
 		create_memmap_holes(&meminfo);
 
 	/* this will put all unused low memory onto the freelists */
-	for (node = 0; node < numnodes; node++) {
+	for_each_online_node(node) {
 		pg_data_t *pgdat = NODE_DATA(node);
 
 		if (pgdat->node_spanned_pages != 0)
diff -Nurp --exclude-from=/home/mcd/.dontdiff linux-2.6.10-rc3-mm1/arch/arm/mm/mm-armv.c linux-2.6.10-rc3-mm1-nom.arm/arch/arm/mm/mm-armv.c
--- linux-2.6.10-rc3-mm1/arch/arm/mm/mm-armv.c	2004-12-13 16:22:55.000000000 -0800
+++ linux-2.6.10-rc3-mm1-nom.arm/arch/arm/mm/mm-armv.c	2004-12-14 11:57:16.000000000 -0800
@@ -681,6 +681,6 @@ void __init create_memmap_holes(struct m
 {
 	int node;
 
-	for (node = 0; node < numnodes; node++)
+	for_each_online_node(node)
 		free_unused_memmap_node(node, mi);
 }
diff -Nurp --exclude-from=/home/mcd/.dontdiff linux-2.6.10-rc3-mm1/arch/arm26/mm/init.c linux-2.6.10-rc3-mm1-nom.arm/arch/arm26/mm/init.c
--- linux-2.6.10-rc3-mm1/arch/arm26/mm/init.c	2004-12-13 16:22:26.000000000 -0800
+++ linux-2.6.10-rc3-mm1-nom.arm/arch/arm26/mm/init.c	2004-12-14 11:57:16.000000000 -0800
@@ -156,7 +156,8 @@ find_memend_and_nodes(struct meminfo *mi
 {
 	unsigned int memend_pfn = 0;
 
-	numnodes = 1;
+	nodes_clear(node_online_map);
+	node_set_online(0);
 
 	np->bootmap_pages = 0;
 
diff -Nurp --exclude-from=/home/mcd/.dontdiff linux-2.6.10-rc3-mm1/include/asm-arm/arch-pxa/memory.h linux-2.6.10-rc3-mm1-nom.arm/include/asm-arm/arch-pxa/memory.h
--- linux-2.6.10-rc3-mm1/include/asm-arm/arch-pxa/memory.h	2004-12-13 16:23:59.000000000 -0800
+++ linux-2.6.10-rc3-mm1-nom.arm/include/asm-arm/arch-pxa/memory.h	2004-12-16 14:21:50.000000000 -0800
@@ -37,8 +37,6 @@
  * 	node 3:  0xac000000-0xafffffff	-->  0xcc000000-0xcfffffff
  */
 
-#define NR_NODES	4
-
 /*
  * Given a kernel address, find the home node of the underlying memory.
  */



  parent reply	other threads:[~2004-12-23 22:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-23 21:51 [RFC PATCH 0/10] Replace 'numnodes' with 'node_online_map' Matthew Dobson
2004-12-23 22:35 ` [RFC PATCH 1/10] Replace 'numnodes' with 'node_online_map' - alpha Matthew Dobson
2004-12-23 22:37 ` Matthew Dobson [this message]
2004-12-23 22:39 ` [RFC PATCH 3/10] Replace 'numnodes' with 'node_online_map' - i386 Matthew Dobson
2004-12-23 22:40 ` [RFC PATCH 4/10] Replace 'numnodes' with 'node_online_map' - ia64 Matthew Dobson
2004-12-23 22:41 ` [RFC PATCH 5/10] Replace 'numnodes' with 'node_online_map' - m32r Matthew Dobson
2004-12-23 22:42 ` [RFC PATCH 6/10] Replace 'numnodes' with 'node_online_map' - mips Matthew Dobson
2004-12-23 22:44 ` [RFC PATCH 7/10] Replace 'numnodes' with 'node_online_map' - parisc Matthew Dobson
2004-12-23 22:45 ` [RFC PATCH 8/10] Replace 'numnodes' with 'node_online_map' - ppc64 Matthew Dobson
2004-12-23 22:46 ` [RFC PATCH 9/10] Replace 'numnodes' with 'node_online_map' - x86_64 Matthew Dobson
2004-12-23 22:47 ` [RFC PATCH 10/10] Replace 'numnodes' with 'node_online_map' - arch-independent Matthew Dobson

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=1103841457.3945.20.camel@arrakis \
    --to=colpatch@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lse-tech@lists.sourceforge.net \
    /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

Powered by JetHome