[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d4c33502-d8f9-4ce8-97a0-59850dc9ca8b@linux.alibaba.com>
Date: Mon, 6 Jan 2025 12:59:09 +0800
From: Baolin Wang <baolin.wang@...ux.alibaba.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: akpm@...ux-foundation.org, hughd@...gle.com, david@...hat.com,
wangkefeng.wang@...wei.com, kasong@...cent.com,
ying.huang@...ux.alibaba.com, 21cnbao@...il.com, ryan.roberts@....com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] mm: shmem: skip swapcache for swapin of synchronous
swap device
On 2025/1/6 12:07, Matthew Wilcox wrote:
> On Mon, Jan 06, 2025 at 11:46:04AM +0800, Baolin Wang wrote:
>> On 2025/1/2 21:10, Matthew Wilcox wrote:
>>> On Thu, Jan 02, 2025 at 04:40:17PM +0800, Baolin Wang wrote:
>>>> With fast swap devices (such as zram), swapin latency is crucial to applications.
>>>> For shmem swapin, similar to anonymous memory swapin, we can skip the swapcache
>>>> operation to improve swapin latency.
>>>
>>> OK, but now we have more complexity. Why can't we always skip the
>>> swapcache on swapin?
>>
>> Skipping swapcache is used to swap-in shmem large folios, avoiding the large
>> folios being split. Meanwhile, since the IO latency of syncing swap devices
>> is relatively small, it won't cause the IO latency amplification issue.
>>
>> But for async swap devices, if we swap-in the large folio one-time, I am
>> afraid the IO latency can be amplified. And I remember we still haven't
>> reached an agreement here[1], so let's step by step and start with the sync
>> swap devices first.
>
> Regardless of whether we choose to swap-in an order-0 or a large folio,
> my point is that we should always do it to the pagecache rather than the
> swap cache.
IMO, this would miss the swap readahead algorithm in the swap case,
which can benefit the order-0 swap-in. We need more work to ensure that
skipping swapcache is helpful for all cases, which is why I'm starting
with sync swap devices first.
Powered by blists - more mailing lists