Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer

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
share|improve this answer
    
Ken, if you could can you break up the output from those 3 commands so that it's more clear which files are coming from where? –  slm Aug 18 '13 at 14:22
    
I could but there's no need. It's not important. –  Ken Sharp Aug 22 '13 at 21:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.