162306a36Sopenharmony_cizram: Compressed RAM based block devices 262306a36Sopenharmony_ci---------------------------------------- 362306a36Sopenharmony_ci* Introduction 462306a36Sopenharmony_ci 562306a36Sopenharmony_ciThe zram module creates RAM based block devices named /dev/zram<id> 662306a36Sopenharmony_ci(<id> = 0, 1, ...). Pages written to these disks are compressed and stored 762306a36Sopenharmony_ciin memory itself. These disks allow very fast I/O and compression provides 862306a36Sopenharmony_cigood amounts of memory savings. Some of the usecases include /tmp storage, 962306a36Sopenharmony_ciuse as swap disks, various caches under /var and maybe many more :) 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ciStatistics for individual zram devices are exported through sysfs nodes at 1262306a36Sopenharmony_ci/sys/block/zram<id>/ 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ciKconfig required: 1562306a36Sopenharmony_ciCONFIG_ZRAM=y 1662306a36Sopenharmony_ciCONFIG_CRYPTO_LZ4=y 1762306a36Sopenharmony_ciCONFIG_ZPOOL=y 1862306a36Sopenharmony_ciCONFIG_ZSMALLOC=y 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ciZRAM Testcases 2162306a36Sopenharmony_ci-------------- 2262306a36Sopenharmony_cizram_lib.sh: create library with initialization/cleanup functions 2362306a36Sopenharmony_cizram.sh: For sanity check of CONFIG_ZRAM and to run zram01 and zram02 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ciTwo functional tests: zram01 and zram02: 2662306a36Sopenharmony_cizram01.sh: creates general purpose ram disks with ext4 filesystems 2762306a36Sopenharmony_cizram02.sh: creates block device for swap 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ciCommands required for testing: 3062306a36Sopenharmony_ci - bc 3162306a36Sopenharmony_ci - dd 3262306a36Sopenharmony_ci - free 3362306a36Sopenharmony_ci - awk 3462306a36Sopenharmony_ci - mkswap 3562306a36Sopenharmony_ci - swapon 3662306a36Sopenharmony_ci - swapoff 3762306a36Sopenharmony_ci - mkfs/ mkfs.ext4 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_ciFor more information please refer: 4062306a36Sopenharmony_cikernel-source-tree/Documentation/admin-guide/blockdev/zram.rst 41