]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm: khugepaged: set to next mm direct when mm has MMF_DISABLE_THP_COMPLETELY
authorVernon Yang <yanglincheng@kylinos.cn>
Sat, 7 Feb 2026 08:16:13 +0000 (16:16 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 5 Apr 2026 20:53:02 +0000 (13:53 -0700)
commit80a4bcac69348e32ccb5ab46401ac2a416fcb576
tree1b1d047c18ec84294def0f76bc65352e38a85634
parent15c578d0dc9952c634f59fcdf9f75be0e42ca834
mm: khugepaged: set to next mm direct when mm has MMF_DISABLE_THP_COMPLETELY

When an mm with the MMF_DISABLE_THP_COMPLETELY flag is detected during
scanning, directly set khugepaged_scan.mm_slot to the next mm_slot, reduce
redundant operation.

Without this patch, entering khugepaged_scan_mm_slot() next time, we will
set khugepaged_scan.mm_slot to the next mm_slot.

With this patch, we will directly set khugepaged_scan.mm_slot to the next
mm_slot.

Link: https://lkml.kernel.org/r/20260207081613.588598-6-vernon2gm@gmail.com
Signed-off-by: Vernon Yang <yanglincheng@kylinos.cn>
Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Reviewed-by: Barry Song <baohua@kernel.org>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Nico Pache <npache@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/khugepaged.c