Thread (14 messages) 14 messages, 5 authors, 2025-08-07

Re: [RFC PATCH v2] mm/zswap: store <PAGE_SIZE compression failed page as-is

From: SeongJae Park <sj@kernel.org>
Date: 2025-08-05 18:43:13
Also in: linux-mm, lkml

On Tue, 5 Aug 2025 12:47:36 +0200 David Hildenbrand [off-list ref] wrote:
On 05.08.25 02:29, SeongJae Park wrote:
quoted
When zswap writeback is enabled and it fails compressing a given page,
the page is swapped out to the backing swap device.  This behavior
breaks the zswap's writeback LRU order, and hence users can experience
unexpected latency spikes.  If the page is compressed without failure,
but results in a size of PAGE_SIZE, the LRU order is kept, but the
decompression overhead for loading the page back on the later access is
unnecessary.

Keep the LRU order and optimize unnecessary decompression overheads in
the cases, by storing the original content in zpool as-is.
Does this have any effect on the movability of the given page? IOW, does 
page migration etc. still work when we store an ordinary page of an 
shmem/anon folio here?
Thank you for good question.  As Nhat also replied, there is no effect on the
movability.

In more detail, the handling of the given (incompressible) page is nearly same
to compressible pages.  Zswap asks zpool to allocate memory, copy the content
of the page into new newly allocated memory, and let the page be marked as
zswapped out and hence be freed.  Only difference of incompressible pages
handling is that the content is copied into the zpool memory without
compression.  All other properties including movability are same to the case of
compressible pages, so this patch doesn't introduce movability difference.

In the previous version of this patch, I was manually allocating memory without
zpool's help, and hence other people including Nhat kindly enlightened me that
it can introduce migratability difference.  Hence this version uses zpool.

[1] https://lore.kernel.org/761a2899-6fd9-4bfe-aeaf-23bce0baa0f1@redhat.com (local)


Thanks,
SJ

[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help