All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: benh@kernel.crashing.org, yinghai@kernel.org, hpa@zytor.com,
	tony.luck@intel.com, ralf@linux-mips.org, schwidefsky@de.ibm.com,
	liqin.chen@sunplusct.com, lethal@linux-sh.org,
	davem@davemloft.net, linux-kernel@vger.kernel.org,
	linux-arch@vger.kernel.org
Cc: mingo@redhat.com, Tejun Heo <tj@kernel.org>, sparclinux@vger.kernel.org
Subject: [PATCH 16/23] sparc: Use HAVE_MEMBLOCK_NODE_MAP
Date: Tue, 26 Jul 2011 17:35:27 +0200	[thread overview]
Message-ID: <1311694534-5161-17-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1311694534-5161-1-git-send-email-tj@kernel.org>

sparc doesn't access early_node_map[] directly and enabling
HAVE_MEMBLOCK_NODE_MAP is trivial - replacing add_active_range() calls
with memblock_set_node() and selecting HAVE_MEMBLOCK_NODE_MAP is
enough.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
---
David, memblock now can carry node information itself without relying
on early_node_map[], which makes operations which make use of both
information much saner and generally makes NUMA memory init simpler.

Boot-tested 64bit [!]SMP [!]NUMA on my non-NUMA u60.  Compile tested
32bit [!]SMP.

The patches implementing HAVE_MEMBLOCK_NODE_MAP is currently in
tip:x86/memblock branch on which this patch is based on.

Thanks.

 arch/sparc/Kconfig      |    3 +++
 arch/sparc/mm/init_64.c |   24 ++++--------------------
 2 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 253986b..9ae3b19 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -356,6 +356,9 @@ config NODES_SPAN_OTHER_NODES
 config ARCH_POPULATES_NODE_MAP
 	def_bool y if SPARC64
 
+config HAVE_MEMBLOCK_NODE_MAP
+	def_bool y if SPARC64
+
 config ARCH_SELECT_MEMORY_MODEL
 	def_bool y if SPARC64
 
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index ae9bab4..3985d3b 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -811,7 +811,7 @@ static u64 memblock_nid_range(u64 start, u64 end, int *nid)
 #endif
 
 /* This must be invoked after performing all of the necessary
- * add_active_range() calls for 'nid'.  We need to be able to get
+ * memblock_set_node() calls for 'nid'.  We need to be able to get
  * correct data from get_pfn_range_for_nid().
  */
 static void __init allocate_node_data(int nid)
@@ -982,14 +982,11 @@ static void __init add_node_ranges(void)
 
 			this_end = memblock_nid_range(start, end, &nid);
 
-			numadbg("Adding active range nid[%d] "
+			numadbg("Setting memblock NUMA node nid[%d] "
 				"start[%lx] end[%lx]\n",
 				nid, start, this_end);
 
-			add_active_range(nid,
-					 start >> PAGE_SHIFT,
-					 this_end >> PAGE_SHIFT);
-
+			memblock_set_node(start, this_end - start, nid);
 			start = this_end;
 		}
 	}
@@ -1277,7 +1274,6 @@ static void __init bootmem_init_nonnuma(void)
 {
 	unsigned long top_of_ram = memblock_end_of_DRAM();
 	unsigned long total_ram = memblock_phys_mem_size();
-	struct memblock_region *reg;
 
 	numadbg("bootmem_init_nonnuma()\n");
 
@@ -1287,20 +1283,8 @@ static void __init bootmem_init_nonnuma(void)
 	       (top_of_ram - total_ram) >> 20);
 
 	init_node_masks_nonnuma();
-
-	for_each_memblock(memory, reg) {
-		unsigned long start_pfn, end_pfn;
-
-		if (!reg->size)
-			continue;
-
-		start_pfn = memblock_region_memory_base_pfn(reg);
-		end_pfn = memblock_region_memory_end_pfn(reg);
-		add_active_range(0, start_pfn, end_pfn);
-	}
-
+	memblock_set_node(0, (phys_addr_t)ULLONG_MAX, 0);
 	allocate_node_data(0);
-
 	node_set_online(0);
 }
 
-- 
1.7.6


WARNING: multiple messages have this Message-ID (diff)
From: Tejun Heo <tj@kernel.org>
To: benh@kernel.crashing.org, yinghai@kernel.org, hpa@zytor.com,
	tony.luck@intel.com, ralf@linux-mips.org, schwidefsky@de.ibm.com,
	liqin.chen@sunplusct.com, lethal@linux-sh.org,
	davem@davemloft.net, linux-kernel@vger.kernel.org,
	linux-arch@vger.kernel.org
