xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dulloor <dulloor@gmail.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH 01/11] [XEN] NUMA helper macros
Date: Sun, 4 Apr 2010 15:30:09 -0400	[thread overview]
Message-ID: <y2l940bcfd21004041230p137d4d50oa12b4dcaf2772505@mail.gmail.com> (raw)

[-- 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

                 reply	other threads:[~2010-04-04 19:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=y2l940bcfd21004041230p137d4d50oa12b4dcaf2772505@mail.gmail.com \
    --to=dulloor@gmail.com \
    --cc=xen-devel@lists.xensource.com \
    /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;
as well as URLs for NNTP newsgroup(s).