Re: [PATCH] mm: Do not start/end writeback for pages stored in zswap

From: Chengming Zhou
Date: Tue Jun 11 2024 - 05:53:36 EST


On 2024/6/10 22:30, Usama Arif wrote:
> start/end writeback combination incorrectly increments NR_WRITTEN
> counter, eventhough the pages aren't written to disk. Pages successfully
> stored in zswap should just unlock folio and return from writepage.
>
> Signed-off-by: Usama Arif <usamaarif642@xxxxxxxxx>

Looks good to me, thanks.

Reviewed-by: Chengming Zhou <chengming.zhou@xxxxxxxxx>

> ---
> mm/page_io.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/mm/page_io.c b/mm/page_io.c
> index a360857cf75d..501784d79977 100644
> --- a/mm/page_io.c
> +++ b/mm/page_io.c
> @@ -196,9 +196,7 @@ int swap_writepage(struct page *page, struct writeback_control *wbc)
> return ret;
> }
> if (zswap_store(folio)) {
> - folio_start_writeback(folio);
> folio_unlock(folio);
> - folio_end_writeback(folio);
> return 0;
> }
> if (!mem_cgroup_zswap_writeback_enabled(folio_memcg(folio))) {