Cc: mingo@redhat.com, Tejun Heo <tj@kernel.org>, sparclinux@vger.kernel.org
Subject: [PATCH 16/23] sparc: Use HAVE_MEMBLOCK_NODE_MAP
Date: Tue, 26 Jul 2011 15:35:27 +0000	[thread overview]
Message-ID: <1311694534-5161-17-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1311694534-5161-1-git-send-email-tj@kernel.org>

sparc doesn't access early_node_map[] directly and enabling
HAVE_MEMBLOCK_NODE_MAP is trivial - replacing add_active_range() calls
with memblock_set_node() and selecting HAVE_MEMBLOCK_NODE_MAP is
enough.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
---
David, memblock now can carry node information itself without relying
on early_node_map[], which makes operations which make use of both
information much saner and generally makes NUMA memory init simpler.

Boot-tested 64bit [!]SMP [!]NUMA on my non-NUMA u60.  Compile tested
32bit [!]SMP.

The patches implementing HAVE_MEMBLOCK_NODE_MAP is currently in
tip:x86/memblock branch on which this patch is based on.

Thanks.

 arch/sparc/Kconfig      |    3 +++
 arch/sparc/mm/init_64.c |   24 ++++--------------------
 2 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 253986b..9ae3b19 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -356,6 +356,9 @@ config NODES_SPAN_OTHER_NODES
 config ARCH_POPULATES_NODE_MAP
 	def_bool y if SPARC64
 
+config HAVE_MEMBLOCK_NODE_MAP
+	def_bool y if SPARC64
+
 config ARCH_SELECT_MEMORY_MODEL
 	def_bool y if SPARC64
 
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index ae9bab4..3985d3b 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -811,7 +811,7 @@ static u64 memblock_nid_range(u64 start, u64 end, int *nid)
 #endif
 
 /* This must be invoked after performing all of the necessary
- * add_active_range() calls for 'nid'.  We need to be able to get
+ * memblock_set_node() calls for 'nid'.  We need to be able to get
  * correct data from get_pfn_range_for_nid().
  */
 static void __init allocate_node_data(int nid)
@@ -982,14 +982,11 @@ static void __init add_node_ranges(void)
 
 			this_end = memblock_nid_range(start, end, &nid);
 
-			numadbg("Adding active range nid[%d] "
+			numadbg("Setting memblock NUMA node nid[%d] "
 				"start[%lx] end[%lx]\n",
 				nid, start, this_end);
 
-			add_active_range(nid,
-					 start >> PAGE_SHIFT,
-					 this_end >> PAGE_SHIFT);
-
+			memblock_set_node(start, this_end - start, nid);
 			start = this_end;
 		}
 	}
@@ -1277,7 +1274,6 @@ static void __init bootmem_init_nonnuma(void)
 {
 	unsigned long top_of_ram = memblock_end_of_DRAM();
 	unsigned long total_ram = memblock_phys_mem_size();
-	struct memblock_region *reg;
 
 	numadbg("bootmem_init_nonnuma()\n");
 
@@ -1287,20 +1283,8 @@ static void __init bootmem_init_nonnuma(void)
 	       (top_of_ram - total_ram) >> 20);
 
 	init_node_masks_nonnuma();
-
-	for_each_memblock(memory, reg) {
-		unsigned long start_pfn, end_pfn;
-
-		if (!reg->size)
-			continue;
-
-		start_pfn = memblock_region_memory_base_pfn(reg);
-		end_pfn = memblock_region_memory_end_pfn(reg);
-		add_active_range(0, start_pfn, end_pfn);
-	}
-
+	memblock_set_node(0, (phys_addr_t)ULLONG_MAX, 0);
 	allocate_node_data(0);
-
 	node_set_online(0);
 }
 
