]> git.baikalelectronics.ru Git - kernel.git/commit
mm/mmap: preallocate maple nodes for brk vma expansion
authorLiam Howlett <liam.howlett@oracle.com>
Tue, 11 Oct 2022 16:08:37 +0000 (16:08 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 12 Oct 2022 22:56:46 +0000 (15:56 -0700)
commit080772d076adbcfc416de7f7c6f4eede8a290d49
tree8265bb663ef3fdc17e55234275bda4cc30b3b170
parent4790d8181f1c44616995b261d2b41197fb390394
mm/mmap: preallocate maple nodes for brk vma expansion

If the brk VMA is the last vma in a maple node and meets the rare criteria
that it can be expanded, then preallocation is necessary to avoid a
potential fs_reclaim circular lock issue on low resources.

At the same time use the actual vma start address (unaligned) when calling
vma_adjust_trans_huge().

Link: https://lkml.kernel.org/r/20221011160624.1253454-1-Liam.Howlett@oracle.com
Fixes: 1c981325bd92 (mm/mmap: change do_brk_flags() to expand existing VMA and add do_brk_munmap())
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reported-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/mmap.c