mm: khugepaged: avoid pointless allocation for "struct mm_slot"
authorXin Hao <xhao@linux.alibaba.com>
Wed, 31 May 2023 09:58:17 +0000 (17:58 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 9 Jun 2023 23:25:51 +0000 (16:25 -0700)
commit16618670276a77480e274117992cec5e42ce66a9
treef9cccd496b940ec7dd06bc118471e2036d208471
parent3b11edf1f2398cac206a224308de6628ebeea924
mm: khugepaged: avoid pointless allocation for "struct mm_slot"

In __khugepaged_enter(), if "mm->flags" with MMF_VM_HUGEPAGE bit is set,
the "mm_slot" will be released and return, so we can call mm_slot_alloc()
after test_and_set_bit().

Link: https://lkml.kernel.org/r/20230531095817.11012-1-xhao@linux.alibaba.com
Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
Reviewed-by: Andrew Morton <akpm@linux-foudation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/khugepaged.c