]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
lockdep/mm: Fix might_fault() lockdep check of current->mm->mmap_lock
authorPeter Zijlstra <peterz@infradead.org>
Mon, 4 Nov 2024 13:39:10 +0000 (14:39 +0100)
committerIngo Molnar <mingo@kernel.org>
Sat, 1 Mar 2025 18:32:41 +0000 (19:32 +0100)
Turns out that this commit, about 10 years ago:

  9ec23531fd48 ("sched/preempt, mm/fault: Trigger might_sleep() in might_fault() with disabled pagefaults")

... accidentally (and unnessecarily) put the lockdep part of
__might_fault() under CONFIG_DEBUG_ATOMIC_SLEEP=y.

This is potentially notable because large distributions such as
Ubuntu are running with !CONFIG_DEBUG_ATOMIC_SLEEP.

Restore the debug check.

[ mingo: Update changelog. ]

Fixes: 9ec23531fd48 ("sched/preempt, mm/fault: Trigger might_sleep() in might_fault() with disabled pagefaults")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: https://lore.kernel.org/r/20241104135517.536628371@infradead.org
mm/memory.c

index 539c0f7c6d5458791e723ac58e25e5b6b9f73c89..1dfad4536cfefae30bfdb09effd9dee05819e76a 100644 (file)
@@ -6835,10 +6835,8 @@ void __might_fault(const char *file, int line)
        if (pagefault_disabled())
                return;
        __might_sleep(file, line);
-#if defined(CONFIG_DEBUG_ATOMIC_SLEEP)
        if (current->mm)
                might_lock_read(&current->mm->mmap_lock);
-#endif
 }
 EXPORT_SYMBOL(__might_fault);
 #endif