]> www.infradead.org Git - users/jedix/linux-maple.git/commit
zram: pass estimated src size hint to zstd
authorSergey Senozhatsky <senozhatsky@chromium.org>
Fri, 12 Jul 2024 05:18:20 +0000 (14:18 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 17 Aug 2024 00:52:28 +0000 (17:52 -0700)
commit9fce45b9f146d5df1326cd101b34baa1d2fd1117
tree922a80d11895da084489883096e9b58976fa4584
parentb1be23fa37e6eeeebd591d391a6d569d893b9f7d
zram: pass estimated src size hint to zstd

zram works with PAGE_SIZE buffers, so we always know exact
size of the source buffer and hence can pass estimated_src_size
to zstd_get_params().

This hint on x86_64, for example, reduces the size of the work
memory buffer from 1303520 bytes down to 90080 bytes. Given that
compression streams are per-CPU that's quite some memory saving.

Link: https://lkml.kernel.org/r/20240712051850.484318-10-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/zram/backend_zstd.c