Skip to contentSkip to conversation

highres: warn on softirq handling an unsafe callback

PATCH In review Andres Salomon 2 participants 2 messages Mar 5, 2007 High-resolution timers, timer wheel, clockevents

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 highres: warn on softirq handling an unsafe callback

run_hrtimer_queue is called from a softirq context, and should never run a callback that is classified as HRTIMER_CB_IRQSAFE_NO_SOFTIRQ. A bug in unrelated code had managed to trigger that bug, so let's add an explicit warning to this function.

include/linux/hrtimer.h +0 -0
kernel/hrtimer.c +1 -0
index 476cb0c..167c296 100644
@@ -1130,6 +1130,7 @@ static inline void run_hrtimer_queue(struct hrtimer_cpu_base *cpu_base,
 		if (base->softirq_time.tv64 <= timer->expires.tv64)
 			break;
 
+		WARN_ON_ONCE(timer->cb_mode == HRTIMER_CB_IRQSAFE_NO_SOFTIRQ);
 		timer_stats_account_hrtimer(timer);
 
 		fn = timer->function;
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Andres Salomon

run_hrtimer_queue is called from a softirq context, and should never run a callback that is classified as HRTIMER_CB_IRQSAFE_NO_SOFTIRQ. A bug in unrelated code had managed to trigger that bug, so let's add an explicit warning to this function.

thanks.

[suggestion for future submissions: please include the patch body as text, not as a MIME attachment - this makes it easier for upstream maintainers to process such mails.]

Ingo