diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2012-03-07 21:10:04 +0100 |
---|---|---|
committer | Anders Roxell <anders.roxell@linaro.org> | 2014-06-30 14:41:18 +0200 |
commit | a8fc05e21f3bbbf4b75a2ca8316ed6e5c32ad2d0 (patch) | |
tree | 96a28e6b77267073cbe48b4cf4bdd00dbe8899a4 /net/packet | |
parent | 26b15e48fa4157411ba78bf69fa9111c8488c01a (diff) |
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>
Cc: stable-rt@vger.kernel.org
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Diffstat (limited to 'net/packet')
-rw-r--r-- | net/packet/af_packet.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 48a6a93db296..5a2708ced63e 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> @@ -700,7 +701,7 @@ static void prb_retire_rx_blk_timer_expired(unsigned long data) if (BLOCK_NUM_PKTS(pbd)) { while (atomic_read(&pkc->blk_fill_in_prog)) { /* Waiting for skb_copy_bits to finish... */ - cpu_relax(); + cpu_chill(); } } @@ -951,7 +952,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); |