[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ced7a67e-8db9-4422-889e-76ee4958a622@gmail.com>
Date: Fri, 14 Jun 2024 16:02:37 +0100
From: Usama Arif <usamaarif642@...il.com>
To: Andi Kleen <ak@...ux.intel.com>
Cc: akpm@...ux-foundation.org, hannes@...xchg.org, shakeel.butt@...ux.dev,
david@...hat.com, ying.huang@...el.com, hughd@...gle.com,
willy@...radead.org, yosryahmed@...gle.com, nphamcs@...il.com,
chengming.zhou@...ux.dev, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
kernel-team@...a.com
Subject: Re: [PATCH v5 1/2] mm: store zero pages to be swapped out in a bitmap
On 14/06/2024 15:45, Andi Kleen wrote:
> Usama Arif <usamaarif642@...il.com> 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
It is negligible.
For a zero filled page, without zero-fill optimization, the CPU would
have to do page compression in zswap or dispatch write to disk, so this
optimization is just replacing the CPU usage for these tasks with CPU
usage for checking if page is zero-filled. This is the reason why
same-filled optimization was there in zswap. Zswap should focus on
actual compression and this series is just moving the optimization to swap.
For a non-zero filled page, the loop quits the first instance you see
non zero data and checks the last word first, so its likely going to
quite very early on in the loop.
Powered by blists - more mailing lists