All of lore.kernel.org
 help / color / mirror / Atom feed
* 2 CPUs, but only one is used
@ 2006-12-17 13:41 Giuliano Pochini
  2006-12-19 23:35 ` Giuliano Pochini
  0 siblings, 1 reply; 9+ messages in thread
From: Giuliano Pochini @ 2006-12-17 13:41 UTC (permalink / raw)
  To: linuxppc-dev

I have a dual G4 MDD mac running linux 2.6.19. When I boot with maxcpus=1 and
then I issue "echo 1 >/sys/devices/system/cpu/cpu1/online" the second CPU is
put online without errors, but it stays idle+wait=100% and of course
user+system+nice=0%. It works fine without maxcpus=1. No problems with 2.6.18.

I saw that there are some cpu hotplug related changes in 2.6.19, but I have
no access to a non-ppc dual cpu box to check if the problem also affects
other architectures right now.


--
Giuliano.

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

* Re: 2 CPUs, but only one is used
  2006-12-17 13:41 2 CPUs, but only one is used Giuliano Pochini
@ 2006-12-19 23:35 ` Giuliano Pochini
  2006-12-20  4:14   ` Haren Myneni
  2006-12-20 14:16   ` Nathan Lynch
  0 siblings, 2 replies; 9+ messages in thread
From: Giuliano Pochini @ 2006-12-19 23:35 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: linuxppc-dev

On Sun, 17 Dec 2006 14:41:27 +0100
Giuliano Pochini <pochini@shiny.it> wrote:

> I have a dual G4 MDD mac running linux 2.6.19. When I boot with maxcpus=1 and
> then I issue "echo 1 >/sys/devices/system/cpu/cpu1/online" the second CPU is
> put online without errors, but it stays idle+wait=100% and of course
> user+system+nice=0%. It works fine without maxcpus=1. No problems with 2.6.18.
>
> I saw that there are some cpu hotplug related changes in 2.6.19, but I have
> no access to a non-ppc dual cpu box to check if the problem also affects
> other architectures right now.

I tried to reproduce the problem on an intel box, but I couldn't. /sys
contains only the cpu0 file if it boots with maxcpus=1.


--
Giuliano.

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

* Re: 2 CPUs, but only one is used
  2006-12-19 23:35 ` Giuliano Pochini
@ 2006-12-20  4:14   ` Haren Myneni
  2006-12-20 14:16   ` Nathan Lynch
  1 sibling, 0 replies; 9+ messages in thread
From: Haren Myneni @ 2006-12-20  4:14 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: linuxppc-dev

Giuliano Pochini wrote:

>On Sun, 17 Dec 2006 14:41:27 +0100
>Giuliano Pochini <pochini@shiny.it> wrote:
>
>  
>
>>I have a dual G4 MDD mac running linux 2.6.19. When I boot with maxcpus=1 and
>>then I issue "echo 1 >/sys/devices/system/cpu/cpu1/online" the second CPU is
>>put online without errors, but it stays idle+wait=100% and of course
>>user+system+nice=0%. It works fine without maxcpus=1. No problems with 2.6.18.
>>
>>I saw that there are some cpu hotplug related changes in 2.6.19, but I have
>>no access to a non-ppc dual cpu box to check if the problem also affects
>>other architectures right now.
>>    
>>
>
>I tried to reproduce the problem on an intel box, but I couldn't. /sys
>contains only the cpu0 file if it boots with maxcpus=1.
>  
>
On powerpc, when maxcpus=1 is passed, it does not reflect that change in 
cpu_possible_map. This possible bitmap is created based on device-tree. 
Where as on i386, it does. I.e, cpu_possible_map contains only one cpu. 
/sys entries will be created based on cpu_possible_map (I think). Hence, 
you noticed only cpu0 entry on Intel box. 

- Haren

>
>--
>Giuliano.
>_______________________________________________
>Linuxppc-dev mailing list
>Linuxppc-dev@ozlabs.org
>https://ozlabs.org/mailman/listinfo/linuxppc-dev
>  
>

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

* Re: 2 CPUs, but only one is used
  2006-12-19 23:35 ` Giuliano Pochini
  2006-12-20  4:14   ` Haren Myneni
@ 2006-12-20 14:16   ` Nathan Lynch
  2006-12-21 22:33     ` Giuliano Pochini
  2006-12-24 16:58     ` Giuliano Pochini
  1 sibling, 2 replies; 9+ messages in thread
From: Nathan Lynch @ 2006-12-20 14:16 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: linuxppc-dev

Giuliano Pochini wrote:
> On Sun, 17 Dec 2006 14:41:27 +0100
> Giuliano Pochini <pochini@shiny.it> wrote:
> 
> > I have a dual G4 MDD mac running linux 2.6.19. When I boot with maxcpus=1 and
> > then I issue "echo 1 >/sys/devices/system/cpu/cpu1/online" the second CPU is
> > put online without errors, but it stays idle+wait=100% and of course
> > user+system+nice=0%. It works fine without maxcpus=1. No problems with 2.6.18.
> >
> > I saw that there are some cpu hotplug related changes in 2.6.19, but I have
> > no access to a non-ppc dual cpu box to check if the problem also affects
> > other architectures right now.
> 
> I tried to reproduce the problem on an intel box, but I couldn't. /sys
> contains only the cpu0 file if it boots with maxcpus=1.

