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

From: Andi Kleen
Date: Fri Jun 14 2024 - 10:45:47 EST


Usama Arif <usamaarif642@xxxxxxxxx> writes:

> Approximately 10-20% of pages to be swapped out are zero pages [1].
> Rather than reading/writing these pages to flash resulting
> in increased I/O and flash wear, a bitmap can be used to mark these
> pages as zero at write time, and the pages can be filled at
> read time if the bit corresponding to the page is set.
> With this patch, NVMe writes in Meta server fleet decreased
> by almost 10% with conventional swap setup (zswap disabled).
>
> [1] https://lore.kernel.org/all/20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0@epcms5p1/

But how much did the CPU time increase? Surely the new loop is not free?

-Andi