diff mbox series

[06/12] shmem: set folio uptodate when reclaim

Message ID 20240515055719.32577-7-da.gomez@samsung.com (mailing list archive)
State Accepted, archived
Headers show
Series [01/12] splice: don't check for uptodate if partially uptodate is impl | expand

Commit Message

Daniel Gomez May 15, 2024, 5:57 a.m. UTC
When reclaiming some space by splitting a large folio through
shmem_unused_huge_shrink(), a large folio is split regardless of its
uptodate status. Mark all the blocks as uptodate in the reclaim path so
split_folio() can release the folio private struct (shmem_folio_state).

Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
 mm/shmem.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/mm/shmem.c b/mm/shmem.c
index 04992010225f..68fe769d91b1 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -842,6 +842,7 @@  static unsigned long shmem_unused_huge_shrink(struct shmem_sb_info *sbinfo,
 			goto move_back;
 		}
 
+		shmem_set_range_uptodate(folio, 0, folio_size(folio));
 		ret = split_folio(folio);
 		folio_unlock(folio);
 		folio_put(folio);