aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/pkt_sched.h4
-rw-r--r--net/sched/sch_api.c10
-rw-r--r--net/sched/sch_cbq.c25
3 files changed, 18 insertions, 21 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 7eafb8d54470..82a3191375f5 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -61,8 +61,8 @@ psched_tdiff_bounded(psched_time_t tv1, psched_time_t tv2, psched_time_t bound)
61} 61}
62 62
63struct qdisc_watchdog { 63struct qdisc_watchdog {
64 struct tasklet_hrtimer timer; 64 struct hrtimer timer;
65 struct Qdisc *qdisc; 65 struct Qdisc *qdisc;
66}; 66};
67 67
68extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc); 68extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc);
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 92e6f3a52c13..24d17ce9c294 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -458,7 +458,7 @@ EXPORT_SYMBOL(qdisc_warn_nonwc);
458static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer) 458static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer)
459{ 459{
460 struct qdisc_watchdog *wd = container_of(timer, struct qdisc_watchdog, 460 struct qdisc_watchdog *wd = container_of(timer, struct qdisc_watchdog,
461 timer.timer); 461 timer);
462 462
463 wd->qdisc->flags &= ~TCQ_F_THROTTLED; 463 wd->qdisc->flags &= ~TCQ_F_THROTTLED;
464 __netif_schedule(qdisc_root(wd->qdisc)); 464 __netif_schedule(qdisc_root(wd->qdisc));
@@ -468,8 +468,8 @@ static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer)
468 468
469void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc) 469void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc)
470{ 470{
471 tasklet_hrtimer_init(&wd->timer, qdisc_watchdog, 471 hrtimer_init(&wd->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
472 CLOCK_MONOTONIC, HRTIMER_MODE_ABS); 472 wd->timer.function = qdisc_watchdog;
473 wd->qdisc = qdisc; 473 wd->qdisc = qdisc;
474} 474}
475EXPORT_SYMBOL(qdisc_watchdog_init); 475EXPORT_SYMBOL(qdisc_watchdog_init);
@@ -485,13 +485,13 @@ void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, psched_time_t expires)
485 wd->qdisc->flags |= TCQ_F_THROTTLED; 485 wd->qdisc->flags |= TCQ_F_THROTTLED;
486 time = ktime_set(0, 0); 486 time = ktime_set(0, 0);
487 time = ktime_add_ns(time, PSCHED_TICKS2NS(expires)); 487 time = ktime_add_ns(time, PSCHED_TICKS2NS(expires));
488 tasklet_hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS); 488 hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS);
489} 489}
490EXPORT_SYMBOL(qdisc_watchdog_schedule); 490EXPORT_SYMBOL(qdisc_watchdog_schedule);
491 491
492void qdisc_watchdog_cancel(struct qdisc_watchdog *wd) 492void qdisc_watchdog_cancel(struct qdisc_watchdog *wd)
493{ 493{
494 tasklet_hrtimer_cancel(&wd->timer); 494 hrtimer_cancel(&wd->timer);
495 wd->qdisc->flags &= ~TCQ_F_THROTTLED; 495 wd->qdisc->flags &= ~TCQ_F_THROTTLED;
496} 496}
497EXPORT_SYMBOL(qdisc_watchdog_cancel); 497EXPORT_SYMBOL(qdisc_watchdog_cancel);
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 149b0405c5ec..d5798e17a832 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -163,7 +163,7 @@ struct cbq_sched_data
163 psched_time_t now_rt; /* Cached real time */ 163 psched_time_t now_rt; /* Cached real time */
164 unsigned pmask; 164 unsigned pmask;
165 165
166 struct tasklet_hrtimer delay_timer; 166 struct hrtimer delay_timer;
167 struct qdisc_watchdog watchdog; /* Watchdog timer, 167 struct qdisc_watchdog watchdog; /* Watchdog timer,
168 started when CBQ has 168 started when CBQ has
169 backlog, but cannot 169 backlog, but cannot
@@ -503,8 +503,6 @@ static void cbq_ovl_delay(struct cbq_class *cl)
503 cl->undertime = q->now + delay; 503 cl->undertime = q->now + delay;
504 504
505 if (delay > 0) { 505 if (delay > 0) {
506 struct hrtimer *ht;
507
508 sched += delay + cl->penalty; 506 sched += delay + cl->penalty;
509 cl->penalized = sched; 507 cl->penalized = sched;
510 cl->cpriority = TC_CBQ_MAXPRIO; 508 cl->cpriority = TC_CBQ_MAXPRIO;
@@ -512,12 +510,12 @@ static void cbq_ovl_delay(struct cbq_class *cl)
512 510
513 expires = ktime_set(0, 0); 511 expires = ktime_set(0, 0);
514 expires = ktime_add_ns(expires, PSCHED_TICKS2NS(sched)); 512 expires = ktime_add_ns(expires, PSCHED_TICKS2NS(sched));
515 ht = &q->delay_timer.timer; 513 if (hrtimer_try_to_cancel(&q->delay_timer) &&
516 if (hrtimer_try_to_cancel(ht) && 514 ktime_to_ns(ktime_sub(
517 ktime_to_ns(ktime_sub(hrtimer_get_expires(ht), 515 hrtimer_get_expires(&q->delay_timer),
518 expires)) > 0) 516 expires)) > 0)
519 hrtimer_set_expires(ht, expires); 517 hrtimer_set_expires(&q->delay_timer, expires);
520 hrtimer_restart(ht); 518 hrtimer_restart(&q->delay_timer);
521 cl->delayed = 1; 519 cl->delayed = 1;
522 cl->xstats.overactions++; 520 cl->xstats.overactions++;
523 return; 521 return;
@@ -593,7 +591,7 @@ static psched_tdiff_t cbq_undelay_prio(struct cbq_sched_data *q, int prio,
593static enum hrtimer_restart cbq_undelay(struct hrtimer *timer) 591static enum hrtimer_restart cbq_undelay(struct hrtimer *timer)
594{ 592{
595 struct cbq_sched_data *q = container_of(timer, struct cbq_sched_data, 593 struct cbq_sched_data *q = container_of(timer, struct cbq_sched_data,
596 delay_timer.timer); 594 delay_timer);
597 struct Qdisc *sch = q->watchdog.qdisc; 595 struct Qdisc *sch = q->watchdog.qdisc;
598 psched_time_t now; 596 psched_time_t now;
599 psched_tdiff_t delay = 0; 597 psched_tdiff_t delay = 0;
@@ -623,7 +621,7 @@ static enum hrtimer_restart cbq_undelay(struct hrtimer *timer)
623 621
624 time = ktime_set(0, 0); 622 time = ktime_set(0, 0);
625 time = ktime_add_ns(time, PSCHED_TICKS2NS(now + delay)); 623 time = ktime_add_ns(time, PSCHED_TICKS2NS(now + delay));
626 tasklet_hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS); 624 hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS);
627 } 625 }
628 626
629 sch->flags &= ~TCQ_F_THROTTLED; 627 sch->flags &= ~TCQ_F_THROTTLED;
@@ -1216,7 +1214,7 @@ cbq_reset(struct Qdisc* sch)
1216 q->tx_class = NULL; 1214 q->tx_class = NULL;
1217 q->tx_borrowed = NULL; 1215 q->tx_borrowed = NULL;
1218 qdisc_watchdog_cancel(&q->watchdog); 1216 qdisc_watchdog_cancel(&q->watchdog);
1219 tasklet_hrtimer_cancel(&q->delay_timer); 1217 hrtimer_cancel(&q->delay_timer);
1220 q->toplevel = TC_CBQ_MAXLEVEL; 1218 q->toplevel = TC_CBQ_MAXLEVEL;
1221 q->now = psched_get_time(); 1219 q->now = psched_get_time();
1222 q->now_rt = q->now; 1220 q->now_rt = q->now;
@@ -1399,8 +1397,7 @@ static int cbq_init(struct Qdisc *sch, struct nlattr *opt)
1399 q->link.minidle = -0x7FFFFFFF; 1397 q->link.minidle = -0x7FFFFFFF;
1400 1398
1401 qdisc_watchdog_init(&q->watchdog, sch); 1399 qdisc_watchdog_init(&q->watchdog, sch);
1402 tasklet_hrtimer_init(&q->delay_timer, cbq_undelay, 1400 hrtimer_init(&q->delay_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
1403 CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
1404 q->delay_timer.function = cbq_undelay; 1401 q->delay_timer.function = cbq_undelay;
1405 q->toplevel = TC_CBQ_MAXLEVEL; 1402 q->toplevel = TC_CBQ_MAXLEVEL;
1406 q->now = psched_get_time(); 1403 q->now = psched_get_time();