diff options
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/sch_htb.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 9ca8a26ba507..2f0f0b04d3fb 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
@@ -661,12 +661,13 @@ static void htb_charge_class(struct htb_sched *q, struct htb_class *cl, | |||
661 | * next pending event (0 for no event in pq). | 661 | * next pending event (0 for no event in pq). |
662 | * Note: Applied are events whose have cl->pq_key <= q->now. | 662 | * Note: Applied are events whose have cl->pq_key <= q->now. |
663 | */ | 663 | */ |
664 | static psched_time_t htb_do_events(struct htb_sched *q, int level) | 664 | static psched_time_t htb_do_events(struct htb_sched *q, int level, |
665 | unsigned long start) | ||
665 | { | 666 | { |
666 | /* don't run for longer than 2 jiffies; 2 is used instead of | 667 | /* don't run for longer than 2 jiffies; 2 is used instead of |
667 | 1 to simplify things when jiffy is going to be incremented | 668 | 1 to simplify things when jiffy is going to be incremented |
668 | too soon */ | 669 | too soon */ |
669 | unsigned long stop_at = jiffies + 2; | 670 | unsigned long stop_at = start + 2; |
670 | while (time_before(jiffies, stop_at)) { | 671 | while (time_before(jiffies, stop_at)) { |
671 | struct htb_class *cl; | 672 | struct htb_class *cl; |
672 | long diff; | 673 | long diff; |
@@ -845,6 +846,7 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch) | |||
845 | struct htb_sched *q = qdisc_priv(sch); | 846 | struct htb_sched *q = qdisc_priv(sch); |
846 | int level; | 847 | int level; |
847 | psched_time_t next_event; | 848 | psched_time_t next_event; |
849 | unsigned long start_at; | ||
848 | 850 | ||
849 | /* try to dequeue direct packets as high prio (!) to minimize cpu work */ | 851 | /* try to dequeue direct packets as high prio (!) to minimize cpu work */ |
850 | skb = __skb_dequeue(&q->direct_queue); | 852 | skb = __skb_dequeue(&q->direct_queue); |
@@ -857,6 +859,7 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch) | |||
857 | if (!sch->q.qlen) | 859 | if (!sch->q.qlen) |
858 | goto fin; | 860 | goto fin; |
859 | q->now = psched_get_time(); | 861 | q->now = psched_get_time(); |
862 | start_at = jiffies; | ||
860 | 863 | ||
861 | next_event = q->now + 5 * PSCHED_TICKS_PER_SEC; | 864 | next_event = q->now + 5 * PSCHED_TICKS_PER_SEC; |
862 | 865 | ||
@@ -866,7 +869,7 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch) | |||
866 | psched_time_t event; | 869 | psched_time_t event; |
867 | 870 | ||
868 | if (q->now >= q->near_ev_cache[level]) { | 871 | if (q->now >= q->near_ev_cache[level]) { |
869 | event = htb_do_events(q, level); | 872 | event = htb_do_events(q, level, start_at); |
870 | if (!event) | 873 | if (!event) |
871 | event = q->now + PSCHED_TICKS_PER_SEC; | 874 | event = q->now + PSCHED_TICKS_PER_SEC; |
872 | q->near_ev_cache[level] = event; | 875 | q->near_ev_cache[level] = event; |