From: Eric Dumazet <edumazet@google.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Eric Dumazet <edumazet@google.com>
Subject: [PATCH net-next 2/2] pkt_sched: add cond_resched() to class and qdisc dump
Date: Mon, 10 Mar 2014 17:11:43 -0700 [thread overview]
Message-ID: <1394496703-9278-3-git-send-email-edumazet@google.com> (raw)
In-Reply-To: <1394496703-9278-1-git-send-email-edumazet@google.com>
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>
---
net/sched/sch_api.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 272292efa7f0..0a99d7ced71e 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;
--
1.9.0.279.gdc9e3eb
next prev parent reply other threads:[~2014-03-11 0:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-11 0:11 [PATCH net-next 0/2] pkt_sched: allow scheduling points Eric Dumazet
2014-03-11 0:11 ` [PATCH net-next 1/2] pkt_sched: do not use rcu in tc_dump_qdisc() Eric Dumazet
2014-03-11 0:11 ` Eric Dumazet [this message]
2014-03-11 0:30 ` [PATCH net-next 2/2] pkt_sched: add cond_resched() to class and qdisc dump Eric Dumazet
2014-03-12 3:55 ` [PATCH net-next 0/2] pkt_sched: allow scheduling points David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1394496703-9278-3-git-send-email-edumazet@google.com \
--to=edumazet@google.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox