blob: 863196783c23f18b83428702e786b462b460edb1 [file] [log] [blame]
Arvind M8e87d852018-01-29 00:04:29 -08001From 062836aa29e05a94bc23534d903401ea687a2ff9 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
Arvind M10268e72017-12-04 22:18:06 -08004Subject: [PATCH 169/366] net: Use cpu_chill() instead of cpu_relax()
Allen Martin685e0f82016-07-26 19:34:29 -07005
6Retry loops on RT might loop forever when the modifying side was
7preempted. Use cpu_chill() instead of cpu_relax() to let the system
8make progress.
9
10Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Allen Martin685e0f82016-07-26 19:34:29 -070011---
12 net/packet/af_packet.c | 5 +++--
13 net/rds/ib_rdma.c | 3 ++-
14 2 files changed, 5 insertions(+), 3 deletions(-)
15
16diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
Arvind M10268e72017-12-04 22:18:06 -080017index c148581..759d6ed 100644
Allen Martin685e0f82016-07-26 19:34:29 -070018--- 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>
Ishan Mittalb7998262017-01-17 16:11:50 +053028@@ -694,7 +695,7 @@ static void prb_retire_rx_blk_timer_expired(unsigned long data)
Allen Martin685e0f82016-07-26 19:34:29 -070029 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
Ishan Mittalb7998262017-01-17 16:11:50 +053037@@ -956,7 +957,7 @@ static void prb_retire_current_block(struct tpacket_kbdq_core *pkc,
Allen Martin685e0f82016-07-26 19:34:29 -070038 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);
46diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c
Ishan Mittalb7998262017-01-17 16:11:50 +053047index a234074..19123a9 100644
Allen Martin685e0f82016-07-26 19:34:29 -070048--- 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--
Arvind M10268e72017-12-04 22:18:06 -0800681.9.1
Allen Martin685e0f82016-07-26 19:34:29 -070069