File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1652,6 +1652,29 @@ static int migrate_pages_batch(struct list_head *from,
16521652
16531653 cond_resched ();
16541654
1655+ /*
1656+ * The rare folio on the deferred split list should
1657+ * be split now. It should not count as a failure.
1658+ * Only check it without removing it from the list.
1659+ * Since the folio can be on deferred_split_scan()
1660+ * local list and removing it can cause the local list
1661+ * corruption. Folio split process below can handle it
1662+ * with the help of folio_ref_freeze().
1663+ *
1664+ * nr_pages > 2 is needed to avoid checking order-1
1665+ * page cache folios. They exist, in contrast to
1666+ * non-existent order-1 anonymous folios, and do not
1667+ * use _deferred_list.
1668+ */
1669+ if (nr_pages > 2 &&
1670+ !list_empty (& folio -> _deferred_list )) {
1671+ if (try_split_folio (folio , split_folios ) == 0 ) {
1672+ stats -> nr_thp_split += is_thp ;
1673+ stats -> nr_split ++ ;
1674+ continue ;
1675+ }
1676+ }
1677+
16551678 /*
16561679 * Large folio migration might be unsupported or
16571680 * the allocation might be failed so we should retry
You can’t perform that action at this time.
0 commit comments