Can you try to git bisect to find the change which caused the
regression?

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

* Re: 2 CPUs, but only one is used
  2006-12-20 14:16   ` Nathan Lynch
@ 2006-12-21 22:33     ` Giuliano Pochini
  2006-12-24 16:58     ` Giuliano Pochini
  1 sibling, 0 replies; 9+ messages in thread
From: Giuliano Pochini @ 2006-12-21 22:33 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: linuxppc-dev

On Wed, 20 Dec 2006 08:16:55 -0600
Nathan Lynch <ntl@pobox.com> wrote:

> Giuliano Pochini wrote:
> > On Sun, 17 Dec 2006 14:41:27 +0100
> > Giuliano Pochini <pochini@shiny.it> wrote:
> > 
> > > I have a dual G4 MDD mac running linux 2.6.19. When I boot with maxcpus=1 and
> > > then I issue "echo 1 >/sys/devices/system/cpu/cpu1/online" the second CPU is
> > > put online without errors, but it stays idle+wait=100% and of course
> > > user+system+nice=0%. It works fine without maxcpus=1. No problems with 2.6.18.
> > >
> > > I saw that there are some cpu hotplug related changes in 2.6.19, but I have
> > > no access to a non-ppc dual cpu box to check if the problem also affects
> > > other architectures right now.
> > 
> > I tried to reproduce the problem on an intel box, but I couldn't. /sys
> > contains only the cpu0 file if it boots with maxcpus=1.
> 
> Can you try to git bisect to find the change which caused the
> regression?

*sigh* There are too much changes in the scheduler of 2.6.19 and in the ppc
code. I'm trying to find the problem in another way.


--
Giuliano.

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

* Re: 2 CPUs, but only one is used
  2006-12-20 14:16   ` Nathan Lynch
  2006-12-21 22:33     ` Giuliano Pochini
@ 2006-12-24 16:58     ` Giuliano Pochini
  2006-12-25  5:52       ` Nathan Lynch
  1 sibling, 1 reply; 9+ messages in thread
From: Giuliano Pochini @ 2006-12-24 16:58 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: linuxppc-dev

On Wed, 20 Dec 2006 08:16:55 -0600
Nathan Lynch <ntl@pobox.com> wrote:

> > > I have a dual G4 MDD mac running linux 2.6.19. When I boot with maxcpus=1 and
> > > then I issue "echo 1 >/sys/devices/system/cpu/cpu1/online" the second CPU is
> > > put online without errors, but it stays idle+wait=100% and of course
> > > user+system+nice=0%. It works fine without maxcpus=1. No problems with 2.6.18.
> > >
> > > I saw that there are some cpu hotplug related changes in 2.6.19, but I have
> > > no access to a non-ppc dual cpu box to check if the problem also affects
> > > other architectures right now.
> > 
> > I tried to reproduce the problem on an intel box, but I couldn't. /sys
> > contains only the cpu0 file if it boots with maxcpus=1.
> 
> Can you try to git bisect to find the change which caused the
> regression?
> 

I finally have some time to spend on this issue.

At the end of kernel/cpu.c::cpu_up() both cpus are set as present, possible
and online. The problem is that in kernel/sched.c::find_idlest_group()
p->cpus_allowed is always 1 (it should be 3). I tried to put a dump_stack()
or a printk(mask) in set_cpu_mask() but it crashes badly when mask is not 3,
ie. anything different from khelper or kthread, so I couldn't know what sets
the wrong cpumask.


--
Giuliano.

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

* Re: 2 CPUs, but only one is used
  2006-12-24 16:58     ` Giuliano Pochini
@ 2006-12-25  5:52       ` Nathan Lynch
  2006-12-25 10:53         ` Giuliano Pochini
  2006-12-29 16:51         ` Giuliano Pochini
  0 siblings, 2 replies; 9+ messages in thread
From: Nathan Lynch @ 2006-12-25  5:52 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: linuxppc-dev

Giuliano Pochini wrote:
> I have a dual G4 MDD mac running linux 2.6.19. When I boot with maxcpus=1 and
> then I issue "echo 1 >/sys/devices/system/cpu/cpu1/online" the second CPU is
> put online without errors, but it stays idle+wait=100% and of course
> user+system+nice=0%. It works fine without maxcpus=1. No problems with 2.6.18.

...

> At the end of kernel/cpu.c::cpu_up() both cpus are set as present, possible
> and online. The problem is that in kernel/sched.c::find_idlest_group()
> p->cpus_allowed is always 1 (it should be 3). I tried to put a dump_stack()
> or a printk(mask) in set_cpu_mask() but it crashes badly when mask is not 3,
> ie. anything different from khelper or kthread, so I couldn't know what sets
> the wrong cpumask.

Does this fix it?

diff --git a/kernel/sched.c b/kernel/sched.c
index b515e3c..3c8b1c5 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6875,7 +6875,7 @@ void __init sched_init_smp(void)
 
 	lock_cpu_hotplug();
 	arch_init_sched_domains(&cpu_online_map);
-	cpus_andnot(non_isolated_cpus, cpu_online_map, cpu_isolated_map);
+	cpus_andnot(non_isolated_cpus, cpu_possible_map, cpu_isolated_map);
 	if (cpus_empty(non_isolated_cpus))
 		cpu_set(smp_processor_id(), non_isolated_cpus);
 	unlock_cpu_hotplug();

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

* Re: 2 CPUs, but only one is used
  2006-12-25  5:52       ` Nathan Lynch
