Re: [PATCH 1/2] mm: zswap: use separate compression and decompression requests
From: Usama Arif
Date: Fri Oct 09 2026 - 12:28:22 EST
On 09/10/2026 09:16, Sergey Senozhatsky wrote:
> On (26/10/05 17:22), Usama Arif wrote:
>> Stores and loads serialize on the same per-CPU acomp request and mutex.
>> A low-priority store can be preempted as soon as the compressor drops
>> its stream lock, while it still holds the mutex. A higher-priority load
>> on that CPU then waits until the store runs again, which can take a
>> long time when other tasks are runnable.
>>
>> Give compression and decompression their own request, completion wait
>> and mutex. Since commit e2c3b6b21c77f ("mm: zswap: use SG list
>> decompression APIs from zsmalloc"), the per-CPU buffer is only used for
>> compression. The two requests can share the per-CPU transform: no
>> in-tree implementation modifies transform state while (de)compressing,
>> and shared codec state has its own locking. Loads can still wait for
>> each other on the decompression mutex, and stores still serialize on
>> the compression mutex.
>>
>> This follows the proposal from Sergey Senozhatsky for the same split
>> for zram [1].
>
> Greetings zswap peeps,
Hello!
> We pushed things a little further for even more gains [1]
:)
Thanks for the inital patches!
>
> Catch me if you can ;P
>
> [1] https://lore.kernel.org/all/20261009071157.3730698-12-senozhatsky@xxxxxxxxxxxx
I think it wont help zstd, right? It would help stateless decompressors like
lz4 I think.
We could that as a followup to the series for zswap.