linux/debian/patches-rt/0189-net-Use-cpu_chill-inst...

71 lines
2.1 KiB
Diff
Raw Normal View History

2019-04-30 12:45:19 +00:00
From 128245989afa7b20f2b7e7fc43727086cce5bf13 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
2019-04-08 23:49:20 +00:00
Date: Wed, 7 Mar 2012 21:10:04 +0100
2019-05-29 19:49:30 +00:00
Subject: [PATCH 189/269] net: Use cpu_chill() instead of cpu_relax()
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.37-rt20.tar.xz
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>
---
2019-04-08 23:49:20 +00:00
net/packet/af_packet.c | 5 +++--
net/rds/ib_rdma.c | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
2019-04-08 23:49:20 +00:00
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
2019-04-30 12:45:19 +00:00
index a0d295478e69..ce1bfcbbda45 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>
2019-04-08 23:49:20 +00:00
@@ -667,7 +668,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();
}
}
2019-04-08 23:49:20 +00:00
@@ -929,7 +930,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);
2019-04-08 23:49:20 +00:00
diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c
index 63c8d107adcf..671f8ad38864 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"
2019-04-08 23:49:20 +00:00
@@ -222,7 +223,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();
}
}
2019-04-08 23:49:20 +00:00
--
2.20.1