public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: + i386-time-avoid-pit-smp-lockups.patch added to -mm tree
       [not found] <200610112126.k9BLQqKG002529@shell0.pdx.osdl.net>
@ 2006-10-19 13:44 ` Daniel Walker
  2006-10-19 13:47   ` Andi Kleen
  2006-10-19 18:27   ` john stultz
  0 siblings, 2 replies; 11+ messages in thread
From: Daniel Walker @ 2006-10-19 13:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: johnstul, ak, mingo, tglx

On Wed, 2006-10-11 at 14:26 -0700, akpm@osdl.org wrote:

> diff -puN arch/i386/kernel/i8253.c~i386-time-avoid-pit-smp-lockups arch/i386/kernel/i8253.c
> --- a/arch/i386/kernel/i8253.c~i386-time-avoid-pit-smp-lockups
> +++ a/arch/i386/kernel/i8253.c
> @@ -109,7 +109,7 @@ static struct clocksource clocksource_pi
>  
>  static int __init init_pit_clocksource(void)
>  {
> -	if (num_possible_cpus() > 4) /* PIT does not scale! */
> +	if (num_possible_cpus() > 1) /* PIT does not scale! */
>  		return 0;
>  

Can we ifdef some code here on CONFIG_SMP . It bugs me that there just
dead code laying around on smp systems.

Daniel


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

* Re: + i386-time-avoid-pit-smp-lockups.patch added to -mm tree
  2006-10-19 13:44 ` + i386-time-avoid-pit-smp-lockups.patch added to -mm tree Daniel Walker
@ 2006-10-19 13:47   ` Andi Kleen
  2006-10-19 13:57     ` Daniel Walker
  2006-10-19 18:27   ` john stultz
  1 sibling, 1 reply; 11+ messages in thread
From: Andi Kleen @ 2006-10-19 13:47 UTC (permalink / raw)
  To: Daniel Walker; +Cc: linux-kernel, johnstul, mingo, tglx

On Thursday 19 October 2006 15:44, Daniel Walker wrote:
> On Wed, 2006-10-11 at 14:26 -0700, akpm@osdl.org wrote:
> 
> > diff -puN arch/i386/kernel/i8253.c~i386-time-avoid-pit-smp-lockups arch/i386/kernel/i8253.c
> > --- a/arch/i386/kernel/i8253.c~i386-time-avoid-pit-smp-lockups
> > +++ a/arch/i386/kernel/i8253.c
> > @@ -109,7 +109,7 @@ static struct clocksource clocksource_pi
> >  
> >  static int __init init_pit_clocksource(void)
> >  {
> > -	if (num_possible_cpus() > 4) /* PIT does not scale! */
> > +	if (num_possible_cpus() > 1) /* PIT does not scale! */
> >  		return 0;
> >  
> 
> Can we ifdef some code here on CONFIG_SMP . It bugs me that there just
> dead code laying around on smp systems.

The optimizer should optimize it all out since num_possible_cpus() is a 0
constant on UP.

-Andi

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

* Re: + i386-time-avoid-pit-smp-lockups.patch added to -mm tree
  2006-10-19 13:47   ` Andi Kleen
