tools/testing/selftests/zram/README
Source file repositories/reference/linux-study-clean/tools/testing/selftests/zram/README
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/zram/README- Extension
[no extension]- Size
- 1152 bytes
- Lines
- 40
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
zram: Compressed RAM based block devices
----------------------------------------
* Introduction
The zram module creates RAM based block devices named /dev/zram<id>
(<id> = 0, 1, ...). Pages written to these disks are compressed and stored
in memory itself. These disks allow very fast I/O and compression provides
good amounts of memory savings. Some of the usecases include /tmp storage,
use as swap disks, various caches under /var and maybe many more :)
Statistics for individual zram devices are exported through sysfs nodes at
/sys/block/zram<id>/
Kconfig required:
CONFIG_ZRAM=y
CONFIG_CRYPTO_LZ4=y
CONFIG_ZSMALLOC=y
ZRAM Testcases
--------------
zram_lib.sh: create library with initialization/cleanup functions
zram.sh: For sanity check of CONFIG_ZRAM and to run zram01 and zram02
Two functional tests: zram01 and zram02:
zram01.sh: creates general purpose ram disks with ext4 filesystems
zram02.sh: creates block device for swap
Commands required for testing:
- bc
- dd
- free
- awk
- mkswap
- swapon
- swapoff
- mkfs/ mkfs.ext4
For more information please refer:
kernel-source-tree/Documentation/admin-guide/blockdev/zram.rst
Annotation
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.