diff options
author | Sergey Senozhatsky <[email protected]> | 2023-06-14 23:13:12 +0900 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2023-06-19 16:19:33 -0700 |
commit | cb0551adf92dac140d0e0958b4aaa860348bedbb (patch) | |
tree | 0c2969742b04f707b5195b3fcc7b0bdedcaa1b83 | |
parent | 418fd29d9de53b143e28a07430e08dd414b74c3d (diff) |
zram: further limit recompression threshold
Recompression threshold should be below huge-size-class watermark. Any
object larger than huge-size-class is a "huge object" and occupies a
whole physical page on the zsmalloc side, in other words it's
incompressible, as far as zsmalloc is concerned.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Sergey Senozhatsky <[email protected]>
Suggested-by: Brian Geffon <[email protected]>
Acked-by: Brian Geffon <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Sergey Senozhatsky <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r-- | drivers/block/zram/zram_drv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index f6d90f1ba5cf..5d258a28ec43 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1753,7 +1753,7 @@ static ssize_t recompress_store(struct device *dev, } } - if (threshold >= PAGE_SIZE) + if (threshold >= huge_class_size) return -EINVAL; down_read(&zram->init_lock); |