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 v2 1/3] x86/numa: Allow arbitrary value of PXM in PXM<->node mapping
Date: Wed, 25 Feb 2015 08:11:45 -0500 [thread overview]
Message-ID: <54EDCA11.80104@oracle.com> (raw)
In-Reply-To: <54EDA52202000078000636D4@mail.emea.novell.com>
On 02/25/2015 04:34 AM, Jan Beulich wrote:
>>>> On 24.02.15 at 20:11, <boris.ostrovsky@oracle.com> wrote:
>> --- a/xen/arch/x86/srat.c
>> +++ b/xen/arch/x86/srat.c
>> @@ -27,35 +27,79 @@ 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 };
>>
>> +struct pxm2node {
>> + unsigned pxm;
>> + int node;
>> +};
>> +static struct pxm2node __read_mostly p2n[MAX_NUMNODES] =
> Can this please continue to be named pxm2node[]? "p2..." is too
> commonly used for representing a phys-to-something conversion.
>
>> + { [0 ... MAX_NUMNODES - 1] = {.node = NUMA_NO_NODE} };
>> +
>> +static int node_to_pxm(int n);
> I don't see why you need to reinstate this forward declaration.
It is used in acpi_numa_memory_affinity_init() which is defined above
node_to_pxm().
I can just move node_to_pxm() definition higher and drop forward
declaration.
>
>> int pxm_to_node(int pxm)
>> {
>> - if ((unsigned)pxm >= 256)
>> - return -1;
>> - /* Extend 0xff to (int)-1 */
>> - return (signed char)pxm2node[pxm];
>> + unsigned i;
>> +
>> + if ( (pxm < MAX_NUMNODES) && node_found(pxm, pxm) )
>> + return p2n[pxm].node;
> With this the function parameter's type can't remain to be signed.
Right. I was hoping to defer all type changes to the next patch but this
(and setup_node() below) will need to change here.
-boris
> Also please don't change coding style here, unless you do so for
> the whole file (in a separate patch). The one change I wouldn't
> mind is switching node_to_pxm() from 8-space to tab indentation.
>
>> __devinit int setup_node(int pxm)
>> {
>> - unsigned node = pxm2node[pxm];
>> - if (node == 0xff) {
>> - if (nodes_weight(nodes_found) >= MAX_NUMNODES)
>> - return -1;
>> - node = first_unset_node(nodes_found);
>> - node_set(node, nodes_found);
>> - pxm2node[pxm] = node;
>> - }
>> - return pxm2node[pxm];
>> + int node;
>> + unsigned idx;
>> + static bool_t warned;
>> +
>> + if ( pxm < MAX_NUMNODES )
>> + {
>> + if ( node_found(pxm, pxm) )
>> + return p2n[pxm].node;
next prev parent reply other threads:[~2015-02-25 13:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-24 19:11 [PATCH v2 0/3] Updates to pxm2node mapping and nodeID sizing Boris Ostrovsky
2015-02-24 19:11 ` [PATCH v2 1/3] x86/numa: Allow arbitrary value of PXM in PXM<->node mapping Boris Ostrovsky
2015-02-24 20:58 ` Boris Ostrovsky
2015-02-25 9:34 ` Jan Beulich
2015-02-25 13:11 ` Boris Ostrovsky [this message]
2015-02-25 13:25 ` Jan Beulich
2015-02-25 10:34 ` Jan Beulich
2015-02-24 19:11 ` [PATCH v2 2/3] x86/numa: Adjust datatypes for node and pxm Boris Ostrovsky
2015-02-25 9:44 ` Jan Beulich
2015-02-24 19:11 ` [PATCH v2 3/3] mm: MEMF_node should handle changes in nodeid_t size Boris Ostrovsky
2015-02-25 9:47 ` Jan Beulich
2015-02-25 10:35 ` Jan Beulich
2015-02-25 13:30 ` Boris Ostrovsky
2015-02-25 14:16 ` 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=54EDCA11.80104@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.