18c2ecf20Sopenharmony_cizram: Compressed RAM based block devices
28c2ecf20Sopenharmony_ci----------------------------------------
38c2ecf20Sopenharmony_ci* Introduction
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ciThe zram module creates RAM based block devices named /dev/zram<id>
68c2ecf20Sopenharmony_ci(<id> = 0, 1, ...). Pages written to these disks are compressed and stored
78c2ecf20Sopenharmony_ciin memory itself. These disks allow very fast I/O and compression provides
88c2ecf20Sopenharmony_cigood amounts of memory savings. Some of the usecases include /tmp storage,
98c2ecf20Sopenharmony_ciuse as swap disks, various caches under /var and maybe many more :)
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ciStatistics for individual zram devices are exported through sysfs nodes at
128c2ecf20Sopenharmony_ci/sys/block/zram<id>/
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ciKconfig required:
158c2ecf20Sopenharmony_ciCONFIG_ZRAM=y
168c2ecf20Sopenharmony_ciCONFIG_CRYPTO_LZ4=y
178c2ecf20Sopenharmony_ciCONFIG_ZPOOL=y
188c2ecf20Sopenharmony_ciCONFIG_ZSMALLOC=y
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ciZRAM Testcases
218c2ecf20Sopenharmony_ci--------------
228c2ecf20Sopenharmony_cizram_lib.sh: create library with initialization/cleanup functions
238c2ecf20Sopenharmony_cizram.sh: For sanity check of CONFIG_ZRAM and to run zram01 and zram02
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ciTwo functional tests: zram01 and zram02:
268c2ecf20Sopenharmony_cizram01.sh: creates general purpose ram disks with ext4 filesystems
278c2ecf20Sopenharmony_cizram02.sh: creates block device for swap
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ciCommands required for testing:
308c2ecf20Sopenharmony_ci - bc
318c2ecf20Sopenharmony_ci - dd
328c2ecf20Sopenharmony_ci - free
338c2ecf20Sopenharmony_ci - awk
348c2ecf20Sopenharmony_ci - mkswap
358c2ecf20Sopenharmony_ci - swapon
368c2ecf20Sopenharmony_ci - swapoff
378c2ecf20Sopenharmony_ci - mkfs/ mkfs.ext4
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ciFor more information please refer:
408c2ecf20Sopenharmony_cikernel-source-tree/Documentation/admin-guide/blockdev/zram.rst
41