6

I have an Marwell Kirkwood ARM-based NAS server Zyxel NSA 310. I compiled my own 3.8 kernel and enabled ZCACHE, but I still see 256 MB of RAM. I am not sure if GNU free utility should show extra amount of RAM. How do I find out it is really working? Do I need to do some extra steps to make use of it? I have added "zcache" to the command line.

root@nas:~# free -m
             total       used       free     shared    buffers     cached
Mem:           247        218         29          0          7        166
-/+ buffers/cache:         43        203
Swap:         1427          0       1427

root@nas:~# zgrep CACHE /proc/config.gz 
CONFIG_CLEANCACHE=y
CONFIG_ZCACHE=y

root@nas:~# dmesg | grep zcache
Kernel command line: console=ttyS0,115200 root=/dev/sda3 zcache
zcache: using lzo compressor
zcache: cleancache enabled using kernel transcendent memory and compression buddies
zcache: cleancache: ignorenonactive = 1
zcache: frontswap enabled using kernel transcendent memory and compression buddies
zcache: frontswap: excl gets = 1 active only = 1
zcache: created ephemeral local tmem pool, id=0
zcache: created persistent local tmem pool, id=1
zcache: created ephemeral local tmem pool, id=2
zcache: created ephemeral local tmem pool, id=3
zcache: created ephemeral local tmem pool, id=4

root@nas:~# cat /proc/cmdline 
console=ttyS0,115200 root=/dev/sda3 zcache

I know it is "merging" pages compressing them, but how to see the compression ratio or something like that.

lzap
  • 2,032
  • 2
  • 14
  • 13

2 Answers2

1

zcache is buried inside the ram and not easily visible with current tools. To see details you need to mount debugfs and look in /sys/kernel/debug/zcache where there are a whole bunch of statistics, more than you could ever want. The frontswap is reported as pers_* (for persistent) and cleancache as eph_* (for ephemeral), although these could include other categories in the future. There are separate directories for cleancache and frontswap stores and loads.

1

The layout seems to have changed a bit in latest git:

# ls cleancache ; ls frontswap ; ls zbud
failed_gets        invalidates             puts                succ_gets
failed_stores      invalidates             loads               succ_stores
eph_buddied_count  eph_evicted_pageframes  eph_zbytes          pers_cumul_zbytes        pers_pageframes         pers_zombie_count
eph_cumul_zbytes   eph_pageframes          eph_zpages          pers_cumul_zpages        pers_unbuddied_count    pers_zpages
eph_cumul_zpages   eph_unbuddied_count     pers_buddied_count  pers_evicted_pageframes  pers_zbytes

# uname -v
#201308150422 SMP Thu Aug 15 08:31:51 UTC 2013
slm
  • 363,520
  • 117
  • 767
  • 871
Ken Sharp
  • 529
  • 1
  • 6
  • 18