All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Johannes Weiner <hannes@cmpxchg.org>,
	Yosry Ahmed <yosryahmed@google.com>,
	Nhat Pham <nphamcs@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Chengming Zhou <chengming.zhou@linux.dev>,
	Huacai Chen <chenhuacai@kernel.org>,
	Minchan Kim <minchan@kernel.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	<linux-mm@kvack.org>, <linux-block@vger.kernel.org>,
	Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: [PATCH 3/5] zram: support deflate compressor
Date: Fri, 23 Feb 2024 11:55:46 +0800	[thread overview]
Message-ID: <20240223035548.2591882-4-wangkefeng.wang@huawei.com> (raw)
In-Reply-To: <20240223035548.2591882-1-wangkefeng.wang@huawei.com>

Add deflate compressor support, also it is prepare for unifying the
default compressor compressor for zram and zswap.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 drivers/block/zram/Kconfig | 7 ++++++-
 drivers/block/zram/zcomp.c | 3 +++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/block/zram/Kconfig b/drivers/block/zram/Kconfig
index 0cee425da0f5..b007dda16430 100644
--- a/drivers/block/zram/Kconfig
+++ b/drivers/block/zram/Kconfig
@@ -2,7 +2,7 @@
 config ZRAM
 	tristate "Compressed RAM block device support"
 	depends on SWAP && SYSFS
-	depends on CRYPTO_LZO || CRYPTO_ZSTD || CRYPTO_LZ4 || CRYPTO_LZ4HC || CRYPTO_842
+	depends on CRYPTO_LZO || CRYPTO_ZSTD || CRYPTO_LZ4 || CRYPTO_LZ4HC || CRYPTO_842 || CRYPTO_DEFLATE
 	select ZSMALLOC
 	help
 	  Creates virtual block devices called /dev/zramX (X = 0, 1, ...).
@@ -20,6 +20,10 @@ choice
 	default ZRAM_DEF_COMP_LZORLE
 	depends on ZRAM
 
+config ZRAM_DEF_COMP_DEFLATE
+	bool "Deflate"
+	depends on CRYPTO_DEFLATE
+
 config ZRAM_DEF_COMP_LZORLE
 	bool "lzo-rle"
 	depends on CRYPTO_LZO
@@ -48,6 +52,7 @@ endchoice
 
 config ZRAM_DEF_COMP
 	string
+	default "deflate" if ZRAM_DEF_COMP_DEFLATE
 	default "lzo-rle" if ZRAM_DEF_COMP_LZORLE
 	default "zstd" if ZRAM_DEF_COMP_ZSTD
 	default "lz4" if ZRAM_DEF_COMP_LZ4
diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c
index 8237b08c49d8..1f9a431f771e 100644
--- a/drivers/block/zram/zcomp.c
+++ b/drivers/block/zram/zcomp.c
@@ -16,6 +16,9 @@
 #include "zcomp.h"
 
 static const char * const backends[] = {
+#if IS_ENABLED(CONFIG_CRYPTO_DEFLATE)
+	"deflate",
+#endif
 #if IS_ENABLED(CONFIG_CRYPTO_LZO)
 	"lzo",
 	"lzo-rle",
-- 
2.27.0


  parent reply	other threads:[~2024-02-23  3:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23  3:55 [PATCH 0/5] mm: unify default compressor algorithm for zram/zswap Kefeng Wang
2024-02-23  3:55 ` [PATCH 1/5] zram: zcomp: remove zcomp_set_max_streams() declaration Kefeng Wang
2024-02-23  3:55 ` [PATCH 2/5] zram: make zram depends on SWAP Kefeng Wang
2024-02-23  4:39   ` Sergey Senozhatsky
2024-02-23  3:55 ` Kefeng Wang [this message]
2024-02-23  3:55 ` [PATCH 4/5] mm: zswap: default to lzo-rle instead of lzo Kefeng Wang
2024-02-23  3:55 ` [PATCH 5/5] mm: unify default compressor algorithm for zswap and zram Kefeng Wang
2024-02-23  4:46 ` [PATCH 0/5] mm: unify default compressor algorithm for zram/zswap Yosry Ahmed
2024-02-23  6:43   ` Kefeng Wang
2024-02-23  4:51 ` Sergey Senozhatsky
2024-02-23  6:45   ` Kefeng Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240223035548.2591882-4-wangkefeng.wang@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=chengming.zhou@linux.dev \
    --cc=chenhuacai@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=nphamcs@gmail.com \
    --cc=senozhatsky@chromium.org \
    --cc=yosryahmed@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.