Re: [PATCH v5 3/4] mm: thp: use folio_batch to handle THP splitting in deferred_split_scan()

From: Qi Zheng

Date: Thu Nov 06 2025 - 21:52:23 EST




On 11/7/25 10:29 AM, Andrew Morton wrote:
On Thu, 6 Nov 2025 14:52:13 +0000 Wei Yang <richard.weiyang@xxxxxxxxx> wrote:

+ if (folio_order(folio) > 1) {
+ if (!list_empty(&folio->_deferred_list)) {
+ ds_queue->split_queue_len--;
+ /*
+ * Reinitialize page_deferred_list after removing the
+ * page from the split_queue, otherwise a subsequent
+ * split will see list corruption when checking the
+ * page_deferred_list.
+ */
+ list_del_init(&folio->_deferred_list);
+ }
if (folio_test_partially_mapped(folio)) {
folio_clear_partially_mapped(folio);
mod_mthp_stat(folio_order(folio),
MTHP_STAT_NR_ANON_PARTIALLY_MAPPED, -1);
}
- /*
- * Reinitialize page_deferred_list after removing the
- * page from the split_queue, otherwise a subsequent
- * split will see list corruption when checking the
- * page_deferred_list.
- */
- list_del_init(&folio->_deferred_list);

@Andrew

Current mm-new looks not merge the code correctly?


It happens. We presently have 29 patches which alter mm/huge_memory.c.

Thanks for checking. I'll drop version 5 of "reparent the THP split queue".

Please check what remains, and send a v6 against tomorrow's
mm-new/mm-unstable.

OK, will rebase and resend it.