On Wed, 14 Aug 2024 17:18:25 +0800 liuye <liuye@xxxxxxxxxx> wrote: > @@ -1669,10 +1670,12 @@ static unsigned long isolate_lru_folios(unsigned long nr_to_scan, > nr_pages = folio_nr_pages(folio); > total_scan += nr_pages; > > - if (folio_zonenum(folio) > sc->reclaim_idx || > - skip_cma(folio, sc)) { > + /* Using max_nr_skipped to prevent hard LOCKUP*/ > + if ((max_nr_skipped < SWAP_CLUSTER_MAX_SKIPPED) && > + (folio_zonenum(folio) > sc->reclaim_idx || skip_cma(folio, sc))) { > nr_skipped[folio_zonenum(folio)] += nr_pages; > move_to = &folios_skipped; > + max_nr_skipped++; > goto move; This hunk is not applicable to current mainline.