Skip to content

Commit 9ba85f5

Browse files
uarif1akpm00
authored andcommitted
mm: do not start/end writeback for pages stored in zswap
Most of the work done in folio_start_writeback is reversed in folio_end_writeback. For e.g. NR_WRITEBACK and NR_ZONE_WRITE_PENDING are incremented in start_writeback and decremented in end_writeback. Calling end_writeback immediately after start_writeback (separated by folio_unlock) cancels the affect of most of the work done in start hence can be removed. There is some extra work done in folio_end_writeback, however it is incorrect/not applicable to zswap: - folio_end_writeback incorrectly increments NR_WRITTEN counter, eventhough the pages aren't written to disk, hence this change corrects this behaviour. - folio_end_writeback calls folio_rotate_reclaimable, but that only makes sense for async writeback pages, while for zswap pages are synchronously reclaimed. Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Usama Arif <[email protected]> Acked-by: Johannes Weiner <[email protected]> Reviewed-by: Shakeel Butt <[email protected]> Acked-by: Yosry Ahmed <[email protected]> Reviewed-by: Chengming Zhou <[email protected]> Suggested-by: Matthew Wilcox (Oracle) <[email protected]> Cc: Nhat Pham <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent ecc1793 commit 9ba85f5

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

mm/page_io.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,7 @@ int swap_writepage(struct page *page, struct writeback_control *wbc)
196196
return ret;
197197
}
198198
if (zswap_store(folio)) {
199-
folio_start_writeback(folio);
200199
folio_unlock(folio);
201-
folio_end_writeback(folio);
202200
return 0;
203201
}
204202
if (!mem_cgroup_zswap_writeback_enabled(folio_memcg(folio))) {

0 commit comments

Comments
 (0)