diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2012-03-07 21:10:04 +0100 |
---|---|---|
committer | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2018-08-07 16:20:28 +0200 |
commit | bf461919e058aecbed3fe0bac944eba07ccc88d6 (patch) | |
tree | 63139f472eff04ffbd8f8e7d9cc4106da1e5a7d3 /net | |
parent | 93b7dbb6ff5ecb36c53b0bc1ae7726d7ad3209cf (diff) | |
download | linux-rt-bf461919e058aecbed3fe0bac944eba07ccc88d6.tar.gz |
net: Use cpu_chill() instead of cpu_relax()
Retry loops on RT might loop forever when the modifying side was
preempted. Use cpu_chill() instead of cpu_relax() to let the system
make progress.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/packet/af_packet.c | 5 | ||||
-rw-r--r-- | net/rds/ib_rdma.c | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 9b27d0cd766d..ecc4a780a2c5 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -63,6 +63,7 @@ #include <linux/if_packet.h> #include <linux/wireless.h> #include <linux/kernel.h> +#include <linux/delay.h> #include <linux/kmod.h> #include <linux/slab.h> #include <linux/vmalloc.h> @@ -666,7 +667,7 @@ static void prb_retire_rx_blk_timer_expired(struct timer_list *t) if (BLOCK_NUM_PKTS(pbd)) { while (atomic_read(&pkc->blk_fill_in_prog)) { /* Waiting for skb_copy_bits to finish... */ - cpu_relax(); + cpu_chill(); } } @@ -928,7 +929,7 @@ static void prb_retire_current_block(struct tpacket_kbdq_core *pkc, if (!(status & TP_STATUS_BLK_TMO)) { while (atomic_read(&pkc->blk_fill_in_prog)) { /* Waiting for skb_copy_bits to finish... */ - cpu_relax(); + cpu_chill(); } } prb_close_block(pkc, pbd, po, status); diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c index 2e49a40a5e11..828cade3eb38 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c @@ -34,6 +34,7 @@ #include <linux/slab.h> #include <linux/rculist.h> #include <linux/llist.h> +#include <linux/delay.h> #include "rds_single_path.h" #include "ib_mr.h" @@ -210,7 +211,7 @@ static inline void wait_clean_list_grace(void) for_each_online_cpu(cpu) { flag = &per_cpu(clean_list_grace, cpu); while (test_bit(CLEAN_LIST_BUSY_BIT, flag)) - cpu_relax(); + cpu_chill(); } } |