Re: [PATCH v3 1/2] mm: store zero pages to be swapped out in a bitmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 10/06/2024 15:14, Usama Arif wrote:

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; }


My mail client seems to have messed up the diff, but have sent the patch here (https://lore.kernel.org/all/20240610143037.812955-1-usamaarif642@xxxxxxxxx/). Tested with test_zswap kselftest.





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux