pkt_sched: Convert qdisc_watchdog to tasklet_hrtimer
authorDavid S. Miller <davem@davemloft.net>
Fri, 21 Aug 2009 23:33:34 +0000 (16:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 23 Aug 2009 01:09:17 +0000 (18:09 -0700)
None of this stuff should execute in hw IRQ context, therefore
use a tasklet_hrtimer so that it runs in softirq context.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
include/net/pkt_sched.h
net/sched/sch_api.c

index 82a3191375f5c380f49ce42b13d9364822293959..7eafb8d54470bbcf7633dc3c5780fc0d173ff673 100644 (file)
@@ -61,8 +61,8 @@ psched_tdiff_bounded(psched_time_t tv1, psched_time_t tv2, psched_time_t bound)
 }
 
 struct qdisc_watchdog {
-       struct hrtimer  timer;
-       struct Qdisc    *qdisc;
+       struct tasklet_hrtimer  timer;
+       struct Qdisc            *qdisc;
 };
 
 extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc);
index 24d17ce9c294f384f1a638b7888540455479f3aa..e1c2bf7e9ba44ea70399d719a89b183141f66915 100644 (file)
@@ -468,8 +468,8 @@ static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer)
 
 void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc)
 {
-       hrtimer_init(&wd->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
-       wd->timer.function = qdisc_watchdog;
+       tasklet_hrtimer_init(&wd->timer, qdisc_watchdog,
+                            CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
        wd->qdisc = qdisc;
 }
 EXPORT_SYMBOL(qdisc_watchdog_init);
@@ -485,13 +485,13 @@ void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, psched_time_t expires)
        wd->qdisc->flags |= TCQ_F_THROTTLED;
        time = ktime_set(0, 0);
        time = ktime_add_ns(time, PSCHED_TICKS2NS(expires));
-       hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS);
+       tasklet_hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS);
 }
 EXPORT_SYMBOL(qdisc_watchdog_schedule);
 
 void qdisc_watchdog_cancel(struct qdisc_watchdog *wd)
 {
-       hrtimer_cancel(&wd->timer);
+       tasklet_hrtimer_cancel(&wd->timer);
        wd->qdisc->flags &= ~TCQ_F_THROTTLED;
 }
 EXPORT_SYMBOL(qdisc_watchdog_cancel);