Commit 195648bb authored by David S. Miller's avatar David S. Miller

pkt_sched: Prevent livelock in TX queue running.

If dev_deactivate() is trying to quiesce the queue, it
is theoretically possible for another cpu to livelock
trying to process that queue.  This happens because
dev_deactivate() grabs the queue spinlock as it checks
the queue state, whereas net_tx_action() does a trylock
and reschedules the qdisc if it hits the lock.

This breaks the livelock by adding a check on
__QDISC_STATE_DEACTIVATED to net_tx_action() when
the trylock fails.

Based upon feedback from Herbert Xu and Jarek Poplawski.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d2805395
...@@ -1990,6 +1990,8 @@ static void net_tx_action(struct softirq_action *h) ...@@ -1990,6 +1990,8 @@ static void net_tx_action(struct softirq_action *h)
qdisc_run(q); qdisc_run(q);
spin_unlock(root_lock); spin_unlock(root_lock);
} else { } else {
if (!test_bit(__QDISC_STATE_DEACTIVATED,
&q->state))
__netif_reschedule(q); __netif_reschedule(q);
} }
} }
......
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