Skip to content

Commit

Permalink
pkt_sched: do not use rcu in tc_dump_qdisc()
Browse files Browse the repository at this point in the history
Like all rtnetlink dump operations, we hold RTNL in tc_dump_qdisc(),
so we do not need to use rcu protection to protect list of netdevices.

This will allow preemption to occur, thus reducing latencies.
Following patch adds explicit cond_resched() calls.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Mar 12, 2014
1 parent a19a7ec commit 15dc36e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/sched/sch_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1434,9 +1434,9 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb)
s_idx = cb->args[0];
s_q_idx = q_idx = cb->args[1];

rcu_read_lock();
idx = 0;
for_each_netdev_rcu(net, dev) {
ASSERT_RTNL();
for_each_netdev(net, dev) {
struct netdev_queue *dev_queue;

if (idx < s_idx)
Expand All @@ -1459,8 +1459,6 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb)
}

done:
rcu_read_unlock();

cb->args[0] = idx;
cb->args[1] = q_idx;

Expand Down

0 comments on commit 15dc36e

Please sign in to comment.