mm: Always downgrade mmap_lock if requested
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 29 Jun 2023 19:14:14 +0000 (20:14 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 1 Jul 2023 15:10:56 +0000 (08:10 -0700)
commite4bd84c069f212c01258e405f86e91f327888e41
treee58441bf268ac1b4e915567afb01b50f6103bc28
parent03f889378f33aa9a9d8e5f49ba94134cf6158090
mm: Always downgrade mmap_lock if requested

Now that stack growth must always hold the mmap_lock for write, we can
always downgrade the mmap_lock to read and safely unmap pages from the
page table, even if we're next to a stack.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/mmap.c