README 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. zram: Compressed RAM based block devices
  2. ----------------------------------------
  3. * Introduction
  4. The zram module creates RAM based block devices named /dev/zram<id>
  5. (<id> = 0, 1, ...). Pages written to these disks are compressed and stored
  6. in memory itself. These disks allow very fast I/O and compression provides
  7. good amounts of memory savings. Some of the usecases include /tmp storage,
  8. use as swap disks, various caches under /var and maybe many more :)
  9. Statistics for individual zram devices are exported through sysfs nodes at
  10. /sys/block/zram<id>/
  11. Kconfig required:
  12. CONFIG_ZRAM=y
  13. CONFIG_CRYPTO_LZ4=y
  14. CONFIG_ZSMALLOC=y
  15. ZRAM Testcases
  16. --------------
  17. zram_lib.sh: create library with initialization/cleanup functions
  18. zram.sh: For sanity check of CONFIG_ZRAM and to run zram01 and zram02
  19. Two functional tests: zram01 and zram02:
  20. zram01.sh: creates general purpose ram disks with ext4 filesystems
  21. zram02.sh: creates block device for swap
  22. Commands required for testing:
  23. - bc
  24. - dd
  25. - free
  26. - awk
  27. - mkswap
  28. - swapon
  29. - swapoff
  30. - mkfs/ mkfs.ext4
  31. For more information please refer:
  32. kernel-source-tree/Documentation/admin-guide/blockdev/zram.rst