[PATCHv3 10/11] mm/vmscan: Do not demote PG_dropbehind folios

From: Kirill A. Shutemov
Date: Thu Jan 30 2025 - 05:03:21 EST


PG_dropbehind flag indicates that the folio need to be freed immediately.
No point in demoting it.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
---
mm/vmscan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 4bead1ff5cd2..4f86e020759e 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1231,7 +1231,7 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
* Before reclaiming the folio, try to relocate
* its contents to another node.
*/
- if (do_demote_pass &&
+ if (do_demote_pass && !folio_test_dropbehind(folio) &&
(thp_migration_supported() || !folio_test_large(folio))) {
list_add(&folio->lru, &demote_folios);
folio_unlock(folio);
--
2.47.2