]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - rt-patches/0169-net-Use-cpu_chill-instead-of-cpu_relax.patch
Fix memguard and related syscalls
[hercules2020/nv-tegra/linux-4.4.git] / rt-patches / 0169-net-Use-cpu_chill-instead-of-cpu_relax.patch
1 From 506b107258faad9ea2168f543fed81666caa68d2 Mon Sep 17 00:00:00 2001
2 From: Thomas Gleixner <tglx@linutronix.de>
3 Date: Wed, 7 Mar 2012 21:10:04 +0100
4 Subject: [PATCH 169/366] net: Use cpu_chill() instead of cpu_relax()
5
6 Retry loops on RT might loop forever when the modifying side was
7 preempted. Use cpu_chill() instead of cpu_relax() to let the system
8 make progress.
9
10 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
11 ---
12  net/packet/af_packet.c | 5 +++--
13  net/rds/ib_rdma.c      | 3 ++-
14  2 files changed, 5 insertions(+), 3 deletions(-)
15
16 diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
17 index c148581..759d6ed 100644
18 --- a/net/packet/af_packet.c
19 +++ b/net/packet/af_packet.c
20 @@ -63,6 +63,7 @@
21  #include <linux/if_packet.h>
22  #include <linux/wireless.h>
23  #include <linux/kernel.h>
24 +#include <linux/delay.h>
25  #include <linux/kmod.h>
26  #include <linux/slab.h>
27  #include <linux/vmalloc.h>
28 @@ -694,7 +695,7 @@ static void prb_retire_rx_blk_timer_expired(unsigned long data)
29         if (BLOCK_NUM_PKTS(pbd)) {
30                 while (atomic_read(&pkc->blk_fill_in_prog)) {
31                         /* Waiting for skb_copy_bits to finish... */
32 -                       cpu_relax();
33 +                       cpu_chill();
34                 }
35         }
36  
37 @@ -956,7 +957,7 @@ static void prb_retire_current_block(struct tpacket_kbdq_core *pkc,
38                 if (!(status & TP_STATUS_BLK_TMO)) {
39                         while (atomic_read(&pkc->blk_fill_in_prog)) {
40                                 /* Waiting for skb_copy_bits to finish... */
41 -                               cpu_relax();
42 +                               cpu_chill();
43                         }
44                 }
45                 prb_close_block(pkc, pbd, po, status);
46 diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c
47 index a234074..19123a9 100644
48 --- a/net/rds/ib_rdma.c
49 +++ b/net/rds/ib_rdma.c
50 @@ -34,6 +34,7 @@
51  #include <linux/slab.h>
52  #include <linux/rculist.h>
53  #include <linux/llist.h>
54 +#include <linux/delay.h>
55  
56  #include "rds.h"
57  #include "ib.h"
58 @@ -313,7 +314,7 @@ static inline void wait_clean_list_grace(void)
59         for_each_online_cpu(cpu) {
60                 flag = &per_cpu(clean_list_grace, cpu);
61                 while (test_bit(CLEAN_LIST_BUSY_BIT, flag))
62 -                       cpu_relax();
63 +                       cpu_chill();
64         }
65  }
66  
67 -- 
68 1.9.1
69