From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Fri, 20 Mar 2020 16:19:51 +0100
Subject: [PATCH] mm/page_alloc: Use migrate_disable() in
drain_local_pages_wq()
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
Git-commit: 0443a3044a15a8cb1fcca0997b637d5887909715
Patch-mainline: Queued in subsystem maintainer repository
References: SLE Realtime Extension
The drain_local_pages_wq() uses preempt_disable() to ensure that there
will be no CPU migration while drain_local_pages() is invoked which
might happen if the CPU is going down.
drain_local_pages() acquires a sleeping lock on RT which can not be
acquired with disabled preemption.
Use migrate_disable() instead of preempt_disable(): On RT it ensures
that the CPU won't go down and on !RT it is replaced with
preempt_disable().
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
mm/page_alloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2912,9 +2912,9 @@ static void drain_local_pages_wq(struct
* 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();
}
/*