On Tue, 5 Aug 2025 12:47:36 +0200 David Hildenbrand <david@xxxxxxxxxx> wrote: > On 05.08.25 02:29, SeongJae Park wrote: > > 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@xxxxxxxxxx Thanks, SJ [...]