public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: keith mannthey <kmannth@us.ibm.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: lhms-devel <lhms-devel@lists.sourceforge.net>,
	Andi Kleen <ak@suse.de>, andrew <akpm@osdl.org>,
	kame <kamezawa.hiroyu@jp.fujitsu.com>,
	dave hansen <haveblue@us.ibm.com>, discuss <discuss@x86-64.org>,
	konrad <darnok@us.ibm.com>
Subject: [Patch] 3/5 in support of hot-add memory x86_64 arch_find_node x86_64
Date: Fri, 28 Jul 2006 19:52:41 -0700	[thread overview]
Message-ID: <1154141562.5874.147.camel@keithlap> (raw)

[-- 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;
+}

             reply	other threads:[~2006-07-29  2:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-29  2:52 keith mannthey [this message]
2006-07-31  8:30 ` [Lhms-devel] [Patch] 3/5 in support of hot-add memory x86_64 arch_find_node x86_64 Yasunori Goto
2006-07-31  8:57   ` Andi Kleen

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=1154141562.5874.147.camel@keithlap \
    --to=kmannth@us.ibm.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=darnok@us.ibm.com \
    --cc=discuss@x86-64.org \
    --cc=haveblue@us.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=lhms-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.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