From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: Re: [RFC][PATCH] domheap optimization for NUMA Date: Thu, 03 Apr 2008 15:57:08 +0200 Message-ID: <47F4E234.30601@amd.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020005010008030108070602" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------020005010008030108070602 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 > 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 --------------020005010008030108070602 Content-Type: text/plain; name="alloc_domheap_node_xen_numah.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="alloc_domheap_node_xen_numah.patch" 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 #include #include -#include +#include #include #ifdef CONFIG_COMPAT #include 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 #include #include -#include +#include #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 #include #include -#include +#include #include #include 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 #include #include -#include +#include #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 #include #include -#include +#include #include #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 #include #include -#include +#include #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 #include #include -#include +#include #include #include 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 #include #include -#include +#include #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 #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 */ --------------020005010008030108070602 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------020005010008030108070602--