public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] 3/5 in support of hot-add memory x86_64 arch_find_node x86_64
@ 2006-07-29  2:52 keith mannthey
  2006-07-31  8:30 ` [Lhms-devel] " Yasunori Goto
  0 siblings, 1 reply; 3+ messages in thread
From: keith mannthey @ 2006-07-29  2:52 UTC (permalink / raw)
  To: lkml; +Cc: lhms-devel, Andi Kleen, andrew, kame, dave hansen, discuss,
	konrad

[-- Attachment #1: Type: text/plain, Size: 317 bytes --]

Hello all
  This is a enablement of the generic arch_find_node for x86_64. It uses
the nodes_add date collected from the SRAT to do it's lookup. 

I suspect and i386 version will be needed when I get to that arch with
my work. 

This was built against 2.6.18-rc2.

Signed-off-by:  Keith Mannthey <kmannth@us.ibm.com>

[-- Attachment #2: patch-2.6.18-rc2-arch_find_node_x86_64 --]
[-- Type: text/x-patch, Size: 877 bytes --]

diff -urN orig/arch/x86_64/Kconfig work/arch/x86_64/Kconfig
--- orig/arch/x86_64/Kconfig	2006-07-28 13:57:35.000000000 -0400
+++ work/arch/x86_64/Kconfig	2006-07-28 21:20:16.000000000 -0400
@@ -343,6 +343,10 @@
 	def_bool y
 	depends on MEMORY_HOTPLUG
 
+config ARCH_FIND_NODE
+	def_bool y
+	depends on MEMORY_HOTPLUG
+
 config ARCH_FLATMEM_ENABLE
 	def_bool y
 	depends on !NUMA
diff -urN orig/arch/x86_64/mm/srat.c work/arch/x86_64/mm/srat.c
--- orig/arch/x86_64/mm/srat.c	2006-07-28 13:57:35.000000000 -0400
+++ work/arch/x86_64/mm/srat.c	2006-07-28 21:19:01.000000000 -0400
@@ -450,3 +450,15 @@
 }
 
 EXPORT_SYMBOL(__node_distance);
+
+int arch_find_node(unsigned long start, unsigned long size) 
+{
+	int i, ret = 0;
+	unsigned long end = start+size;
+	
+	for_each_node(i) {
+		if (nodes_add[i].start <= start && nodes_add[i].end >= end)
+			ret = i;
+	}
+	return ret;
+}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Lhms-devel] [Patch] 3/5 in support of hot-add memory x86_64 arch_find_node x86_64
  2006-07-29  2:52 [Patch] 3/5 in support of hot-add memory x86_64 arch_find_node x86_64 keith mannthey
@ 2006-07-31  8:30 ` Yasunori Goto
  2006-07-31  8:57   ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Yasunori Goto @ 2006-07-31  8:30 UTC (permalink / raw)
  To: kmannth
  Cc: lkml, andrew, discuss, dave hansen, Andi Kleen, konrad,
	lhms-devel, kame

> diff -urN orig/arch/x86_64/mm/srat.c work/arch/x86_64/mm/srat.c
> --- orig/arch/x86_64/mm/srat.c	2006-07-28 13:57:35.000000000 -0400
> +++ work/arch/x86_64/mm/srat.c	2006-07-28 21:19:01.000000000 -0400
> @@ -450,3 +450,15 @@
>  }
>  
>  EXPORT_SYMBOL(__node_distance);
> +
> +int arch_find_node(unsigned long start, unsigned long size) 
> +{
> +	int i, ret = 0;
> +	unsigned long end = start+size;
> +	
> +	for_each_node(i) {
> +		if (nodes_add[i].start <= start && nodes_add[i].end >= end)
> +			ret = i;
> +	}
> +	return ret;
> +}

BTW, does anyone know why nodes_add[] becomes arch dependent code?

I know it is defined in x86-64. But I mean that SRAT is not
arch dependent. It is defined by just ACPI.
However, each arch which uses ACPI has a own code to parse SRAT table.
Is it hard to merge all of them? Are there any special case?

If they can be merged, this code can be written in driver/acpi/numa.c.


Bye.


-- 
Yasunori Goto 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Lhms-devel] [Patch] 3/5 in support of hot-add memory x86_64 arch_find_node x86_64
  2006-07-31  8:30 ` [Lhms-devel] " Yasunori Goto
@ 2006-07-31  8:57   ` Andi Kleen
  0 siblings, 0 replies; 3+ messages in thread
From: Andi Kleen @ 2006-07-31  8:57 UTC (permalink / raw)
  To: Yasunori Goto
  Cc: kmannth, lkml, andrew, discuss, dave hansen, konrad, lhms-devel,
	kame

 
> I know it is defined in x86-64. But I mean that SRAT is not
> arch dependent. It is defined by just ACPI.
> However, each arch which uses ACPI has a own code to parse SRAT table.
> Is it hard to merge all of them? Are there any special case?

Node setup is architecture specific and quite different between x86-64
and ia64. I guess one could factor out some common sanity code though, but I'm 
not sure it is worth it. Iirc ia64 doesn't do much sanity checking because
they assume the firmware was written by sane people; x86-64 doesn't have
that luxury.

-Andi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-31  9:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-29  2:52 [Patch] 3/5 in support of hot-add memory x86_64 arch_find_node x86_64 keith mannthey
2006-07-31  8:30 ` [Lhms-devel] " Yasunori Goto
2006-07-31  8:57   ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox