blob: 05e9215d2cf8cd684fdcf044aa9eb7b545c680ad [file] [log] [blame]
Allen Martinfc468d82016-11-15 17:57:52 -08001From 59eb56d210e3831cc9d320b80f3306236c611594 Mon Sep 17 00:00:00 2001
Allen Martin685e0f82016-07-26 19:34:29 -07002From: Thomas Gleixner <tglx@linutronix.de>
3Date: Wed, 7 Mar 2012 21:10:04 +0100
Allen Martinfc468d82016-11-15 17:57:52 -08004Subject: [PATCH 169/351] net: Use cpu_chill() instead of cpu_relax()
Allen Martin685e0f82016-07-26 19:34:29 -07005X-NVConfidentiality: public
6
7Retry loops on RT might loop forever when the modifying side was
8preempted. Use cpu_chill() instead of cpu_relax() to let the system
9make progress.
10
11Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Allen Martin685e0f82016-07-26 19:34:29 -070012---
13 net/packet/af_packet.c | 5 +++--
14 net/rds/ib_rdma.c | 3 ++-
15 2 files changed, 5 insertions(+), 3 deletions(-)
16
17diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
Allen Martinfc468d82016-11-15 17:57:52 -080018index 9cc7b512b472..528941b8a54d 100644
Allen Martin685e0f82016-07-26 19:34:29 -070019--- a/net/packet/af_packet.c
20+++ b/net/packet/af_packet.c
21@@ -63,6 +63,7 @@
22 #include <linux/if_packet.h>
23 #include <linux/wireless.h>
24 #include <linux/kernel.h>
25+#include <linux/delay.h>
26 #include <linux/kmod.h>
27 #include <linux/slab.h>
28 #include <linux/vmalloc.h>
29@@ -695,7 +696,7 @@ static void prb_retire_rx_blk_timer_expired(unsigned long data)
30 if (BLOCK_NUM_PKTS(pbd)) {
31 while (atomic_read(&pkc->blk_fill_in_prog)) {
32 /* Waiting for skb_copy_bits to finish... */
33- cpu_relax();
34+ cpu_chill();
35 }
36 }
37
38@@ -957,7 +958,7 @@ static void prb_retire_current_block(struct tpacket_kbdq_core *pkc,
39 if (!(status & TP_STATUS_BLK_TMO)) {
40 while (atomic_read(&pkc->blk_fill_in_prog)) {
41 /* Waiting for skb_copy_bits to finish... */
42- cpu_relax();
43+ cpu_chill();
44 }
45 }
46 prb_close_block(pkc, pbd, po, status);
47diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c
48index a2340748ec86..19123a97b354 100644
49--- a/net/rds/ib_rdma.c
50+++ b/net/rds/ib_rdma.c
51@@ -34,6 +34,7 @@
52 #include <linux/slab.h>
53 #include <linux/rculist.h>
54 #include <linux/llist.h>
55+#include <linux/delay.h>
56
57 #include "rds.h"
58 #include "ib.h"
59@@ -313,7 +314,7 @@ static inline void wait_clean_list_grace(void)
60 for_each_online_cpu(cpu) {
61 flag = &per_cpu(clean_list_grace, cpu);
62 while (test_bit(CLEAN_LIST_BUSY_BIT, flag))
63- cpu_relax();
64+ cpu_chill();
65 }
66 }
67
68--
Allen Martinfc468d82016-11-15 17:57:52 -0800692.10.1
Allen Martin685e0f82016-07-26 19:34:29 -070070