wap相关概念
zram

内核文档:Documentation/admin-guide/blockdev/zram.rst

    zram: Compressed RAM based block devices
    The zram module creates RAM based block devices named /dev/zram
    ( = 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/

ZRAM是Linux的一种内存优化技术,是把物理内存的一部分划分出来,把不是常用的内存数据压缩后放到zram里, 用到的时候把数据解压出来, 相当于牺牲了一些cpu效率,变相“增大”了内存。

内核配置:

+  CONFIG_ZSMALLOC=y
+  CONFIG_ZRAM=y
+  CONFIG_ZRAM_DEBUG=y

.......

作者: Shell