From: Eric Dumazet Date: Tue, 11 Mar 2014 00:11:43 +0000 (-0700) Subject: pkt_sched: add cond_resched() to class and qdisc dump X-Git-Tag: v3.15-rc1~113^2~183^2 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=fba373d2bb267eaeba85579dd04b91435df8c83b;p=~emulex%2Finfiniband.git pkt_sched: add cond_resched() to class and qdisc dump We have seen delays of more than 50ms in class or qdisc dumps, in case device is under high TX stress, even with the prior 4KB per skb limit. Add cond_resched() to give a chance to higher prio tasks to get cpu. Signed-off-by; Eric Dumazet Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 272292efa7f..0a99d7ced71 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1303,6 +1303,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid, struct gnet_dump d; struct qdisc_size_table *stab; + cond_resched(); nlh = nlmsg_put(skb, portid, seq, event, sizeof(*tcm), flags); if (!nlh) goto out_nlmsg_trim; @@ -1615,6 +1616,7 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q, struct gnet_dump d; const struct Qdisc_class_ops *cl_ops = q->ops->cl_ops; + cond_resched(); nlh = nlmsg_put(skb, portid, seq, event, sizeof(*tcm), flags); if (!nlh) goto out_nlmsg_trim;