xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/11] [XEN] NUMA helper macros
@ 2010-04-04 19:30 Dulloor
  0 siblings, 0 replies; only message in thread
From: Dulloor @ 2010-04-04 19:30 UTC (permalink / raw)
  To: xen-devel

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

The patch adds a few simple helper macros to NUMA code.

-dulloor

Signed-off-by: Dulloor Rao <dulloor@gatech.edu>

[-- Attachment #2: xen-01-minor-cleanup.patch --]
[-- Type: text/x-patch, Size: 1987 bytes --]

diff -r ebd84be3420a -r dd0cdf8346df xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Tue Mar 30 18:31:39 2010 +0100
+++ b/xen/common/page_alloc.c	Tue Mar 30 18:03:27 2010 -0400
@@ -879,6 +879,11 @@
     return total_avail_pages - midsize_alloc_zone_pages;
 }
 
+unsigned long avail_node_heap_pages(unsigned int node)
+{
+    return avail_heap_pages(MEMZONE_XEN, NR_ZONES-1, node);
+}
+
 void __init end_boot_allocator(void)
 {
     unsigned int i;
diff -r ebd84be3420a -r dd0cdf8346df xen/include/asm-x86/numa.h
--- a/xen/include/asm-x86/numa.h	Tue Mar 30 18:31:39 2010 +0100
+++ b/xen/include/asm-x86/numa.h	Tue Mar 30 18:03:27 2010 -0400
@@ -12,7 +12,7 @@
 
 #define cpu_to_node(cpu)		(cpu_to_node[cpu])
 #define parent_node(node)		(node)
-#define node_to_first_cpu(node)  (__ffs(node_to_cpumask[node]))
+#define node_to_first_cpu(node)  (ffs(node_to_cpumask[node]))
 #define node_to_cpumask(node)    (node_to_cpumask[node])
 
 struct node { 
@@ -70,11 +70,14 @@
 	return nid; 
 } 
 
+extern int __node_distance(int a, int b);
 #define NODE_DATA(nid)		(&(node_data[nid]))
 
 #define node_start_pfn(nid)	(NODE_DATA(nid)->node_start_pfn)
+#define node_spanned_pages(nid)	(NODE_DATA(nid)->node_spanned_pages)
 #define node_end_pfn(nid)       (NODE_DATA(nid)->node_start_pfn + \
 				 NODE_DATA(nid)->node_spanned_pages)
+#define node_distance(a, b) (__node_distance(a, b))
 
 extern int valid_numa_range(u64 start, u64 end, int node);
 #else
diff -r ebd84be3420a -r dd0cdf8346df xen/include/xen/mm.h
--- a/xen/include/xen/mm.h	Tue Mar 30 18:31:39 2010 +0100
+++ b/xen/include/xen/mm.h	Tue Mar 30 18:03:27 2010 -0400
@@ -46,6 +46,7 @@
 void init_xenheap_pages(paddr_t ps, paddr_t pe);
 void *alloc_xenheap_pages(unsigned int order, unsigned int memflags);
 void free_xenheap_pages(void *v, unsigned int order);
+unsigned long avail_node_heap_pages(unsigned int node);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-04 19:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-04 19:30 [PATCH 01/11] [XEN] NUMA helper macros Dulloor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).