]> Gentwo Git Trees - linux/.git/commit
zram: rework recompression loop
authorSergey Senozhatsky <senozhatsky@chromium.org>
Fri, 21 Feb 2025 22:25:40 +0000 (07:25 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 23 Feb 2025 06:25:56 +0000 (22:25 -0800)
commitc84d4e54bf4df15a0ab61d085bade93a4a4cf53a
tree3c534210812747465b6aa894c96b44d4def74412
parentf22a9ccfa99c0f119d4bcba3fcca35c2020618d1
zram: rework recompression loop

This reworks recompression loop handling:

- set a rule that stream-put NULLs the stream pointer If the loop
  returns with a non-NULL stream then it's a successfull recompression,
  otherwise the stream should always be NULL.

- do not count the number of recompressions Mark object as
  incompressible as soon as the algorithm with the highest priority failed
  to compress that object.

- count compression errors as resource usage Even if compression has
  failed, we still need to bump num_recomp_pages counter.

Link: https://lkml.kernel.org/r/20250221222958.2225035-10-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Hillf Danton <hdanton@sina.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Yosry Ahmed <yosry.ahmed@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/zram/zram_drv.c