WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [RFC][PATCH] domheap optimization for NUMA

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [RFC][PATCH] domheap optimization for NUMA
From: Andre Przywara <andre.przywara@xxxxxxx>
Date: Thu, 03 Apr 2008 15:57:08 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 03 Apr 2008 07:00:48 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C41A76D1.1EC09%keir.fraser@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C41A76D1.1EC09%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.10 (X11/20070409)
Keir Fraser wrote:
NUMA_NO_NODE probably needs to be pulled out of asm-x86/numa.h and made the
official arch-neutral way to specify 'don't care' for numa nodes.
Is this really needed? I provided memflags=0 is all don't care cases,
this should work and is more compatible. But beware that this silently
assumes in page_alloc.c#alloc_domheap_pages that NUMA_NO_NODE is 0xFF,
otherwise this trick will not work.

Yes it is needed if your patch is to work across all architectures, not just
x86! Your current patch is broken in this respect because you quite
unnecessarily define domain_to_node() and vcpu_to_node() in asm/numa.h
rather than xen/numa.h.
Right you are. I fixed this below. While playing around with the headers, I realized that numa.h is not needed at all in common/page_alloc.c and common/sysctl.c. Can you confirm this? Or is this needed for the other architectures?

Signed-off-by: Andre Przywara <andre.przywara@xxxxxxx>


Please address architectural portability and re-send the patch. Apart from
that I think it's just about ready to go in.
I am just trying to install an IA64 cross compiler, but it seems this will take some time...

Regards,
Andre.


--
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 277-84917
----to satisfy European Law for business letters:
AMD Saxony Limited Liability Company & Co. KG,
Wilschdorfer Landstr. 101, 01109 Dresden, Germany
Register Court Dresden: HRA 4896, General Partner authorized
to represent: AMD Saxony LLC (Wilmington, Delaware, US)
General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy
diff -r bb6eac21369e xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Thu Apr 03 12:24:57 2008 +0200
+++ b/xen/arch/x86/domain.c     Thu Apr 03 15:34:52 2008 +0200
@@ -46,7 +46,7 @@
 #include <asm/debugreg.h>
 #include <asm/msr.h>
 #include <asm/nmi.h>
-#include <asm/numa.h>
+#include <xen/numa.h>
 #include <xen/iommu.h>
 #ifdef CONFIG_COMPAT
 #include <compat/vcpu.h>
diff -r bb6eac21369e xen/arch/x86/hvm/stdvga.c
--- a/xen/arch/x86/hvm/stdvga.c Thu Apr 03 12:24:57 2008 +0200
+++ b/xen/arch/x86/hvm/stdvga.c Thu Apr 03 15:34:52 2008 +0200
@@ -32,7 +32,7 @@
 #include <xen/sched.h>
 #include <xen/domain_page.h>
 #include <asm/hvm/support.h>