@ 2006-10-19 13:57     ` Daniel Walker
  2006-10-19 14:05       ` Andi Kleen
  2006-10-19 14:22       ` Nick Piggin
  0 siblings, 2 replies; 11+ messages in thread
From: Daniel Walker @ 2006-10-19 13:57 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, johnstul, mingo, tglx

On Thu, 2006-10-19 at 15:47 +0200, Andi Kleen wrote:
> On Thursday 19 October 2006 15:44, Daniel Walker wrote:
> > On Wed, 2006-10-11 at 14:26 -0700, akpm@osdl.org wrote:
> > 
> > > diff -puN arch/i386/kernel/i8253.c~i386-time-avoid-pit-smp-lockups arch/i386/kernel/i8253.c
> > > --- a/arch/i386/kernel/i8253.c~i386-time-avoid-pit-smp-lockups
> > > +++ a/arch/i386/kernel/i8253.c
> > > @@ -109,7 +109,7 @@ static struct clocksource clocksource_pi
> > >  
> > >  static int __init init_pit_clocksource(void)
> > >  {
> > > -	if (num_possible_cpus() > 4) /* PIT does not scale! */
> > > +	if (num_possible_cpus() > 1) /* PIT does not scale! */
> > >  		return 0;
> > >  
> > 
> > Can we ifdef some code here on CONFIG_SMP . It bugs me that there just
> > dead code laying around on smp systems.
> 
> The optimizer should optimize it all out since num_possible_cpus() is a 0
> constant on UP.

You just mean the if statement above though? I was talking more about
the structure above this called "clocksource_pit" which isn't used on
SMP systems due to this code addition. AFAIK init_pit_clocksource()
could disappear along with the clocksource structure ..

Daniel 


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

* Re: + i386-time-avoid-pit-smp-lockups.patch added to -mm tree
  2006-10-19 13:57     ` Daniel Walker
@ 2006-10-19 14:05       ` Andi Kleen
  2006-10-19 14:50         ` Daniel Walker
  2006-10-19 14:22       ` Nick Piggin
  1 sibling, 1 reply; 11+ messages in thread
From: Andi Kleen @ 2006-10-19 14:05 UTC (permalink / raw)
  To: Daniel Walker; +Cc: linux-kernel, johnstul, mingo, tglx


> You just mean the if statement above though? I was talking more about
> the structure above this called "clocksource_pit" which isn't used on
> SMP systems due to this code addition. AFAIK init_pit_clocksource()
> could disappear along with the clocksource structure ..

It will end up as a int f() { return 0; }. Not very much overhead. 

-Andi

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

* Re: + i386-time-avoid-pit-smp-lockups.patch added to -mm tree
  2006-10-19 13:57     ` Daniel Walker
  2006-10-19 14:05       ` Andi Kleen
@ 2006-10-19 14:22       ` Nick Piggin
  2006-10-19 14:26         ` Andi Kleen
  1 sibling, 1 reply; 11+ messages in thread
From: Nick Piggin @ 2006-10-19 14:22 UTC (permalink / raw)
  To: Daniel Walker; +Cc: Andi Kleen, linux-kernel, johnstul, mingo, tglx

Daniel Walker wrote:
> On Thu, 2006-10-19 at 15:47 +0200, Andi Kleen wrote:
> 
>>On Thursday 19 October 2006 15:44, Daniel Walker wrote:
>>
>>>On Wed, 2006-10-11 at 14:26 -0700, akpm@osdl.org wrote:
>>>
>>>
>>>>diff -puN arch/i386/kernel/i8253.c~i386-time-avoid-pit-smp-lockups arch/i386/kernel/i8253.c
>>>>--- a/arch/i386/kernel/i8253.c~i386-time-avoid-pit-smp-lockups
>>>>+++ a/arch/i386/kernel/i8253.c
>>>>@@ -109,7 +109,7 @@ static struct clocksource clocksource_pi
>>>> 
>>>> static int __init init_pit_clocksource(void)
>>>> {
>>>>-	if (num_possible_cpus() > 4) /* PIT does not scale! */
>>>>+	if (num_possible_cpus() > 1) /* PIT does not scale! */
>>>> 		return 0;
>>>> 
>>>
>>>Can we ifdef some code here on CONFIG_SMP . It bugs me that there just
>>>dead code laying around on smp systems.
>>
>>The optimizer should optimize it all out since num_possible_cpus() is a 0
>>constant on UP.
> 
> 
> You just mean the if statement above though? I was talking more about
> the structure above this called "clocksource_pit" which isn't used on
> SMP systems due to this code addition. AFAIK init_pit_clocksource()
> could disappear along with the clocksource structure ..

An SMP kernel can boot on UP hardware, in which case I think
num_possible_cpus() will be 1, won't it?

-- 
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

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

* Re: + i386-time-avoid-pit-smp-lockups.patch added to -mm tree
  2006-10-19 14:22       ` Nick Piggin
