^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) # SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) config ZRAM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) tristate "Compressed RAM block device support"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) depends on BLOCK && SYSFS && ZSMALLOC && CRYPTO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) select CRYPTO_LZO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) Creates virtual block devices called /dev/zramX (X = 0, 1, ...).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) Pages written to these disks are compressed and stored in memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) itself. These disks allow very fast I/O and compression provides
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) good amounts of memory savings.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) It has several use cases, for example: /tmp storage, use as swap
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) disks and maybe many more.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) See Documentation/admin-guide/blockdev/zram.rst for more information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) config ZRAM_WRITEBACK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) bool "Write back incompressible or idle page to backing device"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) depends on ZRAM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) With incompressible page, there is no memory saving to keep it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) in memory. Instead, write it out to backing device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) For this feature, admin should set up backing device via
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) /sys/block/zramX/backing_dev.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) With /sys/block/zramX/{idle,writeback}, application could ask
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) idle page's writeback to the backing device to save in memory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) See Documentation/admin-guide/blockdev/zram.rst for more information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) config ZRAM_MEMORY_TRACKING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) bool "Track zRam block status"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) depends on ZRAM && DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) With this feature, admin can track the state of allocated blocks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) of zRAM. Admin could see the information via
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) /sys/kernel/debug/zram/zramX/block_state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) See Documentation/admin-guide/blockdev/zram.rst for more information.