From: Rohit Seth <rohitseth@google.com>
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Mel Gorman <mel@csn.ul.ie>,
David Rientjes <rientjes@cs.washington.edu>,
Paul Menage <menage@google.com>, Andrew Morton <akpm@osdl.org>
Subject: [Patch1/4]: fake numa for x86_64 patch
Date: Wed, 22 Nov 2006 17:34:09 -0800 [thread overview]
Message-ID: <1164245649.29844.148.camel@galaxy.corp.google.com> (raw)
This patch provides a IO hole size in a given address range.
Signed-off-by: David Rientjes <reintjes@google.com>
Signed-off-by: Paul Menage <menage@google.com>
Signed-off-by: Rohit Seth <rohitseth@google.com>
--- linux-2.6.19-rc5-mm2.org/include/asm-x86_64/e820.h 2006-11-22 12:20:39.000000000 -0800
+++ linux-2.6.19-rc5-mm2/include/asm-x86_64/e820.h 2006-11-22 12:17:25.000000000 -0800
@@ -46,6 +46,7 @@ extern void e820_mark_nosave_regions(voi
extern void e820_print_map(char *who);
extern int e820_any_mapped(unsigned long start, unsigned long end, unsigned type);
extern int e820_all_mapped(unsigned long start, unsigned long end, unsigned type);
+extern unsigned long e820_hole_size(unsigned long start, unsigned long end);
extern void e820_setup_gap(void);
extern void e820_register_active_regions(int nid,
--- linux-2.6.19-rc5-mm2.org/arch/x86_64/kernel/e820.c 2006-11-22 12:20:55.000000000 -0800
+++ linux-2.6.19-rc5-mm2/arch/x86_64/kernel/e820.c 2006-11-21 18:48:15.000000000 -0800
@@ -184,6 +184,38 @@ unsigned long __init e820_end_of_ram(voi
}
/*
+ * Find the hole size in the range.
+ */
+unsigned long __init e820_hole_size(unsigned long start, unsigned long end)
+{
+ unsigned long ram = 0;
+ int i;
+
+ for (i = 0; i < e820.nr_map; i++) {
+ struct e820entry *ei = &e820.map[i];
+ unsigned long last, addr;
+
+ if (ei->type != E820_RAM ||
+ ei->addr+ei->size <= start ||
+ ei->addr >= end)
+ continue;
+
+ addr = round_up(ei->addr, PAGE_SIZE);
+ if (addr < start)
+ addr = start;
+
+ last = round_down(ei->addr + ei->size, PAGE_SIZE);
+ if (last >= end)
+ last = end;
+
+ if (last > addr)
+ ram += last - addr;
+ }
+ return ((end - start) - ram);
+}
+
+
+/*
* Mark e820 reserved areas as busy for the resource manager.
*/
void __init e820_reserve_resources(void)
next reply other threads:[~2006-11-23 1:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-23 1:34 Rohit Seth [this message]
2006-11-27 13:18 ` Mel Gorman
2006-11-27 18:22 ` Rohit Seth
2006-11-28 13:24 ` Mel Gorman
2006-11-28 18:06 ` Rohit Seth
2006-11-28 21:34 ` Mel Gorman
2006-11-28 22:20 ` Rohit Seth
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=1164245649.29844.148.camel@galaxy.corp.google.com \
--to=rohitseth@google.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mel@csn.ul.ie \
--cc=menage@google.com \
--cc=rientjes@cs.washington.edu \
/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
all inboxes | Powered by JetHome®