Message ID | 20250120092604.3590285-1-zhaoyang.huang@unisoc.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm: gup: fix infinite loop within __get_longterm_locked | expand |
diff --git a/mm/gup.c b/mm/gup.c index 3b75e631f369..2231ce7221f9 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -2341,8 +2341,6 @@ static unsigned long collect_longterm_unpinnable_folios( if (folio_is_longterm_pinnable(folio)) continue; - collected++; - if (folio_is_device_coherent(folio)) continue; @@ -2359,6 +2357,8 @@ static unsigned long collect_longterm_unpinnable_folios( if (!folio_isolate_lru(folio)) continue; + collected++; + list_add_tail(&folio->lru, movable_folio_list); node_stat_mod_folio(folio, NR_ISOLATED_ANON + folio_is_file_lru(folio),