@ 2006-10-19 14:26         ` Andi Kleen
  2006-10-19 14:48           ` Nick Piggin
  0 siblings, 1 reply; 11+ messages in thread
From: Andi Kleen @ 2006-10-19 14:26 UTC (permalink / raw)
  To: Nick Piggin; +Cc: Daniel Walker, linux-kernel, johnstul, mingo, tglx


> An SMP kernel can boot on UP hardware, in which case I think
> num_possible_cpus() will be 1, won't it?

0 was a typo, i meant 1 for UP of course. 0 would be nonsensical.

-Andi

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

* Re: + i386-time-avoid-pit-smp-lockups.patch added to -mm tree
  2006-10-19 14:26         ` Andi Kleen
@ 2006-10-19 14:48           ` Nick Piggin
  2006-10-19 14:50             ` Andi Kleen
  0 siblings, 1 reply; 11+ messages in thread
From: Nick Piggin @ 2006-10-19 14:48 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Daniel Walker, linux-kernel, johnstul, mingo, tglx

Andi Kleen wrote:
>>An SMP kernel can boot on UP hardware, in which case I think
>>num_possible_cpus() will be 1, won't it?
> 
> 
> 0 was a typo, i meant 1 for UP of course. 0 would be nonsensical.

Sure, I realised that. For a UP kernel, the test will compile away.

But Daniel seems to say there is dead code that could be compiled
out for SMP kernels. I just don't think that is possible because the
SMP kernel can boot a UP system where num_possible_cpus() is 1.

-- 
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

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

* Re: + i386-time-avoid-pit-smp-lockups.patch added to -mm tree
  2006-10-19 14:48           ` Nick Piggin
@ 2006-10-19 14:50             ` Andi Kleen
  2006-10-19 15:01               ` Daniel Walker
  0 siblings, 1 reply; 11+ messages in thread
From: Andi Kleen @ 2006-10-19 14:50 UTC (permalink / raw)
  To: Nick Piggin; +Cc: Daniel Walker, linux-kernel, johnstul, mingo, tglx

On Thursday 19 October 2006 16:48, Nick Piggin wrote:
> Andi Kleen wrote:
> >>An SMP kernel can boot on UP hardware, in which case I think
> >>num_possible_cpus() will be 1, won't it?
> > 
> > 
> > 0 was a typo, i meant 1 for UP of course. 0 would be nonsensical.
> 
> Sure, I realised that. For a UP kernel, the test will compile away.
> 
> But Daniel seems to say there is dead code that could be compiled
> out for SMP kernels. I just don't think that is possible because the
> SMP kernel can boot a UP system where num_possible_cpus() is 1.

I thought he meant !CONFIG_SMP kernels.

-Andi

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

* Re: + i386-time-avoid-pit-smp-lockups.patch added to -mm tree
  2006-10-19 14:05       ` Andi Kleen
@ 2006-10-19 14:50         ` Daniel Walker
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Walker @ 2006-10-19 14:50 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, johnstul, mingo, tglx

On Thu, 2006-10-19 at 16:05 +0200, Andi Kleen wrote:
> > You just mean the if statement above though? I was talking more about
> > the structure above this called "clocksource_pit" which isn't used on
> > SMP systems due to this code addition. AFAIK init_pit_clocksource()
> > could disappear along with the clocksource structure ..
> 
> It will end up as a int f() { return 0; }. Not very much overhead. 
> 
> -Andi

Here's what I found .. 

-rwxr-xr-x  1 dwalker engr 48252535 Oct 19 07:47 vmlinux
-rwxr-xr-x  1 dwalker engr 48249958 Oct 19 07:47 vmlinux.ifdef

So we're talking about ~2.5k of code including the pit_read and
clocksource structure.

