All of lore.kernel.org
 help / color / mirror / Atom feed
* nr_cpus cmdline parameter not working
@ 2011-09-28 15:35 Mark Salter
  2011-10-01 16:23 ` Russell King - ARM Linux
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Salter @ 2011-09-28 15:35 UTC (permalink / raw)
  To: linux-arm-kernel

I noticed that nr_cpus=1 doesn't appear to have any effect on a
pandaboard (and probably others from the looks of things). This
changes seems to be needed, but I'm not really sure if this is
the right thing or not.

diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
index ce65e93..a1198ac 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -117,6 +117,9 @@ void __init smp_init_cpus(void)
 		ncores = NR_CPUS;
 	}
 
+	if (ncores > nr_cpu_ids)
+		ncores = nr_cpu_ids;
+
 	for (i = 0; i < ncores; i++)
 		set_cpu_possible(i, true);

--Mark

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* nr_cpus cmdline parameter not working
  2011-09-28 15:35 nr_cpus cmdline parameter not working Mark Salter
@ 2011-10-01 16:23 ` Russell King - ARM Linux
  2011-10-03 13:47   ` Mark Salter
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2011-10-01 16:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Sep 28, 2011 at 11:35:16AM -0400, Mark Salter wrote:
> I noticed that nr_cpus=1 doesn't appear to have any effect on a
> pandaboard (and probably others from the looks of things). This
> changes seems to be needed, but I'm not really sure if this is
> the right thing or not.
> 
> diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
> index ce65e93..a1198ac 100644
> --- a/arch/arm/mach-omap2/omap-smp.c
> +++ b/arch/arm/mach-omap2/omap-smp.c
> @@ -117,6 +117,9 @@ void __init smp_init_cpus(void)
>  		ncores = NR_CPUS;
>  	}
>  
> +	if (ncores > nr_cpu_ids)
> +		ncores = nr_cpu_ids;
> +

This potentially affects all SMP platforms, so the patch needs to be
bigger than this.

Also, I think the test above should be modified to use nr_cpu_ids
rather than NR_CPUS, to be inline with what x86 does:

        /* nr_cpu_ids could be reduced via nr_cpus= */
        if (possible > nr_cpu_ids) {
                printk(KERN_WARNING
                        "%d Processors exceeds NR_CPUS limit of %d\n",
                        possible, nr_cpu_ids);
                possible = nr_cpu_ids;
        }

(This is essentially the same check that we're doing.)

Could you have a look at this and cook up another patch covering the
other SMP platforms please?

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* nr_cpus cmdline parameter not working
  2011-10-01 16:23 ` Russell King - ARM Linux
@ 2011-10-03 13:47   ` Mark Salter
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Salter @ 2011-10-03 13:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, 2011-10-01 at 17:23 +0100, Russell King - ARM Linux wrote:
> On Wed, Sep 28, 2011 at 11:35:16AM -0400, Mark Salter wrote:
> > I noticed that nr_cpus=1 doesn't appear to have any effect on a
> > pandaboard (and probably others from the looks of things). This
> > changes seems to be needed, but I'm not really sure if this is
> > the right thing or not.
> > 
> > diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
> > index ce65e93..a1198ac 100644
> > --- a/arch/arm/mach-omap2/omap-smp.c
> > +++ b/arch/arm/mach-omap2/omap-smp.c
> > @@ -117,6 +117,9 @@ void __init smp_init_cpus(void)
> >  		ncores = NR_CPUS;
> >  	}
> >  
> > +	if (ncores > nr_cpu_ids)
> > +		ncores = nr_cpu_ids;
> > +
> 
> This potentially affects all SMP platforms, so the patch needs to be
> bigger than this.
> 
> Also, I think the test above should be modified to use nr_cpu_ids
> rather than NR_CPUS, to be inline with what x86 does:
> 
>         /* nr_cpu_ids could be reduced via nr_cpus= */
>         if (possible > nr_cpu_ids) {
>                 printk(KERN_WARNING
>                         "%d Processors exceeds NR_CPUS limit of %d\n",
>                         possible, nr_cpu_ids);
>                 possible = nr_cpu_ids;
>         }
> 
> (This is essentially the same check that we're doing.)
> 
> Could you have a look at this and cook up another patch covering the
> other SMP platforms please?

Ok, I'll do that.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-03 13:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-28 15:35 nr_cpus cmdline parameter not working Mark Salter
2011-10-01 16:23 ` Russell King - ARM Linux
2011-10-03 13:47   ` Mark Salter

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.