Commit fba373d2 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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 <edumazet@google.com>
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 15dc36eb
...@@ -1303,6 +1303,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid, ...@@ -1303,6 +1303,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
struct gnet_dump d; struct gnet_dump d;
struct qdisc_size_table *stab; struct qdisc_size_table *stab;
cond_resched();
nlh = nlmsg_put(skb, portid, seq, event, sizeof(*tcm), flags); nlh = nlmsg_put(skb, portid, seq, event, sizeof(*tcm), flags);
if (!nlh) if (!nlh)
goto out_nlmsg_trim; goto out_nlmsg_trim;
...@@ -1615,6 +1616,7 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q, ...@@ -1615,6 +1616,7 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q,
struct gnet_dump d; struct gnet_dump d;
const struct Qdisc_class_ops *cl_ops = q->ops->cl_ops; const struct Qdisc_class_ops *cl_ops = q->ops->cl_ops;
cond_resched();
nlh = nlmsg_put(skb, portid, seq, event, sizeof(*tcm), flags); nlh = nlmsg_put(skb, portid, seq, event, sizeof(*tcm), flags);
if (!nlh) if (!nlh)
goto out_nlmsg_trim; goto out_nlmsg_trim;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment