lkml.org 
[lkml]   [2010]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 15/23] x86, lmb: Add lmb_x86_find_in_range_node()
Date
It can be used to find NODE_DATA for numa.

Need to make sure early_node_map[] is filled before it is called, otherwise
it will fallback to lmb_find_in_range(), with node range.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
arch/x86/include/asm/lmb.h | 1 +
arch/x86/mm/lmb.c | 15 +++++++++++++++
2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/lmb.h b/arch/x86/include/asm/lmb.h
index f7595fd..2ba2394 100644
--- a/arch/x86/include/asm/lmb.h
+++ b/arch/x86/include/asm/lmb.h
@@ -14,5 +14,6 @@ int get_free_all_memory_range(struct range **rangep, int nodeid);
void lmb_x86_register_active_regions(int nid, unsigned long start_pfn,
unsigned long last_pfn);
u64 lmb_x86_hole_size(u64 start, u64 end);
+u64 lmb_x86_find_in_range_node(int nid, u64 start, u64 end, u64 size, u64 align);

#endif
diff --git a/arch/x86/mm/lmb.c b/arch/x86/mm/lmb.c
index d17e115..a99f879 100644
--- a/arch/x86/mm/lmb.c
+++ b/arch/x86/mm/lmb.c
@@ -240,6 +240,21 @@ void __init lmb_x86_free_range(u64 start, u64 end)
}

/*
+ * Need to call this function after lmb_x86_register_active_regions,
+ * so early_node_map[] is filled already.
+ */
+u64 __init lmb_x86_find_in_range_node(int nid, u64 start, u64 end, u64 size, u64 align)
+{
+ u64 addr;
+ addr = find_memory_core_early(nid, size, align, start, end);
+ if (addr != LMB_ERROR)
+ return addr;
+
+ /* Fallback, should already have start end within node range */
+ return lmb_find_in_range(start, end, size, align);
+}
+
+/*
* Finds an active region in the address range from start_pfn to last_pfn and
* returns its range in ei_startpfn and ei_endpfn for the lmb entry.
*/
--
1.6.4.2


\
 
 \ /
  Last update: 2010-07-04 09:05    [W:0.177 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site