]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - rt-patches/0179-net-Make-synchronize_rcu_expedited-conditional-on-RT.patch
rt_patches: required rebase due to printk change
[hercules2020/nv-tegra/linux-4.4.git] / rt-patches / 0179-net-Make-synchronize_rcu_expedited-conditional-on-RT.patch
1 From 2931bfc8dc735944ee4b76ab83f2c181c0673fa8 Mon Sep 17 00:00:00 2001
2 From: Josh Cartwright <joshc@ni.com>
3 Date: Tue, 27 Oct 2015 07:31:53 -0500
4 Subject: [PATCH 179/366] net: Make synchronize_rcu_expedited() conditional on
5  !RT_FULL
6
7 While the use of synchronize_rcu_expedited() might make
8 synchronize_net() "faster", it does so at significant cost on RT
9 systems, as expediting a grace period forcibly preempts any
10 high-priority RT tasks (via the stop_machine() mechanism).
11
12 Without this change, we can observe a latency spike up to 30us with
13 cyclictest by rapidly unplugging/reestablishing an ethernet link.
14
15 Suggested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
16 Signed-off-by: Josh Cartwright <joshc@ni.com>
17 Cc: bigeasy@linutronix.de
18 Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
19 Acked-by: David S. Miller <davem@davemloft.net>
20 Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
21 Link: http://lkml.kernel.org/r/20151027123153.GG8245@jcartwri.amer.corp.natinst.com
22 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
23 ---
24  net/core/dev.c | 2 +-
25  1 file changed, 1 insertion(+), 1 deletion(-)
26
27 diff --git a/net/core/dev.c b/net/core/dev.c
28 index bfbf0b6..071f0b1 100644
29 --- a/net/core/dev.c
30 +++ b/net/core/dev.c
31 @@ -7248,7 +7248,7 @@ EXPORT_SYMBOL(free_netdev);
32  void synchronize_net(void)
33  {
34         might_sleep();
35 -       if (rtnl_is_locked())
36 +       if (rtnl_is_locked() && !IS_ENABLED(CONFIG_PREEMPT_RT_FULL))
37                 synchronize_rcu_expedited();
38         else
39                 synchronize_rcu();
40 -- 
41 1.9.1
42