@ 2006-12-25 10:53         ` Giuliano Pochini
  2006-12-29 16:51         ` Giuliano Pochini
  1 sibling, 0 replies; 9+ messages in thread
From: Giuliano Pochini @ 2006-12-25 10:53 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: linuxppc-dev

On Sun, 24 Dec 2006 23:52:51 -0600
Nathan Lynch <ntl@pobox.com> wrote:

> > At the end of kernel/cpu.c::cpu_up() both cpus are set as present, possible
> > and online. The problem is that in kernel/sched.c::find_idlest_group()
> > p->cpus_allowed is always 1 (it should be 3). I tried to put a dump_stack()
> > or a printk(mask) in set_cpu_mask() but it crashes badly when mask is not 3,
> > ie. anything different from khelper or kthread, so I couldn't know what sets
> > the wrong cpumask.
> 
> Does this fix it?
> 
> diff --git a/kernel/sched.c b/kernel/sched.c
> index b515e3c..3c8b1c5 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -6875,7 +6875,7 @@ void __init sched_init_smp(void)
>  
>  	lock_cpu_hotplug();
>  	arch_init_sched_domains(&cpu_online_map);
> -	cpus_andnot(non_isolated_cpus, cpu_online_map, cpu_isolated_map);
> +	cpus_andnot(non_isolated_cpus, cpu_possible_map, cpu_isolated_map);
>  	if (cpus_empty(non_isolated_cpus))
>  		cpu_set(smp_processor_id(), non_isolated_cpus);
>  	unlock_cpu_hotplug();

Yes, it does. I also tested if tasks are migrated to/off cpu1 when I
enable/disable it and when I boot with or without maxcpus=1. It seems to
work correctly in all cases. Thank you.


--
Giuliano.

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

* Re: 2 CPUs, but only one is used
  2006-12-25  5:52       ` Nathan Lynch
  2006-12-25 10:53         ` Giuliano Pochini
@ 2006-12-29 16:51         ` Giuliano Pochini
  1 sibling, 0 replies; 9+ messages in thread
From: Giuliano Pochini @ 2006-12-29 16:51 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: linuxppc-dev

[I resend this msg because I didn't receive it back from the lppc ml]

On Sun, 24 Dec 2006 23:52:51 -0600
Nathan Lynch <ntl@pobox.com> wrote:

> > At the end of kernel/cpu.c::cpu_up() both cpus are set as present, possible
> > and online. The problem is that in kernel/sched.c::find_idlest_group()
> > p->cpus_allowed is always 1 (it should be 3). I tried to put a dump_stack()
> > or a printk(mask) in set_cpu_mask() but it crashes badly when mask is not 3,
> > ie. anything different from khelper or kthread, so I couldn't know what sets
> > the wrong cpumask.
> 
> Does this fix it?
> 
> diff --git a/kernel/sched.c b/kernel/sched.c
> index b515e3c..3c8b1c5 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -6875,7 +6875,7 @@ void __init sched_init_smp(void)
>  
>  	lock_cpu_hotplug();
>  	arch_init_sched_domains(&cpu_online_map);
> -	cpus_andnot(non_isolated_cpus, cpu_online_map, cpu_isolated_map);
> +	cpus_andnot(non_isolated_cpus, cpu_possible_map, cpu_isolated_map);
>  	if (cpus_empty(non_isolated_cpus))
>  		cpu_set(smp_processor_id(), non_isolated_cpus);
>  	unlock_cpu_hotplug();

Yes, it does. I also tested if tasks are migrated to/off cpu1 when I
enable/disable it and when I boot with or without maxcpus=1. It seems to
work correctly in all cases. Thank you.


--
Giuliano.

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

end of thread, other threads:[~2006-12-29 16:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-17 13:41 2 CPUs, but only one is used Giuliano Pochini
2006-12-19 23:35 ` Giuliano Pochini
2006-12-20  4:14   ` Haren Myneni
2006-12-20 14:16   ` Nathan Lynch
2006-12-21 22:33     ` Giuliano Pochini
2006-12-24 16:58     ` Giuliano Pochini
2006-12-25  5:52       ` Nathan Lynch
2006-12-25 10:53         ` Giuliano Pochini
2006-12-29 16:51         ` Giuliano Pochini

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.