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

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

diff --git a/mm/vmscan.c b/mm/vmscan.c
index e61e88e63511..0b8a6e0f384c 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1235,7 +1235,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.45.2


Reply via email to