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

Re: [Xen-devel] [PATCH v5 04/22] xen/arm: Set nr_cpu_ids to available number of cpus



Hi Vijay,

On 27/07/15 12:11, vijay.kilari@xxxxxxxxx wrote:
> From: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx>
> 
> nr_cpu_ids for arm platforms is set to 128 irrespective of

NIT: s/128/NR_CPUS/

> number of cpus supported by platform.
> 
> Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx>
> ---
>  xen/arch/arm/setup.c      |    1 +
>  xen/arch/arm/smpboot.c    |   11 +++++++++++
>  xen/include/asm-arm/smp.h |    1 +
>  3 files changed, 13 insertions(+)
> 
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index a46c583..6ca787b 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -772,6 +772,7 @@ void __init start_xen(unsigned long boot_phys_offset,
>  
>      smp_init_cpus();
>      cpus = smp_get_max_cpus();
> +    set_nr_cpu_ids(cpus);
>  
>      init_xen_time();
>  
> diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
> index a96cda2..233ad95 100644
> --- a/xen/arch/arm/smpboot.c
> +++ b/xen/arch/arm/smpboot.c
> @@ -243,6 +243,17 @@ void __init smp_init_cpus(void)
>      }
>  }
>  
> +void __init set_nr_cpu_ids(unsigned int max_cpus)
> +{
> +    if ( !max_cpus )
> +        max_cpus = 1;
> +   else if ( max_cpus > NR_CPUS )
> +        max_cpus = NR_CPUS;

Those check are not useful. smp_get_max_cpus will always return a number
between 1 and NR_CPUS.

You could even open code the function in setup.c. I.e

cpus = smp_get_max_cpus();
printk(XENLOG_INFO "SMP: Allowing %u CPUs\n", cpus);
nr_cpus_ids = cpus;


> +
> +    printk(XENLOG_INFO "SMP: Allowing %u CPUs\n", max_cpus);
> +    nr_cpu_ids = max_cpus;
> +}
> +

Regards,

-- 
Julien Grall

_______________________________________________
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®.