-#include <asm/numa.h>
+#include <xen/numa.h>
 
 #define PAT(x) (x)
 static const uint32_t mask16[16] = {
diff -r bb6eac21369e xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c Thu Apr 03 12:24:57 2008 +0200
+++ b/xen/arch/x86/hvm/vlapic.c Thu Apr 03 15:34:52 2008 +0200
@@ -33,7 +33,7 @@
 #include <xen/sched.h>
 #include <asm/current.h>
 #include <asm/hvm/vmx/vmx.h>
-#include <asm/numa.h>
+#include <xen/numa.h>
 #include <public/hvm/ioreq.h>
 #include <public/hvm/params.h>
 
diff -r bb6eac21369e xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c Thu Apr 03 12:24:57 2008 +0200
+++ b/xen/arch/x86/mm/hap/hap.c Thu Apr 03 15:34:52 2008 +0200
@@ -38,7 +38,7 @@
 #include <asm/hap.h>
 #include <asm/paging.h>
 #include <asm/domain.h>
-#include <asm/numa.h>
+#include <xen/numa.h>
 
 #include "private.h"
 
diff -r bb6eac21369e xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c  Thu Apr 03 12:24:57 2008 +0200
+++ b/xen/arch/x86/mm/paging.c  Thu Apr 03 15:34:52 2008 +0200
@@ -26,7 +26,7 @@
 #include <asm/p2m.h>
 #include <asm/hap.h>
 #include <asm/guest_access.h>
-#include <asm/numa.h>
+#include <xen/numa.h>
 #include <xsm/xsm.h>
 
 #define hap_enabled(d) (is_hvm_domain(d) && (d)->arch.hvm_domain.hap_enabled)
diff -r bb6eac21369e xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c   Thu Apr 03 12:24:57 2008 +0200
+++ b/xen/arch/x86/mm/shadow/common.c   Thu Apr 03 15:34:52 2008 +0200
@@ -36,7 +36,7 @@
 #include <asm/current.h>
 #include <asm/flushtlb.h>
 #include <asm/shadow.h>
-#include <asm/numa.h>
+#include <xen/numa.h>
 #include "private.h"
 
 
diff -r bb6eac21369e xen/common/memory.c
--- a/xen/common/memory.c       Thu Apr 03 12:24:57 2008 +0200
+++ b/xen/common/memory.c       Thu Apr 03 15:34:52 2008 +0200
@@ -21,7 +21,7 @@
 #include <xen/errno.h>
 #include <asm/current.h>
 #include <asm/hardirq.h>
-#include <asm/numa.h>
+#include <xen/numa.h>
 #include <public/memory.h>
 #include <xsm/xsm.h>
 
diff -r bb6eac21369e xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Thu Apr 03 12:24:57 2008 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c       Thu Apr 03 15:34:52 2008 +0200
@@ -24,7 +24,7 @@
 #include <xen/xmalloc.h>
 #include <xen/domain_page.h>
 #include <xen/iommu.h>
-#include <asm/numa.h>
+#include <xen/numa.h>
 #include "iommu.h"
 #include "dmar.h"
 #include "../pci-direct.h"
diff -r bb6eac21369e xen/include/asm-x86/numa.h
--- a/xen/include/asm-x86/numa.h        Thu Apr 03 12:24:57 2008 +0200
+++ b/xen/include/asm-x86/numa.h        Thu Apr 03 15:34:52 2008 +0200
@@ -4,16 +4,11 @@
 #include <xen/cpumask.h>
 
 #define NODES_SHIFT 6
-#define NUMA_NO_NODE 0xff
 
 extern unsigned char cpu_to_node[];
 extern cpumask_t     node_to_cpumask[];
 
 #define cpu_to_node(cpu)               (cpu_to_node[cpu])
-#define domain_to_node(domain)  ((domain!=NULL && domain->vcpu[0]!=NULL)?\
-                                  cpu_to_node[domain->vcpu[0]->processor]:\
-                                  NUMA_NO_NODE)
-#define vcpu_to_node(vcpu)             (cpu_to_node[v->processor])
 #define parent_node(node)              (node)
 #define node_to_first_cpu(node)  (__ffs(node_to_cpumask[node]))
 #define node_to_cpumask(node)    (node_to_cpumask[node])
diff -r bb6eac21369e xen/include/xen/numa.h
--- a/xen/include/xen/numa.h    Thu Apr 03 12:24:57 2008 +0200
+++ b/xen/include/xen/numa.h    Thu Apr 03 15:34:52 2008 +0200
@@ -8,6 +8,15 @@
 #define NODES_SHIFT     0
 #endif
 
+#define NUMA_NO_NODE    0xFF
+
 #define MAX_NUMNODES    (1 << NODES_SHIFT)
 
+#define domain_to_node(domain)  (((domain)!=NULL && (domain)->vcpu[0]!=NULL)?\
+                                cpu_to_node[(domain)->vcpu[0]->processor]:\
+                                NUMA_NO_NODE)
+
+#define vcpu_to_node(v)         (cpu_to_node[(v)->processor])
+
+
 #endif /* _XEN_NUMA_H */
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel