LKML Archive on
 help / color / Atom feed
From: Minchan Kim <>
To: Andrew Morton <>
Cc:, Juneho Choi <>,
	Sergey Senozhatsky <>,
	kernel-team <>,
	Minchan Kim <>
Subject: [PATCH v1 9/9] zram: add config and doc file for writeback feature
Date: Mon, 26 Jun 2017 15:53:07 +0900
Message-ID: <> (raw)
In-Reply-To: <>

This patch adds document and kconfig for using of writeback feature.

Signed-off-by: Minchan Kim <>
 Documentation/ABI/testing/sysfs-block-zram |  8 ++++++++
 Documentation/blockdev/zram.txt            | 11 +++++++++++
 drivers/block/zram/Kconfig                 | 12 ++++++++++++
 3 files changed, 31 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-block-zram b/Documentation/ABI/testing/sysfs-block-zram
index 451b6d8..c1513c7 100644
--- a/Documentation/ABI/testing/sysfs-block-zram
+++ b/Documentation/ABI/testing/sysfs-block-zram
@@ -90,3 +90,11 @@ Contact:	Sergey Senozhatsky <>
 		device's debugging info useful for kernel developers. Its
 		format is not documented intentionally and may change
 		anytime without any notice.
+What:		/sys/block/zram<id>/backing_dev
+Date:		June 2017
+Contact:	Minchan Kim <>
+		The backing_dev file is read-write and set up backing
+		device for zram to write incompressible pages.
+		For using, user should enable CONFIG_ZRAM_WRITEBACK.
diff --git a/Documentation/blockdev/zram.txt b/Documentation/blockdev/zram.txt
index 4fced8a..257e657 100644
--- a/Documentation/blockdev/zram.txt
+++ b/Documentation/blockdev/zram.txt
@@ -168,6 +168,7 @@ max_comp_streams  RW    the number of possible concurrent compress operations
 comp_algorithm    RW    show and change the compression algorithm
 compact           WO    trigger memory compaction
 debug_stat        RO    this file is used for zram debugging purposes
+backing_dev	  RW	set up backend storage for zram to write out
 User space is advised to use the following files to read the device statistics.
@@ -231,5 +232,15 @@ The stat file represents device's mm statistics. It consists of a single
 	resets the disksize to zero. You must set the disksize again
 	before reusing the device.
+* Optional Feature
+= writeback
+With incompressible pages, there is no memory saving with zram.
+Instead, with CONFIG_ZRAM_WRITEBACK, zram can write incompressible page
+to backing storage rather than keeping it in memory.
+User should set up backing device via /sys/block/zramX/backing_dev
+before disksize setting.
 Nitin Gupta
diff --git a/drivers/block/zram/Kconfig b/drivers/block/zram/Kconfig
index b8ecba6..7cd4a8e 100644
--- a/drivers/block/zram/Kconfig
+++ b/drivers/block/zram/Kconfig
@@ -13,3 +13,15 @@ config ZRAM
 	  disks and maybe many more.
 	  See zram.txt for more information.
+       bool "Write back incompressible page to backing device"
+       depends on ZRAM
+       default n
+       help
+	 With incompressible page, there is no memory saving to keep it
+	 in memory. Instead, write it out to backing device.
+	 For this feature, admin should set up backing device via
+	 /sys/block/zramX/backing_dev.
+	 See zram.txt for more infomration.

  parent reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26  6:52 [PATCH v1 0/7] writeback incompressible pages to storage Minchan Kim
2017-06-26  6:52 ` [PATCH v1 1/9] zram: clean up duplicated codes in __zram_bvec_write Minchan Kim
2017-06-26  6:53 ` [PATCH v1 2/9] zram: inlining zram_compress Minchan Kim
2017-06-26  6:53 ` [PATCH v1 3/9] zram: rename zram_decompress_page with __zram_bvec_read Minchan Kim
2017-06-26  6:53 ` [PATCH v1 4/9] zram: add interface to specify backing device Minchan Kim
2017-06-26  6:53 ` [PATCH v1 5/9] zram: add free space management in " Minchan Kim
2017-06-26  6:53 ` [PATCH v1 6/9] zram: identify asynchronous IO's return value Minchan Kim
2017-06-26  6:53 ` [PATCH v1 7/9] zram: write incompressible pages to backing device Minchan Kim
2017-06-26  6:53 ` [PATCH v1 8/9] zram: read page from " Minchan Kim
2017-06-26  6:53 ` Minchan Kim [this message]
2017-06-28 15:41 ` [PATCH v1 0/7] writeback incompressible pages to storage Sergey Senozhatsky
2017-06-29  8:47   ` Minchan Kim
2017-06-29  9:17     ` Sergey Senozhatsky
2017-06-29  9:29       ` Minchan Kim

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:

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

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git
	git clone --mirror lkml/git/9.git
	git clone --mirror lkml/git/10.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone