Allen Martin | fc468d8 | 2016-11-15 17:57:52 -0800 | [diff] [blame] | 1 | From 59eb56d210e3831cc9d320b80f3306236c611594 Mon Sep 17 00:00:00 2001 |
Allen Martin | 685e0f8 | 2016-07-26 19:34:29 -0700 | [diff] [blame] | 2 | From: Thomas Gleixner <tglx@linutronix.de> |
| 3 | Date: Wed, 7 Mar 2012 21:10:04 +0100 |
Allen Martin | fc468d8 | 2016-11-15 17:57:52 -0800 | [diff] [blame] | 4 | Subject: [PATCH 169/351] net: Use cpu_chill() instead of cpu_relax() |
Allen Martin | 685e0f8 | 2016-07-26 19:34:29 -0700 | [diff] [blame] | 5 | X-NVConfidentiality: public |
| 6 | |
| 7 | Retry loops on RT might loop forever when the modifying side was |
| 8 | preempted. Use cpu_chill() instead of cpu_relax() to let the system |
| 9 | make progress. |
| 10 | |
| 11 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
Allen Martin | 685e0f8 | 2016-07-26 19:34:29 -0700 | [diff] [blame] | 12 | --- |
| 13 | net/packet/af_packet.c | 5 +++-- |
| 14 | net/rds/ib_rdma.c | 3 ++- |
| 15 | 2 files changed, 5 insertions(+), 3 deletions(-) |
| 16 | |
| 17 | diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c |
Allen Martin | fc468d8 | 2016-11-15 17:57:52 -0800 | [diff] [blame] | 18 | index 9cc7b512b472..528941b8a54d 100644 |
Allen Martin | 685e0f8 | 2016-07-26 19:34:29 -0700 | [diff] [blame] | 19 | --- 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); |
| 47 | diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c |
| 48 | index 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 Martin | fc468d8 | 2016-11-15 17:57:52 -0800 | [diff] [blame] | 69 | 2.10.1 |
Allen Martin | 685e0f8 | 2016-07-26 19:34:29 -0700 | [diff] [blame] | 70 | |