|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v6 02/23] xen: move NUMA_NO_NODE to public memory.h as XEN_NUMA_NO_NODE
On 26/02/15 15:55, Wei Liu wrote:
> Update NUMA_NO_NODE in Xen code to use the new macro.
>
> No functional change introduced.
>
> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Cc: Jan Beulich <JBeulich@xxxxxxxx>
>
> diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
> index 595f953..0d8c85f 100644
> --- a/xen/include/public/memory.h
> +++ b/xen/include/public/memory.h
> @@ -29,6 +29,8 @@
>
> #include "xen.h"
>
> +#define XEN_NUMA_NO_NODE 0xFF
> +
I would suggest moving the define to beside the XENMEMF_{,get_}node()
definitions, which is where it is used.
(Also, someone in the future is going to have a fun time extending Xen's
node ids beyond 255, seeing as this is baked into our ABI)
> /*
> * Increase or decrease the specified domain's memory reservation. Returns
> the
> * number of extents successfully allocated or freed.
> diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h
> index ac4b391..60daaa5 100644
> --- a/xen/include/xen/numa.h
> +++ b/xen/include/xen/numa.h
> @@ -1,20 +1,19 @@
> #ifndef _XEN_NUMA_H
> #define _XEN_NUMA_H
>
> +#include <public/memory.h>
> #include <asm/numa.h>
>
> #ifndef NODES_SHIFT
> #define NODES_SHIFT 0
> #endif
>
> -#define NUMA_NO_NODE 0xFF
> -
An option would be to
#define NUMA_NO_NODE XEN_NUMA_NO_NODE
Which would avoid changing any other code. We have a precedent for this
with the errno public header.
I would welcome the opinions of other maintainers.
~Andrew
> #define MAX_NUMNODES (1 << NODES_SHIFT)
>
> #define vcpu_to_node(v) (cpu_to_node((v)->processor))
>
> #define domain_to_node(d) \
> (((d)->vcpu != NULL && (d)->vcpu[0] != NULL) \
> - ? vcpu_to_node((d)->vcpu[0]) : NUMA_NO_NODE)
> + ? vcpu_to_node((d)->vcpu[0]) : XEN_NUMA_NO_NODE)
>
> #endif /* _XEN_NUMA_H */
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |