2012-12-14 01:14:08 +00:00
|
|
|
From 23edd4e4d785a9325de268b17d5b92342746fa32 Mon Sep 17 00:00:00 2001
|
2012-03-07 22:21:48 +00:00
|
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
2012-05-12 14:20:55 +00:00
|
|
|
Date: Wed, 7 Mar 2012 21:10:04 +0100
|
2012-12-09 22:00:02 +00:00
|
|
|
Subject: [PATCH 260/290] net: Use cpu_chill() instead of cpu_relax()
|
2012-03-07 22:21:48 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
---
|
|
|
|
net/packet/af_packet.c | 5 +++--
|
|
|
|
net/rds/ib_rdma.c | 3 ++-
|
|
|
|
2 files changed, 5 insertions(+), 3 deletions(-)
|
|
|
|
|
2012-05-12 14:20:55 +00:00
|
|
|
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
|
2012-10-10 05:15:23 +00:00
|
|
|
index 85afc13..684f510 100644
|
2012-05-12 14:20:55 +00:00
|
|
|
--- a/net/packet/af_packet.c
|
|
|
|
+++ b/net/packet/af_packet.c
|
2012-03-07 22:21:48 +00:00
|
|
|
@@ -89,6 +89,7 @@
|
|
|
|
#include <linux/virtio_net.h>
|
|
|
|
#include <linux/errqueue.h>
|
|
|
|
#include <linux/net_tstamp.h>
|
|
|
|
+#include <linux/delay.h>
|
|
|
|
|
|
|
|
#ifdef CONFIG_INET
|
|
|
|
#include <net/inet_common.h>
|
2012-05-12 14:20:55 +00:00
|
|
|
@@ -673,7 +674,7 @@ static void prb_retire_rx_blk_timer_expired(unsigned long data)
|
2012-03-07 22:21:48 +00:00
|
|
|
if (BLOCK_NUM_PKTS(pbd)) {
|
|
|
|
while (atomic_read(&pkc->blk_fill_in_prog)) {
|
|
|
|
/* Waiting for skb_copy_bits to finish... */
|
|
|
|
- cpu_relax();
|
|
|
|
+ cpu_chill();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-05-12 14:20:55 +00:00
|
|
|
@@ -928,7 +929,7 @@ static void prb_retire_current_block(struct tpacket_kbdq_core *pkc,
|
2012-03-07 22:21:48 +00:00
|
|
|
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);
|
2012-05-12 14:20:55 +00:00
|
|
|
diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c
|
|
|
|
index e8fdb17..5a44c6e 100644
|
|
|
|
--- a/net/rds/ib_rdma.c
|
|
|
|
+++ b/net/rds/ib_rdma.c
|
2012-03-07 22:21:48 +00:00
|
|
|
@@ -34,6 +34,7 @@
|
|
|
|
#include <linux/slab.h>
|
|
|
|
#include <linux/rculist.h>
|
|
|
|
#include <linux/llist.h>
|
|
|
|
+#include <linux/delay.h>
|
|
|
|
|
|
|
|
#include "rds.h"
|
|
|
|
#include "ib.h"
|
2012-05-12 14:20:55 +00:00
|
|
|
@@ -286,7 +287,7 @@ static inline void wait_clean_list_grace(void)
|
2012-03-07 22:21:48 +00:00
|
|
|
for_each_online_cpu(cpu) {
|
|
|
|
flag = &per_cpu(clean_list_grace, cpu);
|
|
|
|
while (test_bit(CLEAN_LIST_BUSY_BIT, flag))
|
|
|
|
- cpu_relax();
|
|
|
|
+ cpu_chill();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|