Skip to content

Commit

Permalink
pkt_sched: sch_htb: Warn on too many events.
Browse files Browse the repository at this point in the history
Let's get some info on possible config problems. This patch brings
back an old warning, but is printed only once now.

With feedback from Patrick McHardy <kaber@trash.net>

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jarek Poplawski authored and David S. Miller committed Feb 1, 2009
1 parent b00355d commit e82181d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions net/sched/sch_htb.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ struct htb_sched {
int direct_qlen; /* max qlen of above */

long direct_pkts;

#define HTB_WARN_TOOMANYEVENTS 0x1
unsigned int warned; /* only one warning */
};

/* find class in global hash table using given handle */
Expand Down Expand Up @@ -685,6 +688,10 @@ static psched_time_t htb_do_events(struct htb_sched *q, int level,
htb_add_to_wait_tree(q, cl, diff);
}
/* too much load - let's continue on next jiffie (including above) */
if (!(q->warned & HTB_WARN_TOOMANYEVENTS)) {
printk(KERN_WARNING "htb: too many events!\n");
q->warned |= HTB_WARN_TOOMANYEVENTS;
}
return q->now + 2 * PSCHED_TICKS_PER_SEC / HZ;
}

Expand Down

0 comments on commit e82181d

Please sign in to comment.