Skip to contentSkip to conversation

hres_timers_resume must block interrupts

PATCH In review Joe Korty 2 participants 3 messages Aug 13, 2007 – Aug 14, 2007

lore
Share & tools
lore

Joe Korty

author
#0 lore raw

PATCH 1/1 hres_timers_resume must block interrupts

Retrigger_next_event() must be called with interrupts disabled.

All internal (to hrtimer.c) uses of retrigger_next_event() are correct. But the version exported to other files, hres_timers_resume(), does not do the IRQ blocking, nor does the (single) external caller of it.

Rather than require that users of hres_timers_resume() do the IRQ blocking, this patch makes the blocking part of the hres_timers_resume() functionality.

(Also remove the meaningless WARN_ON_ONCE() call in hres_timers_resume)

kernel/hrtimer.c +3 -2
Index: 2.6.23-rc3/kernel/hrtimer.c
===================================================================
@@ -463,10 +463,11 @@
  */
 void hres_timers_resume(void)
 {
-	WARN_ON_ONCE(num_online_cpus() > 1);
+	unsigned long flags;
 
-	/* Retrigger the CPU local events: */
+	local_irq_save(flags);
 	retrigger_next_event(NULL);
+	local_irq_restore(flags);
 }
 
 /*
#1 lore raw
Quoted 8 lines · Joe Korty

Retrigger_next_event() must be called with interrupts disabled.

All internal (to hrtimer.c) uses of retrigger_next_event() are correct. But the version exported to other files, hres_timers_resume(), does not do the IRQ blocking, nor does the (single) external caller of it.

Rather than require that users of hres_timers_resume() do the IRQ blocking, this patch makes the blocking part of the hres_timers_resume() functionality.

Ack.

Quoted 1 line

(Also remove the meaningless WARN_ON_ONCE() call in hres_timers_resume)

It's not that meaningless. It catched a resume order problem some time ago.

tglx

Quoted 21 lines

Index: 2.6.23-rc3/kernel/hrtimer.c
===================================================================

kernel/hrtimer.c +3 -2
@@ -463,10 +463,11 @@
  */
 void hres_timers_resume(void)
 {
-	WARN_ON_ONCE(num_online_cpus() > 1);
+	unsigned long flags;
 
-	/* Retrigger the CPU local events: */
+	local_irq_save(flags);
 	retrigger_next_event(NULL);
+	local_irq_restore(flags);
 }
 
 /*
#2 lore raw
Quoted 11 lines · Thomas Gleixner
Quoted 8 lines · Joe Korty

Retrigger_next_event() must be called with interrupts disabled.

All internal (to hrtimer.c) uses of retrigger_next_event() are correct. But the version exported to other files, hres_timers_resume(), does not do the IRQ blocking, nor does the (single) external caller of it.

Rather than require that users of hres_timers_resume() do the IRQ blocking, this patch makes the blocking part of the hres_timers_resume() functionality.

Ack.

-ENOTENOUGHCOFFEE.

The resume functions are called with interrupts disabled. Nothing to fix here.

tglx