1 From 255bb0ac393f1c2818cd75af45a9226300ab3daf Mon Sep 17 00:00:00 2001
2 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
3 Date: Wed, 26 Oct 2022 15:48:30 +0200
4 Subject: [PATCH 15/29] mm: multi-gen LRU: move lru_gen_add_mm() out of IRQ-off
7 lru_gen_add_mm() has been added within an IRQ-off region in the commit
8 mentioned below. The other invocations of lru_gen_add_mm() are not within
11 The invocation within IRQ-off region is problematic on PREEMPT_RT because
12 the function is using a spin_lock_t which must not be used within
15 The other invocations of lru_gen_add_mm() occur while
16 task_struct::alloc_lock is acquired. Move lru_gen_add_mm() after
17 interrupts are enabled and before task_unlock().
19 Link: https://lkml.kernel.org/r/20221026134830.711887-1-bigeasy@linutronix.de
20 Fixes: bd74fdaea1460 ("mm: multi-gen LRU: support page table walks")
21 Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
22 Acked-by: Yu Zhao <yuzhao@google.com>
23 Cc: Al Viro <viro@zeniv.linux.org.uk>
24 Cc: "Eric W . Biederman" <ebiederm@xmission.com>
25 Cc: Kees Cook <keescook@chromium.org>
26 Cc: Thomas Gleixner <tglx@linutronix.de>
27 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
30 1 file changed, 1 insertion(+), 1 deletion(-)
32 diff --git a/fs/exec.c b/fs/exec.c
33 index 1afa15a07d26..718c58947be1 100644
36 @@ -1013,7 +1013,6 @@ static int exec_mmap(struct mm_struct *mm)
37 active_mm = tsk->active_mm;
42 * This prevents preemption while active_mm is being loaded and
43 * it and mm are being updated, which could cause problems for
44 @@ -1028,6 +1027,7 @@ static int exec_mmap(struct mm_struct *mm)
46 tsk->mm->vmacache_seqnum = 0;