From: "Jan Beulich" Subject: Re: [PATCH v2 1/4] pci: Do not ignore device's PXM information Date: Wed, 07 Jan 2015 15:46:46 +0000 Message-ID: <54AD62F60200007800052692@mail.emea.novell.com> References: <1420510737-22813-1-git-send-email-boris.ostrovsky@oracle.com> <1420510737-22813-2-git-send-email-boris.ostrovsky@oracle.com> <54AD052F0200007800052277@mail.emea.novell.com> <54AD45D6.6040601@oracle.com> <54AD471A.3090203@citrix.com> <54AD59D702000078000525BB@mail.emea.novell.com> <54AD51F0.7080903@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <54AD51F0.7080903@oracle.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Boris Ostrovsky Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, Andrew Cooper , dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, ufimtseva@gmail.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 07.01.15 at 16:34, wrote: > On 01/07/2015 10:07 AM, Jan Beulich wrote: >>>>> On 07.01.15 at 15:47, 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. With NODES_SHIFT being 6 and hence MAX_NUMNODES being 0x40, we can't reach 254 right now anyway. Jan