Skip to content

Commit 0885ef4

Browse files
Chris Liakpm00
authored andcommitted
mm: vmscan.c: fix OOM on swap stress test
I found a regression on mm-unstable during my swap stress test, using tmpfs to compile linux. The test OOM very soon after the make spawns many cc processes. It bisects down to this change: 33dfe92 (mm/gup: clear the LRU flag of a page before adding to LRU batch) Yu Zhao propose the fix: "I think this is one of the potential side effects -- Huge mentioned earlier about isolate_lru_folios():" I test that with it the swap stress test no longer OOM. Link: https://lore.kernel.org/r/CAOUHufYi9h0kz5uW3LHHS3ZrVwEq-kKp8S6N-MZUmErNAXoXmw@mail.gmail.com/ Link: https://lkml.kernel.org/r/[email protected] Fixes: 33dfe92 ("mm/gup: clear the LRU flag of a page before adding to LRU batch") Signed-off-by: Chris Li <[email protected]> Suggested-by: Yu Zhao <[email protected]> Suggested-by: Hugh Dickins <[email protected]> Closes: https://lore.kernel.org/all/CAF8kJuNP5iTj2p07QgHSGOJsiUfYpJ2f4R1Q5-3BN9JiD9W_KA@mail.gmail.com/ Signed-off-by: Andrew Morton <[email protected]>
1 parent 35fccce commit 0885ef4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/vmscan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4300,7 +4300,7 @@ static bool sort_folio(struct lruvec *lruvec, struct folio *folio, struct scan_c
43004300
}
43014301

43024302
/* ineligible */
4303-
if (zone > sc->reclaim_idx) {
4303+
if (!folio_test_lru(folio) || zone > sc->reclaim_idx) {
43044304
gen = folio_inc_gen(lruvec, folio, false);
43054305
list_move_tail(&folio->lru, &lrugen->folios[gen][type][zone]);
43064306
return true;

0 commit comments

Comments
 (0)