summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0202-mm-page_alloc-Use-migrate_disable-in-drain_local_pag.patch
blob: 0b81821191940a33035fea480084c5497e6cafa2 (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
From c01fbe44adc26256f7a7a641def9651107ad0525 Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 2 Jul 2020 14:27:23 +0200
Subject: [PATCH 202/323] mm/page_alloc: Use migrate_disable() in
 drain_local_pages_wq()
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.215-rt107.tar.xz

drain_local_pages_wq() disables preemption to avoid CPU migration during
CPU hotplug.
Using migrate_disable() makes the function preemptible on PREEMPT_RT but
still avoids CPU migrations during CPU-hotplug. On !PREEMPT_RT it
behaves like preempt_disable().

Use migrate_disable() in drain_local_pages_wq().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 mm/page_alloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index ae573a3f91964..9831b1fcda36f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3048,9 +3048,9 @@ static void drain_local_pages_wq(struct work_struct *work)
 	 * cpu which is allright but we also have to make sure to not move to
 	 * a different one.
 	 */
-	preempt_disable();
+	migrate_disable();
 	drain_local_pages(drain->zone);
-	preempt_enable();
+	migrate_enable();
 }
 
 /*
-- 
2.44.0