Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157023
b: refs/heads/master
c: 38acce2
h: refs/heads/master
i:
  157021: 1a3716d
  157019: e0b085c
  157015: 31ce380
  157007: 76fd4ca
  156991: 3cba487
v: v3
  • Loading branch information
David S. Miller committed Aug 24, 2009
1 parent 404efa4 commit bd611e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ee5f9757ea17759e1ce5503bdae2b07e48e32af9
refs/heads/master: 38acce2d7983632100a9ff3fd20295f6e34074a8
23 changes: 13 additions & 10 deletions trunk/net/sched/sch_cbq.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ struct cbq_sched_data
psched_time_t now_rt; /* Cached real time */
unsigned pmask;

struct hrtimer delay_timer;
struct tasklet_hrtimer delay_timer;
struct qdisc_watchdog watchdog; /* Watchdog timer,
started when CBQ has
backlog, but cannot
Expand Down Expand Up @@ -503,19 +503,21 @@ static void cbq_ovl_delay(struct cbq_class *cl)
cl->undertime = q->now + delay;

if (delay > 0) {
struct hrtimer *ht;

sched += delay + cl->penalty;
cl->penalized = sched;
cl->cpriority = TC_CBQ_MAXPRIO;
q->pmask |= (1<<TC_CBQ_MAXPRIO);

expires = ktime_set(0, 0);
expires = ktime_add_ns(expires, PSCHED_TICKS2NS(sched));
if (hrtimer_try_to_cancel(&q->delay_timer) &&
ktime_to_ns(ktime_sub(
hrtimer_get_expires(&q->delay_timer),
expires)) > 0)
hrtimer_set_expires(&q->delay_timer, expires);
hrtimer_restart(&q->delay_timer);
ht = &q->delay_timer.timer;
if (hrtimer_try_to_cancel(ht) &&
ktime_to_ns(ktime_sub(hrtimer_get_expires(ht),
expires)) > 0)
hrtimer_set_expires(ht, expires);
hrtimer_restart(ht);
cl->delayed = 1;
cl->xstats.overactions++;
return;
Expand Down Expand Up @@ -621,7 +623,7 @@ static enum hrtimer_restart cbq_undelay(struct hrtimer *timer)

time = ktime_set(0, 0);
time = ktime_add_ns(time, PSCHED_TICKS2NS(now + delay));
hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS);
tasklet_hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS);
}

sch->flags &= ~TCQ_F_THROTTLED;
Expand Down Expand Up @@ -1214,7 +1216,7 @@ cbq_reset(struct Qdisc* sch)
q->tx_class = NULL;
q->tx_borrowed = NULL;
qdisc_watchdog_cancel(&q->watchdog);
hrtimer_cancel(&q->delay_timer);
tasklet_hrtimer_cancel(&q->delay_timer);
q->toplevel = TC_CBQ_MAXLEVEL;
q->now = psched_get_time();
q->now_rt = q->now;
Expand Down Expand Up @@ -1397,7 +1399,8 @@ static int cbq_init(struct Qdisc *sch, struct nlattr *opt)
q->link.minidle = -0x7FFFFFFF;

qdisc_watchdog_init(&q->watchdog, sch);
hrtimer_init(&q->delay_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
tasklet_hrtimer_init(&q->delay_timer, cbq_undelay,
CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
q->delay_timer.function = cbq_undelay;
q->toplevel = TC_CBQ_MAXLEVEL;
q->now = psched_get_time();
Expand Down

0 comments on commit bd611e8

Please sign in to comment.