-- 
1.7.6


  parent reply	other threads:[~2011-07-26 15:39 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26 15:35 [PATCHSET tip:x86/memblock] memblock: Kill early_node_map[] Tejun Heo
2011-07-26 15:35 ` Tejun Heo
2011-07-26 15:35 ` [PATCH 01/23] memblock: Make memblock_overlaps_region() static Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-26 15:35 ` [PATCH 02/23] memblock: Make memblock_{add|remove|free|reserve}() return int and update prototypes Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-26 15:35 ` [PATCH 03/23] memblock: Use memblock_reserve() in memblock internal functions Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-26 15:35 ` [PATCH 04/23] memblock: Add __memblock_dump_all() Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-26 15:35 ` [PATCH 05/23] memblock: Kill sentinel entries at the end of static region arrays Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-26 15:35 ` [PATCH 06/23] memblock: Kill memblock_init() Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-26 15:35 ` [PATCH 07/23] memblock: Separate out memblock_isolate_range() from memblock_set_node() Tejun Heo
2011-07-26 15:35 ` Tejun Heo
2011-07-26 15:35 ` [PATCH 08/23] memblock: Reimplement __memblock_remove() using memblock_isolate_range() Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-28  9:43   ` [PATCH UPDATED " Tejun Heo
2011-07-28  9:43     ` Tejun Heo
2011-07-28  9:43     ` Tejun Heo
2011-07-26 15:35 ` [PATCH 09/23] memblock: Make memblock functions handle overflowing range @size Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-26 15:35 ` [PATCH 10/23] memblock: Reimplement memblock_enforce_memory_limit() using __memblock_remove() Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-26 15:35 ` [PATCH 11/23] powerpc: Cleanup memblock usage Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-26 15:35 ` [PATCH 12/23] memblock: Track total size of regions automatically Tejun Heo
2011-07-26 15:35 ` Tejun Heo
2011-07-26 15:35 ` [PATCH 13/23] memblock: s/memblock_analyze()/memblock_allow_resize()/ and update users Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-26 15:35 ` [PATCH 14/23] memblock: Implement memblock_add_node() Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-26 15:35 ` [PATCH 15/23] powerpc: Use HAVE_MEMBLOCK_NODE_MAP Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-26 15:35 ` Tejun Heo [this message]
2011-07-26 15:35   ` [PATCH 16/23] sparc: " Tejun Heo
2011-08-04  9:52   ` Tejun Heo
2011-08-04  9:52     ` Tejun Heo
2011-08-04  9:52     ` Tejun Heo
2011-08-04 10:13     ` David Miller
2011-08-04 10:13       ` David Miller
2011-08-08 12:30   ` [PATCH UPDATED " Tejun Heo
2011-08-08 12:30     ` Tejun Heo
2011-08-08 12:30     ` Tejun Heo
2011-07-26 15:35 ` [PATCH " Tejun Heo
2011-07-26 15:35 ` [PATCH 17/23] SuperH: " Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-26 15:35 ` [PATCH 18/23] ia64: " Tejun Heo
2011-07-26 15:35 ` Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-07-26 15:35 ` [PATCH 19/23] mips: " Tejun Heo
2011-07-26 15:35   ` Tejun Heo
2011-08-03 16:17   ` Ralf Baechle
2011-08-03 16:26     ` Tejun Heo
2011-07-26 15:35 ` [PATCH 20/23] s390: " Tejun Heo
2011-07-26 15:35 ` Tejun Heo
2011-07-26 15:35 ` [PATCH 21/23] score: " Tejun Heo
2011-07-26 15:35 ` Tejun Heo
2011-07-26 15:35 ` [PATCH 22/23] memblock: Kill early_node_map[] Tejun Heo
2011-07-26 15:35 ` Tejun Heo
2011-08-08 12:32   ` [PATCH UPDATED " Tejun Heo
2011-08-08 12:32     ` Tejun Heo
2011-07-26 15:35 ` [PATCH 23/23] memblock: Reimplement memblock allocation using reverse free area iterator Tejun Heo
2011-07-26 15:35 ` Tejun Heo
2011-07-26 21:14 ` [PATCHSET tip:x86/memblock] memblock: Kill early_node_map[] Yinghai Lu
2011-07-26 21:49   ` Tejun Heo
2011-07-26 22:20     ` H. Peter Anvin
2011-07-28  9:41 ` [PATCH 0.5/23] memblock: Fix include breakages caused by 24aa07882b Tejun Heo
2011-07-28  9:41   ` Tejun Heo
2011-07-28  9:41   ` Tejun Heo
2011-08-18 12:00 ` [PATCHSET tip:x86/memblock] memblock: Kill early_node_map[] Tejun Heo
2011-08-18 12:00   ` Tejun Heo
2011-08-18 21:13   ` H. Peter Anvin
2011-08-18 21:13     ` H. Peter Anvin
2011-11-28 19:31 [PATCHSET tip:x86/memblock] memblock: Kill early_node_map[], take 2 Tejun Heo
2011-11-28 19:31 ` [PATCH 16/23] sparc: Use HAVE_MEMBLOCK_NODE_MAP Tejun Heo
2011-11-28 19:31   ` Tejun Heo

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=1311694534-5161-17-git-send-email-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=hpa@zytor.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liqin.chen@sunplusct.com \
    --cc=mingo@redhat.com \
    --cc=ralf@linux-mips.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=tony.luck@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.