All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: kevin.tian@intel.com, keir@xen.org, ian.campbell@citrix.com,
	Andrew.Cooper3@citrix.com, dario.faggioli@citrix.com,
	tim@xen.org, xen-devel@lists.xen.org,
	stefano.stabellini@citrix.com, yang.z.zhang@intel.com
Subject: Re: [PATCH] x86/numa: Adjust datatypes for node and pxm
Date: Mon, 23 Feb 2015 09:53:57 -0500	[thread overview]
Message-ID: <54EB3F05.5070706@oracle.com> (raw)
In-Reply-To: <54EB4B8502000078000628B6@mail.emea.novell.com>


On 02/23/2015 09:47 AM, Jan Beulich wrote:
>>>> On 23.02.15 at 15:42, <boris.ostrovsky@oracle.com> wrote:
>> On 02/23/2015 04:57 AM, Jan Beulich wrote:
>>>>>> On 21.02.15 at 19:14, <boris.ostrovsky@oracle.com> wrote:
>>>> --- a/xen/arch/x86/srat.c
>>>> +++ b/xen/arch/x86/srat.c
>>>> @@ -21,44 +21,55 @@
>>>>    #include <asm/e820.h>
>>>>    #include <asm/page.h>
>>>>    
>>>> +#define MAX_PXM   255
>>> Perhaps better (MAX_NUMNODES - 1) than a literal number? Or
>>> even do away with it altogether, use MAX_NUMNODES - 1 in the
>>> array definition and ARRAY_SIZE() elsewhere?
>> I am not sure we can do this: PXMs are not guaranteed to be zero-based.
>>
>> And, in fact, the way we map PXMs to nodes is not quite right because of
>> this --- it just so happens that PXMs are usually under 255 (and
>> zero-based) and we can use them as index to 255-sized array. IIRC the
>> spec defines them as 32-bit values.
> Ah, yes, you're right. We may need to allocate the array dynamically
> as soon as we run into a system with large PXMs.
>

But then we may end up with a huge and very sparse array. Maybe a hash 
with each element as a linked list? We will hit the first element in 
pretty much all cases so it should be reasonably fast.

-boris

  reply	other threads:[~2015-02-23 14:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-21 18:14 [PATCH] x86/numa: Adjust datatypes for node and pxm Boris Ostrovsky
2015-02-23  9:57 ` Jan Beulich
2015-02-23 14:42   ` Boris Ostrovsky
2015-02-23 14:47     ` Jan Beulich
2015-02-23 14:53       ` Boris Ostrovsky [this message]
2015-02-23 15:14         ` Jan Beulich

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=54EB3F05.5070706@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=dario.faggioli@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    --cc=yang.z.zhang@intel.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.