2020-10-12 12:52:06 +00:00
|
|
|
From cbff1538328ab180c65cc18c936e598c927cd88b Mon Sep 17 00:00:00 2001
|
|
|
|
Message-Id: <cbff1538328ab180c65cc18c936e598c927cd88b.1601675152.git.zanussi@kernel.org>
|
|
|
|
In-Reply-To: <5b5a156f9808b1acf1205606e03da117214549ea.1601675151.git.zanussi@kernel.org>
|
|
|
|
References: <5b5a156f9808b1acf1205606e03da117214549ea.1601675151.git.zanussi@kernel.org>
|
2018-08-27 14:32:32 +00:00
|
|
|
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
|
|
Date: Wed, 30 Mar 2016 13:36:29 +0200
|
2020-09-04 20:10:21 +00:00
|
|
|
Subject: [PATCH 200/333] net: dev: always take qdisc's busylock in
|
2019-04-08 23:49:20 +00:00
|
|
|
__dev_xmit_skb()
|
2020-10-12 12:52:06 +00:00
|
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.148-rt64.tar.xz
|
2018-08-27 14:32:32 +00:00
|
|
|
|
|
|
|
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 ++++
|
2018-08-27 14:32:32 +00:00
|
|
|
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
|
2020-10-12 12:52:06 +00:00
|
|
|
index 91040933006b..9b15c663b3f8 100644
|
2018-08-27 14:32:32 +00:00
|
|
|
--- a/net/core/dev.c
|
|
|
|
+++ b/net/core/dev.c
|
2020-07-15 20:05:29 +00:00
|
|
|
@@ -3464,7 +3464,11 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
|
2018-08-27 14:32:32 +00:00
|
|
|
* 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);
|
|
|
|
|
2020-01-03 23:36:11 +00:00
|
|
|
--
|
2020-06-22 13:14:16 +00:00
|
|
|
2.17.1
|
2020-01-03 23:36:11 +00:00
|
|
|
|