Port-xen archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH v3 1/7] x86/numa: Make use of NUMA_NO_NODE consistent



On Tue, 2015-02-10 at 10:41 +0000, Andrew Cooper wrote:
> On 09/02/15 20:04, Boris Ostrovsky wrote:

> > diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
> > index 29fc724..4dfa1c3 100644
> > --- a/xen/arch/x86/srat.c
> > +++ b/xen/arch/x86/srat.c
> > @@ -21,13 +21,16 @@
> >  #include <asm/e820.h>
> >  #include <asm/page.h>
> >  
> > +#define MAX_PXM   255
> > +
> >  static struct acpi_table_slit *__read_mostly acpi_slit;
> >  
> >  static nodemask_t memory_nodes_parsed __initdata;
> >  static nodemask_t processor_nodes_parsed __initdata;
> >  static nodemask_t nodes_found __initdata;
> >  static struct node nodes[MAX_NUMNODES] __initdata;
> > -static u8 __read_mostly pxm2node[256] = { [0 ... 255] = NUMA_NO_NODE };
> > +static u8 __read_mostly pxm2node[MAX_PXM + 1] =
> > +    { [0 ... MAX_PXM] = NUMA_NO_NODE };
> >  
> >  
> >  static int num_node_memblks;
> > @@ -37,21 +40,29 @@ static int memblk_nodeid[NR_NODE_MEMBLKS];
> >  
> >  static int node_to_pxm(int n);
> >  
> > -int pxm_to_node(int pxm)
> > +u8 pxm_to_node(int pxm)
> 
> You can make these parameters unsigned and do away with the unsigned
> casting.  pxm appears to be unsigned in all the relevant call chains.
> 
+1

> > diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h
> > index 5959860..2a43827 100644
> > --- a/xen/include/asm-x86/numa.h
> > +++ b/xen/include/asm-x86/numa.h
> > @@ -21,7 +21,7 @@ struct node {
> >  
> >  extern int compute_hash_shift(struct node *nodes, int numnodes,
> >  			      int *nodeids);
> > -extern int pxm_to_node(int nid);
> > +extern u8 pxm_to_node(int nid);
> 
> The parameter should presumably be named pxm?
> 
+1  :-)

Regards,
Dario

Attachment: signature.asc
Description: This is a digitally signed message part



Home | Main Index | Thread Index | Old Index