Use nq version of systimer_init_periodic() when initialize interrupt
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 14 May 2009 10:44:51 +0000 (18:44 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 14 May 2009 11:00:25 +0000 (19:00 +0800)
livelock avoidance systimer.

The bug revealed itself as long time looping in the systimer_intr():
The one shot timer interrupt handler is prevented from running for
some time probably due to heavy interrupt load, and livelock avoidance
systimer is setup using high frequency (40000Hz by default).  If non-nq
version of systimer was used, then the main loop of systimer_intr()
would try to keep running and reloading this systimer until the
accumulated time caught up with the saved sys_cputimer count.

Debug information provided by Jordan Gordeev <jgordeev@dir.bg>, he also
helped to locate the systimer cause the long time looping.

Tested-by: Jordan Gordeev <jgordeev@dir.bg>
Approved-by: dillon@
sys/kern/kern_intr.c

index 07f03e7..bc7910c 100644 (file)
@@ -861,8 +861,8 @@ ithread_handler(void *arg)
                use_limit = 100;
            else if (use_limit > 500000)
                use_limit = 500000;
-           systimer_init_periodic(&ill_timer, ithread_livelock_wakeup,
-                                  (void *)intr, use_limit);
+           systimer_init_periodic_nq(&ill_timer, ithread_livelock_wakeup,
+                                     (void *)intr, use_limit);
            /* fall through */
        case ISTATE_LIVELOCKED:
            /*