summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/mm-swap-Enable-use-pvec-lock-on-RT.patch
blob: 51f7bfdf1026de32b1585a836fe311fb3ad5870e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Mon, 12 Aug 2019 11:20:44 +0200
Subject: [PATCH] mm/swap: Enable use pvec lock on RT
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.4/older/patches-5.4.3-rt1.tar.xz

On RT we also need to avoid preempt disable/IRQ-off regions so have to enable
the locking while accessing pvecs.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 mm/internal.h |    4 ++++
 mm/swap.c     |    4 ++++
 2 files changed, 8 insertions(+)

--- a/mm/internal.h
+++ b/mm/internal.h
@@ -32,7 +32,11 @@
 /* Do not use these with a slab allocator */
 #define GFP_SLAB_BUG_MASK (__GFP_DMA32|__GFP_HIGHMEM|~__GFP_BITS_MASK)
 
+#ifdef CONFIG_PREEMPT_RT
+extern struct static_key_true use_pvec_lock;
+#else
 extern struct static_key_false use_pvec_lock;
+#endif
 
 void page_writeback_init(void);
 
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -44,7 +44,11 @@
 /* How many pages do we try to swap or page in/out together? */
 int page_cluster;
 
+#ifdef CONFIG_PREEMPT_RT
+DEFINE_STATIC_KEY_TRUE(use_pvec_lock);
+#else
 DEFINE_STATIC_KEY_FALSE(use_pvec_lock);
+#endif
 
 struct swap_pagevec {
 	spinlock_t	lock;