linux/debian/patches-rt/0201-net-dev-always-take-qd...

39 lines
1.5 KiB
Diff
Raw Normal View History

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Wed, 30 Mar 2016 13:36:29 +0200
2019-11-25 00:04:39 +00:00
Subject: [PATCH 201/290] net: dev: always take qdisc's busylock in
2019-04-08 23:49:20 +00:00
__dev_xmit_skb()
2019-11-25 00:04:39 +00:00
Origin: https://git.kernel.org/cgit/linux/kernel/git/rt/linux-stable-rt.git/commit?id=bb88f29ae0c936e363f1c9792509b6dfc48086da
The root-lock is dropped before dev_hard_start_xmit() is invoked and after
setting the __QDISC___STATE_RUNNING bit. If this task is now pushed away
by a task with a higher priority then the task with the higher priority
won't be able to submit packets to the NIC directly instead they will be
enqueued into the Qdisc. The NIC will remain idle until the task(s) with
higher priority leave the CPU and the task with lower priority gets back
and finishes the job.
If we take always the busylock we ensure that the RT task can boost the
low-prio task and submit the packet.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
2019-04-08 23:49:20 +00:00
net/core/dev.c | 4 ++++
1 file changed, 4 insertions(+)
2019-04-08 23:49:20 +00:00
diff --git a/net/core/dev.c b/net/core/dev.c
2019-11-25 00:04:39 +00:00
index 3bbe71c93b04..051b3708e180 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
2019-04-30 12:45:19 +00:00
@@ -3465,7 +3465,11 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
* This permits qdisc->running owner to get the lock more
* often and dequeue packets faster.
*/
+#ifdef CONFIG_PREEMPT_RT_FULL
+ contended = true;
+#else
contended = qdisc_is_running(q);
+#endif
if (unlikely(contended))
spin_lock(&q->busylock);