Daniel


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

* Re: + i386-time-avoid-pit-smp-lockups.patch added to -mm tree
  2006-10-19 14:50             ` Andi Kleen
@ 2006-10-19 15:01               ` Daniel Walker
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Walker @ 2006-10-19 15:01 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Nick Piggin, linux-kernel, johnstul, mingo, tglx

On Thu, 2006-10-19 at 16:50 +0200, Andi Kleen wrote:
> On Thursday 19 October 2006 16:48, Nick Piggin wrote:
> > Andi Kleen wrote:
> > >>An SMP kernel can boot on UP hardware, in which case I think
> > >>num_possible_cpus() will be 1, won't it?
> > > 
> > > 
> > > 0 was a typo, i meant 1 for UP of course. 0 would be nonsensical.
> > 
> > Sure, I realised that. For a UP kernel, the test will compile away.
> > 
> > But Daniel seems to say there is dead code that could be compiled
> > out for SMP kernels. I just don't think that is possible because the
> > SMP kernel can boot a UP system where num_possible_cpus() is 1.
> 
> I thought he meant !CONFIG_SMP kernels.

definitely CONFIG_SMP=y . The code block I quoted would disable the PIT
clocksource w/ more than one cpu. So the pit clocksource is just dead
weight on SMP systems. However, like Nick was saying it's possible to
boot CONFIG_SMP on a UP system, but removing the pit in that situation
may not hurt anything.

Daniel 


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

* Re: + i386-time-avoid-pit-smp-lockups.patch added to -mm tree
  2006-10-19 13:44 ` + i386-time-avoid-pit-smp-lockups.patch added to -mm tree Daniel Walker
  2006-10-19 13:47   ` Andi Kleen
@ 2006-10-19 18:27   ` john stultz
  1 sibling, 0 replies; 11+ messages in thread
From: john stultz @ 2006-10-19 18:27 UTC (permalink / raw)
  To: Daniel Walker; +Cc: linux-kernel, ak, mingo, tglx

On Thu, 2006-10-19 at 06:44 -0700, Daniel Walker wrote:
> On Wed, 2006-10-11 at 14:26 -0700, akpm@osdl.org wrote:
> 
> > diff -puN arch/i386/kernel/i8253.c~i386-time-avoid-pit-smp-lockups arch/i386/kernel/i8253.c
> > --- a/arch/i386/kernel/i8253.c~i386-time-avoid-pit-smp-lockups
> > +++ a/arch/i386/kernel/i8253.c
> > @@ -109,7 +109,7 @@ static struct clocksource clocksource_pi
> >  
> >  static int __init init_pit_clocksource(void)
> >  {
> > -	if (num_possible_cpus() > 4) /* PIT does not scale! */
> > +	if (num_possible_cpus() > 1) /* PIT does not scale! */
> >  		return 0;
> >  
> 
> Can we ifdef some code here on CONFIG_SMP . It bugs me that there just
> dead code laying around on smp systems.

I still want the pit to be available on SMP kernels that boot on UP
systems, so I don't think an ifdef will do it. Maybe it would be
possible to do some smp alternatives-like code removal on SMP systems?

thanks
-john



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

end of thread, other threads:[~2006-10-19 18:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200610112126.k9BLQqKG002529@shell0.pdx.osdl.net>
2006-10-19 13:44 ` + i386-time-avoid-pit-smp-lockups.patch added to -mm tree Daniel Walker
2006-10-19 13:47   ` Andi Kleen
2006-10-19 13:57     ` Daniel Walker
2006-10-19 14:05       ` Andi Kleen
2006-10-19 14:50         ` Daniel Walker
2006-10-19 14:22       ` Nick Piggin
2006-10-19 14:26         ` Andi Kleen
2006-10-19 14:48           ` Nick Piggin
2006-10-19 14:50             ` Andi Kleen
2006-10-19 15:01               ` Daniel Walker
2006-10-19 18:27   ` john stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox