diff mbox

[RFC,v1,01/21] ARM: NUMA: Add existing ARM numa code under CONFIG_NUMA

Message ID 1486655834-9708-2-git-send-email-vijay.kilari@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vijay Kilari Feb. 9, 2017, 3:56 p.m. UTC
From: Vijaya Kumar K <Vijaya.Kumar@cavium.com>

Right not CONFIG_NUMA is not enabled for ARM and
existing code in asm-arm/numa.h is for !COFIG_NUMA.
Hence put this code under #ifndef CONFIG_NUMA.

This help to make this changes work when CONFIG_NUMA
is not enabled.

Also define NODES_SHIFT macro for ARM.

Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@cavium.com>
---
 xen/include/asm-arm/numa.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Julien Grall Feb. 20, 2017, 11:39 a.m. UTC | #1
Hello Vijay,

On 09/02/17 15:56, vijay.kilari@gmail.com wrote:
> From: Vijaya Kumar K <Vijaya.Kumar@cavium.com>
>
> Right not CONFIG_NUMA is not enabled for ARM and

s/not/now/

> existing code in asm-arm/numa.h is for !COFIG_NUMA.

s/COFIG_NUMA/CONFIG_NUMA/

> Hence put this code under #ifndef CONFIG_NUMA.
>
> This help to make this changes work when CONFIG_NUMA
> is not enabled.
>

Is there any reason to let the choice to the user to enable/disable NUMA?

> Also define NODES_SHIFT macro for ARM.
>
> Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@cavium.com>
> ---
>  xen/include/asm-arm/numa.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
> index a2c1a34..a60c7eb 100644
> --- a/xen/include/asm-arm/numa.h
> +++ b/xen/include/asm-arm/numa.h
> @@ -3,6 +3,9 @@
>
>  typedef u8 nodeid_t;
>
> +#define NODES_SHIFT 2

Why 2?

> +
> +#ifndef CONFIG_NUMA
>  /* Fake one node for now. See also node_online_map. */
>  #define cpu_to_node(cpu) 0
>  #define node_to_cpumask(node)   (cpu_online_map)
> @@ -16,6 +19,7 @@ static inline __attribute__((pure)) nodeid_t phys_to_nid(paddr_t addr)
>  #define node_spanned_pages(nid) (total_pages)
>  #define node_start_pfn(nid) (pdx_to_pfn(frametable_base_pdx))
>  #define __node_distance(a, b) (20)
> +#endif /* CONFIG_NUMA */
>
>  static inline unsigned int arch_get_dma_bitsize(void)
>  {
>

Cheers,
Vijay Kilari Feb. 22, 2017, 9:18 a.m. UTC | #2
On Mon, Feb 20, 2017 at 5:09 PM, Julien Grall <julien.grall@arm.com> wrote:
> Hello Vijay,
>
> On 09/02/17 15:56, vijay.kilari@gmail.com wrote:
>>
>> From: Vijaya Kumar K <Vijaya.Kumar@cavium.com>
>>
>> Right not CONFIG_NUMA is not enabled for ARM and
>
>
> s/not/now/
>
>> existing code in asm-arm/numa.h is for !COFIG_NUMA.
>
>
> s/COFIG_NUMA/CONFIG_NUMA/
>
>> Hence put this code under #ifndef CONFIG_NUMA.
>>
>> This help to make this changes work when CONFIG_NUMA
>> is not enabled.
>>
>
> Is there any reason to let the choice to the user to enable/disable NUMA?

I see no reason. Atleast in case of x86, I see it is enabled always.

>
>> Also define NODES_SHIFT macro for ARM.
>>
>> Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@cavium.com>
>> ---
>>  xen/include/asm-arm/numa.h | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
>> index a2c1a34..a60c7eb 100644
>> --- a/xen/include/asm-arm/numa.h
>> +++ b/xen/include/asm-arm/numa.h
>> @@ -3,6 +3,9 @@
>>
>>  typedef u8 nodeid_t;
>>
>> +#define NODES_SHIFT 2
>
>
> Why 2?

Just to support upto 4 node system.

>
>> +
>> +#ifndef CONFIG_NUMA
>>  /* Fake one node for now. See also node_online_map. */
>>  #define cpu_to_node(cpu) 0
>>  #define node_to_cpumask(node)   (cpu_online_map)
>> @@ -16,6 +19,7 @@ static inline __attribute__((pure)) nodeid_t
>> phys_to_nid(paddr_t addr)
>>  #define node_spanned_pages(nid) (total_pages)
>>  #define node_start_pfn(nid) (pdx_to_pfn(frametable_base_pdx))
>>  #define __node_distance(a, b) (20)
>> +#endif /* CONFIG_NUMA */
>>
>>  static inline unsigned int arch_get_dma_bitsize(void)
>>  {
>>
>
> Cheers,
>
> --
> Julien Grall
Julien Grall Feb. 22, 2017, 10:49 a.m. UTC | #3
Hello Vijay,

On 22/02/17 09:18, Vijay Kilari wrote:
> On Mon, Feb 20, 2017 at 5:09 PM, Julien Grall <julien.grall@arm.com> wrote:
>> Hello Vijay,
>>
>> On 09/02/17 15:56, vijay.kilari@gmail.com wrote:
>>>
>>> From: Vijaya Kumar K <Vijaya.Kumar@cavium.com>
>>>
>>> Right not CONFIG_NUMA is not enabled for ARM and
>>
>>
>> s/not/now/
>>
>>> existing code in asm-arm/numa.h is for !COFIG_NUMA.
>>
>>
>> s/COFIG_NUMA/CONFIG_NUMA/
>>
>>> Hence put this code under #ifndef CONFIG_NUMA.
>>>
>>> This help to make this changes work when CONFIG_NUMA
>>> is not enabled.
>>>
>>
>> Is there any reason to let the choice to the user to enable/disable NUMA?
>
> I see no reason. Atleast in case of x86, I see it is enabled always.

Stefano, do you have any opinion on whether a user should be able to 
enable/disable NUMA?

>>
>>> Also define NODES_SHIFT macro for ARM.
>>>
>>> Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@cavium.com>
>>> ---
>>>  xen/include/asm-arm/numa.h | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
>>> index a2c1a34..a60c7eb 100644
>>> --- a/xen/include/asm-arm/numa.h
>>> +++ b/xen/include/asm-arm/numa.h
>>> @@ -3,6 +3,9 @@
>>>
>>>  typedef u8 nodeid_t;
>>>
>>> +#define NODES_SHIFT 2
>>
>>
>> Why 2?
>
> Just to support upto 4 node system.

Why only 4 node supported? Also, this should be specified in the commit 
message.

Regards,
diff mbox

Patch

diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
index a2c1a34..a60c7eb 100644
--- a/xen/include/asm-arm/numa.h
+++ b/xen/include/asm-arm/numa.h
@@ -3,6 +3,9 @@ 
 
 typedef u8 nodeid_t;
 
+#define NODES_SHIFT 2
+
+#ifndef CONFIG_NUMA
 /* Fake one node for now. See also node_online_map. */
 #define cpu_to_node(cpu) 0
 #define node_to_cpumask(node)   (cpu_online_map)
@@ -16,6 +19,7 @@  static inline __attribute__((pure)) nodeid_t phys_to_nid(paddr_t addr)
 #define node_spanned_pages(nid) (total_pages)
 #define node_start_pfn(nid) (pdx_to_pfn(frametable_base_pdx))
 #define __node_distance(a, b) (20)
+#endif /* CONFIG_NUMA */
 
 static inline unsigned int arch_get_dma_bitsize(void)
 {