]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm/huge_memory: add pmd folio to ds_queue in do_huge_zero_wp_pmd()
authorWei Yang <richard.weiyang@gmail.com>
Wed, 8 Oct 2025 09:54:52 +0000 (09:54 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:11 +0000 (12:57 +0100)
commitcebbf5d16bb2bd86f90f32e6a912d7730ca0699a
treee008f1ec7b1d05b812d26ecb27167798e5c4ec07
parentd710b4a2c7130627f6ddfefab0ebd3740d96d1e4
mm/huge_memory: add pmd folio to ds_queue in do_huge_zero_wp_pmd()

commit 2a1351cd4176ee1809b0900d386919d03b7652f8 upstream.

We add pmd folio into ds_queue on the first page fault in
__do_huge_pmd_anonymous_page(), so that we can split it in case of memory
pressure.  This should be the same for a pmd folio during wp page fault.

Commit 1ced09e0331f ("mm: allocate THP on hugezeropage wp-fault") miss to
add it to ds_queue, which means system may not reclaim enough memory in
case of memory pressure even the pmd folio is under used.

Move deferred_split_folio() into map_anon_folio_pmd() to make the pmd
folio installation consistent.

Link: https://lkml.kernel.org/r/20251008095453.18772-2-richard.weiyang@gmail.com
Fixes: 1ced09e0331f ("mm: allocate THP on hugezeropage wp-fault")
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Acked-by: Usama Arif <usamaarif642@gmail.com>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/huge_memory.c