]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - rt-patches/0329-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch
rt_patches: required rebase due to printk change
[hercules2020/nv-tegra/linux-4.4.git] / rt-patches / 0329-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch
1 From b617e9298187e2932cf700c7b359c74d9a35c2bd Mon Sep 17 00:00:00 2001
2 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
3 Date: Wed, 30 Mar 2016 13:36:29 +0200
4 Subject: [PATCH 329/366] net: dev: always take qdisc's busylock in
5  __dev_xmit_skb()
6
7 The root-lock is dropped before dev_hard_start_xmit() is invoked and after
8 setting the __QDISC___STATE_RUNNING bit. If this task is now pushed away
9 by a task with a higher priority then the task with the higher priority
10 won't be able to submit packets to the NIC directly instead they will be
11 enqueued into the Qdisc. The NIC will remain idle until the task(s) with
12 higher priority leave the CPU and the task with lower priority gets back
13 and finishes the job.
14
15 If we take always the busylock we ensure that the RT task can boost the
16 low-prio task and submit the packet.
17
18 Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
19 ---
20  net/core/dev.c | 4 ++++
21  1 file changed, 4 insertions(+)
22
23 diff --git a/net/core/dev.c b/net/core/dev.c
24 index 14f7b58..a2ddf73 100644
25 --- a/net/core/dev.c
26 +++ b/net/core/dev.c
27 @@ -2892,7 +2892,11 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
28          * This permits __QDISC___STATE_RUNNING owner to get the lock more
29          * often and dequeue packets faster.
30          */
31 +#ifdef CONFIG_PREEMPT_RT_FULL
32 +       contended = true;
33 +#else
34         contended = qdisc_is_running(q);
35 +#endif
36         if (unlikely(contended))
37                 spin_lock(&q->busylock);
38  
39 -- 
40 1.9.1
41