Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pkt_sched: sch_htb: Consider used jiffies in htb_do_events()

Next event time should consider jiffies used for recounting. Otherwise
qdisc_watchdog_schedule() triggers hrtimer immediately with the event
in the past, and may cause very high ksoftirqd cpu usage (if highres
is on).

There is also removed checking "event" for zero in htb_dequeue(): it's
always true in this place.

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jarek Poplawski and committed by
David S. Miller
c0851347 daaf83d2

+3 -3
+3 -3
net/sched/sch_htb.c
··· 685 685 if (cl->cmode != HTB_CAN_SEND) 686 686 htb_add_to_wait_tree(q, cl, diff); 687 687 } 688 - /* too much load - let's continue on next jiffie */ 689 - return q->now + PSCHED_TICKS_PER_SEC / HZ; 688 + /* too much load - let's continue on next jiffie (including above) */ 689 + return q->now + 2 * PSCHED_TICKS_PER_SEC / HZ; 690 690 } 691 691 692 692 /* Returns class->node+prio from id-tree where classe's id is >= id. NULL ··· 873 873 } else 874 874 event = q->near_ev_cache[level]; 875 875 876 - if (event && next_event > event) 876 + if (next_event > event) 877 877 next_event = event; 878 878 879 879 m = ~q->row_mask[level];