All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@amd.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [RFC][PATCH] domheap optimization for NUMA
Date: Thu, 03 Apr 2008 15:57:08 +0200	[thread overview]
Message-ID: <47F4E234.30601@amd.com> (raw)
In-Reply-To: <C41A76D1.1EC09%keir.fraser@eu.citrix.com>

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

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@amd.com>


> 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

[-- Attachment #2: alloc_domheap_node_xen_numah.patch --]
[-- Type: text/plain, Size: 4410 bytes --]

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 */

[-- 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:[~2008-04-03 13:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-31 10:40 [RFC][PATCH] domheap optimization for NUMA Zhai, Edwin
2008-03-31 10:47 ` Keir Fraser
2008-04-02 13:06   ` Zhai, Edwin
2008-04-02 13:27     ` Keir Fraser
2008-04-02 22:49       ` Andre Przywara
2008-04-02 23:21         ` Keir Fraser
2008-04-03 10:39           ` Andre Przywara
2008-04-03 10:58             ` Keir Fraser
2008-04-03 13:57               ` Andre Przywara [this message]
2008-04-03 14:49                 ` Keir Fraser
2008-04-04  8:37                 ` Isaku Yamahata
2008-04-04 13:22                 ` Aron Griffis
2008-04-07 13:25           ` Zhai, Edwin
2008-04-07 13:51             ` Keir Fraser

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=47F4E234.30601@amd.com \
    --to=andre.przywara@amd.com \
    --cc=keir.fraser@eu.citrix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.