All of lore.kernel.org
 help / color / mirror / Atom feed
* Clockevents: one-shoot mode is never enabled if local apic timer is disabled
@ 2007-04-02  8:57 Maxim Levitsky
  2007-04-02  9:34 ` Thomas Gleixner
  0 siblings, 1 reply; 4+ messages in thread
From: Maxim Levitsky @ 2007-04-02  8:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner

Hi,

I finally figured out why one-shoot mode is enabled on my system only and only if local apic is enabled.

While reading through dynatic code it looks that all clockevent devices are put in periodic mode.
Then hrtimer_run_queues (which runs nevertheless CONFIG_HIGH_RES_TIMERS enabled or not) calls
indirectly (through tick_check_oneshot_change or hrtimer_switch_to_hres) to tick_switch_to_oneshot

tick_switch_to_oneshot checks that current cpu's clockevents device (and it is lapic even if not used) is not a dummy device
and it is , so it never calls tick_broadcast_switch_to_oneshot

To put it simply if broadcast is used, it works in periodic mode only. tick_broadcast_switch_to_oneshot is never called
(well it is called when broadcast is not used, but it is unnecessary, on my system for example it brings HPET on one-shoot mode,
and HPET is not used at all)

I tried to remove this check and this resulted in hard lock-up during boot with nolapic_timer
Maybe this was connected to the fact that this function is called on both cpus, and if one set a 
broadcasting device(HPET) to one shoot mode, second is still not aware of this.

Is it a bug or feature ?

	Best regards,
		Maxim Levitsky

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

* Re: Clockevents: one-shoot mode is never enabled if local apic timer is disabled
  2007-04-02  8:57 Clockevents: one-shoot mode is never enabled if local apic timer is disabled Maxim Levitsky
@ 2007-04-02  9:34 ` Thomas Gleixner
  2007-04-02 10:23   ` Maxim Levitsky
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Gleixner @ 2007-04-02  9:34 UTC (permalink / raw)
  To: Maxim Levitsky; +Cc: linux-kernel

Maxim,

can you please fix your mail client to do proper line wraps at 78
chars ?

On Mon, 2007-04-02 at 11:57 +0300, Maxim Levitsky wrote:
> Hi,
> 
> I finally figured out why one-shoot mode is enabled on my system only
> and only if local apic is enabled.

You could have asked me :)

> I tried to remove this check and this resulted in hard lock-up during
> boot with nolapic_timer
> Maybe this was connected to the fact that this function is called on
> both cpus, and if one set a 
> broadcasting device(HPET) to one shoot mode, second is still not aware
> of this.
> 
> Is it a bug or feature ?

One shot mode - used for NO_HZ and HIGH_RES - requires a working per cpu
timer.

When you disable the lapic timers, then we register the lapic timers
just as dummy devices to utilize the broadcast mechanism. Otherwise the
second CPU would be not working at all. I decided not to enable
nohz/highres when we have no usable per cpu devices available. 

So consider it a feature :)

	tglx



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

* Re: Clockevents: one-shoot mode is never enabled if local apic timer is disabled
  2007-04-02  9:34 ` Thomas Gleixner
@ 2007-04-02 10:23   ` Maxim Levitsky
  2007-04-02 10:29     ` Thomas Gleixner
  0 siblings, 1 reply; 4+ messages in thread
From: Maxim Levitsky @ 2007-04-02 10:23 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel

On Monday 02 April 2007 12:34:44 Thomas Gleixner wrote:
> Maxim,
> 
> can you please fix your mail client to do proper line wraps at 78
> chars ?
Sure, but this way it mangles patches :-)
> 
> On Mon, 2007-04-02 at 11:57 +0300, Maxim Levitsky wrote:
> > Hi,
> > 
> > I finally figured out why one-shoot mode is enabled on my system only
> > and only if local apic is enabled.
> 
> You could have asked me :)
Thanks
> 
> > I tried to remove this check and this resulted in hard lock-up during
> > boot with nolapic_timer
> > Maybe this was connected to the fact that this function is called on
> > both cpus, and if one set a 
> > broadcasting device(HPET) to one shoot mode, second is still not aware
> > of this.
> > 
> > Is it a bug or feature ?
> 
> One shot mode - used for NO_HZ and HIGH_RES - requires a working per cpu
> timer.
> 
> When you disable the lapic timers, then we register the lapic timers
> just as dummy devices to utilize the broadcast mechanism. Otherwise the
> second CPU would be not working at all. I decided not to enable
> nohz/highres when we have no usable per cpu devices available. 
> 
> So consider it a feature :)
> 
> 	tglx
> 
> 
> 
Hi, 

Fortunately on my system lapic timer works.
But then tick_broadcast_switch_to_oneshot is redundant, isn't it? 

Thanks for quick answer,
	Best regards,
		Maxim Levitsky


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

* Re: Clockevents: one-shoot mode is never enabled if local apic timer is disabled
  2007-04-02 10:23   ` Maxim Levitsky
@ 2007-04-02 10:29     ` Thomas Gleixner
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2007-04-02 10:29 UTC (permalink / raw)
  To: Maxim Levitsky; +Cc: linux-kernel

On Mon, 2007-04-02 at 13:23 +0300, Maxim Levitsky wrote:
> Hi, 
> 
> Fortunately on my system lapic timer works.
> But then tick_broadcast_switch_to_oneshot is redundant, isn't it? 

No, it's necessary for the systems where the local APIC timer stops in
C3(C2), as we do not know this at the point where we setup the local
APIC. 

	tglx




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

end of thread, other threads:[~2007-04-02 10:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-02  8:57 Clockevents: one-shoot mode is never enabled if local apic timer is disabled Maxim Levitsky
2007-04-02  9:34 ` Thomas Gleixner
2007-04-02 10:23   ` Maxim Levitsky
2007-04-02 10:29     ` Thomas Gleixner

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.