All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ryan Harper <ryanh@us.ibm.com>
To: Tristan Gingold <Tristan.Gingold@bull.net>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH 0/6] xen,xend,tools: Add NUMA support to Xen
Date: Wed, 2 Aug 2006 17:29:47 -0500	[thread overview]
Message-ID: <20060802222947.GR1694@us.ibm.com> (raw)
In-Reply-To: <200608020759.47453.Tristan.Gingold@bull.net>

* Tristan Gingold <Tristan.Gingold@bull.net> [2006-08-02 00:56]:
> Le Mardi 01 Août 2006 17:40, Ryan Harper a écrit :
> > * Tristan Gingold <Tristan.Gingold@bull.net> [2006-08-01 02:43]:
> > > Le Lundi 31 Juillet 2006 21:09, Ryan Harper a écrit :
> > > > I've respun the NUMA patches against 10874 and I'm re-submitting them
> > > > with the optimizations mentioned [1]previously on the list.  There was
> > > > a request to see the overhead on non-numa/single-node machines.  I've
> > > > re-run those benchmarks (ballooning up from small mem to multi-gig) as
> > > > well as timing the initially domain increase_reservation time to gauge
> > > > the overhead when allocating from the heap.
> > >
> > > Hi,
> > >
> > > I am trying to use your patch on ia64.
> >
> > Thanks for testing these out on ia64.
> >
> > > In asm-x86/topology.h, you wrote:
> > >
> > > extern unsigned int cpu_to_node[];
> > > extern cpumask_t     node_to_cpumask[];
> > >
> > > #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_cpumask(node)    (node_to_cpumask[node])
> > >
> > > I think cpu_to_node and node_to_cpumask must be either a variable or a
> > > macro, but not both! (ia64 defines cpu_to_node as a macro).
> >
> > I'm not sure about this, but the definition of both the variable and
> > macro come from Linux, for example in
> [...]
> > AFAIK, this isn't an issue.
> Except you are using both versions mainly the macro but at least the variable 
> once in page_alloc.c:
> 
> /* Allocate 2^@order contiguous pages. */
> struct page_info *alloc_heap_pages(unsigned int zone, unsigned int cpu,
>                                    unsigned int order)
> {
>     unsigned int i,j, node = cpu_to_node[cpu], num_nodes = num_online_nodes();
>     unsigned int request = (1UL << order);
> 
> This was a problem for ia64.
> Furthermore you define the variable in xen/numa.h:
> extern unsigned int cpu_to_node[];
> #include <xen/cpumask.h>
> extern cpumask_t node_to_cpumask[];
> 
> Which one is the API ?

If ia64 is already using macros, then we should use the macros.  I
should be able to remove those externs from numa.h and include the
asm/topology.h (not in xen/numa.h since that is the same thing)
in the .c files , like page_alloc.c, and use the macros instead.

Something like this (compiled on x86_64):

diff -r 083e69a85080 xen/arch/x86/dom0_ops.c
--- a/xen/arch/x86/dom0_ops.c	Mon Jul 31 10:53:59 2006 -0500
+++ b/xen/arch/x86/dom0_ops.c	Wed Aug 02 10:36:28 2006 -0500
@@ -26,6 +26,7 @@
 #include <asm/processor.h>
 #include <public/sched_ctl.h>
 #include <asm/numa.h>
+#include <asm/topology.h>
 
 #include <asm/mtrr.h>
 #include "cpu/mtrr/mtrr.h"
@@ -220,7 +221,7 @@ long arch_do_dom0_op(struct dom0_op *op,
         memset(node_to_cpu_64, 0, sizeof(node_to_cpu_64));
         for ( i=0; i<pi->nr_nodes; i++) {
             for ( j=0; j<num_online_cpus(); j++)
-                if ( cpu_isset(j, node_to_cpumask[i]) )
+                if ( cpu_isset(j, node_to_cpumask(i)) )
                     node_to_cpu_64[i] |= (u64)1 << j;
 
             if ( copy_to_guest_offset(op->u.physinfo.node_to_cpu, 
diff -r 083e69a85080 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Mon Jul 31 10:53:59 2006 -0500
+++ b/xen/common/page_alloc.c	Wed Aug 02 10:32:27 2006 -0500
@@ -35,6 +35,7 @@
 #include <xen/domain_page.h>
 #include <xen/keyhandler.h>
 #include <asm/numa.h>
+#include <asm/topology.h>
 #include <asm/page.h>
 
 /*
@@ -317,7 +318,7 @@ struct page_info *alloc_heap_pages(unsig
 struct page_info *alloc_heap_pages(unsigned int zone, unsigned int cpu,
                                    unsigned int order)
 {
-    unsigned int i,j, node = cpu_to_node[cpu], num_nodes = num_online_nodes();
+    unsigned int i,j, node = cpu_to_node(cpu), num_nodes = num_online_nodes();
     unsigned int request = (1UL << order);
     struct page_info *pg;
 
diff -r 083e69a85080 xen/include/xen/numa.h
--- a/xen/include/xen/numa.h	Mon Jul 31 10:53:59 2006 -0500
+++ b/xen/include/xen/numa.h	Wed Aug 02 17:24:39 2006 -0500
@@ -23,8 +23,4 @@
 /* needed for drivers/acpi/numa.c */
 #define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
 
-extern unsigned int cpu_to_node[];
-#include <xen/cpumask.h>
-extern cpumask_t node_to_cpumask[];
-
 #endif /* _XEN_NUMA_H */


-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253   T/L: 678-9253
ryanh@us.ibm.com

  reply	other threads:[~2006-08-02 22:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-31 19:09 [PATCH 0/6] xen,xend,tools: Add NUMA support to Xen Ryan Harper
2006-08-01  7:46 ` Tristan Gingold
2006-08-01 15:40   ` Ryan Harper
2006-08-02  5:59     ` Tristan Gingold
2006-08-02 22:29       ` Ryan Harper [this message]
2006-08-03  6:05         ` Tristan Gingold
2006-08-05  0:33         ` [PATCH 0/6] xen, xend, tools: Add NUMA support to Xen Issues on the ES7000 Subrahmanian, Raj
2006-08-07 13:23           ` Ryan Harper
2006-08-07 19:29             ` Subrahmanian, Raj
2006-08-01  9:29 ` [PATCH 0/6] xen,xend,tools: Add NUMA support to Xen Tristan Gingold
2006-08-02  6:14 ` Tristan Gingold

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=20060802222947.GR1694@us.ibm.com \
    --to=ryanh@us.ibm.com \
    --cc=Tristan.Gingold@bull.net \
    --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.