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

Re: [Xen-devel] [PATCH v2 1/4] pci: Do not ignore device's PXM information



On 01/07/2015 10:07 AM, Jan Beulich wrote:
On 07.01.15 at 15:47, <andrew.cooper3@xxxxxxxxxx> wrote:
On 07/01/15 14:42, Boris Ostrovsky wrote:
I kept this field as an int to be able to store NUMA_NO_NODE which I
thought to be (int)-1.

But now I see that NUMA_NO_NODE is, in fact, 0xff but is promoted to
(int)-1 by pxm_to_node(). Given that there is a number of tests for
NUMA_NO_NODE and not for (int)-1, should we then make pxm_to_node()
return u8 as well?
I noticed this as well, and found it quite counter intuitive.

I would suggest fixing NUMA_NO_NODE to -1 and removing some of the
type-punning.
I have to admit that I see no value in wasting 4 bytes for something
that for the foreseeable future won't exceed 1 byte.

The downside of going to u8 is that we'd be limiting number of nodes to 254, which is somewhat awkward. OTOH we already do this by testing nodeID against 0xff in various places.

-boris

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.