On 10/06/2024 15:06, Matthew Wilcox wrote:
On Mon, Jun 10, 2024 at 02:56:09PM +0100, Usama Arif wrote:
I am guessing what you are suggesting is just do this?
if (is_folio_zero_filled(folio)) {
swap_zeromap_folio_set(folio);
folio_unlock(folio);
return 0;
}
Right.
Thanks! Will change to this in the next revision.
If we have zswap enabled, the zero filled pages (infact any page that is
compressed), will be saved in zswap_entry and NR_WRITTEN will be wrongly
incremented. So the behaviour for NR_WRITTEN does not change in this patch
when encountering zero pages with zswap enabled (even if its wrong).
We should fiz zswap too.
Will send the below diff as a separate patch for zswap:
diff --git a/mm/page_io.c b/mm/page_io.c index
2cac1e11fb85..82796b9f08c7 100644 --- a/mm/page_io.c +++ b/mm/page_io.c
@@ -281,9 +281,7 @@ int swap_writepage(struct page *page, struct
writeback_control *wbc) } swap_zeromap_folio_clear(folio); if
(zswap_store(folio)) { - folio_start_writeback(folio);
folio_unlock(folio); - folio_end_writeback(folio); return 0; }