1
min 2013-10-30 13:28:02 +08:00
"I started using the zswap.enabled=1 kernel parameter and noticed a big improvement when waking up from hibernation on my Thinkpad X200 with 8GB RAM. The resuming process is much faster now."
|
2
wjchen 2013-10-30 13:31:13 +08:00
zram才是内存压缩,这个貌似试压缩swap。
|
3
hcw1588 2013-10-30 13:39:43 +08:00
只想问ubuntu支持没。。。
|
4
likuku 2013-10-30 13:47:30 +08:00
@hcw1588
/boot$ grep -i "zswap" config-3.11.0-12-generic CONFIG_ZSWAP=y /boot$ uname -a Linux x230-kuku 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:12:00 UTC 2013 i686 i686 i686 GNU/Linux /boot$ cat /etc/issue Ubuntu 13.10 \n \l |
5
est 2013-10-30 14:18:28 +08:00 1
就是内存IO前面加个LZO http://lwn.net/Articles/545244/ 其实lz4还要猛点 http://code.google.com/p/lz4/
|
6
BOYPT 2013-10-30 14:46:12 +08:00 1
嗯,休眠恢复非常快,转眼就打开到输入密码界面了。
|
7
guangwong 2013-10-30 14:50:18 +08:00
这个好啊。。。喜闻乐见
|
8
guangwong 2013-10-30 14:58:13 +08:00
这个在移动设备上有相关的报告么。
|
10
ivenvd 2013-10-30 16:16:50 +08:00 1
zram 才是内存压缩,都用了好几年了……
|
11
oldcai 2013-10-30 18:43:22 +08:00
@est 试了一下,
source len: 694794 zipped len: 143015 lz4ed len: 246743 zip ratio: 4.85818970038 lz4 ratio: 1.72529454952 ratio zip/lz4: 2.8158610376 zip time: 0.0320677757263 lz4 time: 0.00188302993774 time zip/lz4: 17.0298809825 https://gist.github.com/oldcai/7230548 |
12
est 2013-10-30 18:51:39 +08:00
@oldcai LZ4 不是比压缩尺寸,而是比压缩/解压效率。基本上这货的解压效率超过了计算机总线带宽和内存IO带宽。。。。所以你memcpy之类的操作可以认为用了lz4是无损的。
|
13
oldcai 2013-10-30 18:57:55 +08:00
@est 恩,是的,别误会,我也觉得lz4是极好的,也比较了一下时间~
只是贴个数据提供下参考,刚那个结果贴错了~ test a million repeated characters: source len: 1000000 zipped len: 992 lz4ed len: 3936 zip ratio: 1008.06451613 lz4 ratio: 254.06504065 ratio zip/lz4: 3.96774193548 zip time: 0.00992608070374 lz4 time: 0.000288963317871 time zip/lz4: 34.350660066 ------------------------------ test in real world: source len: 574703 zipped len: 133373 lz4ed len: 194073 zip ratio: 4.3089905753 lz4 ratio: 2.96127230475 ratio zip/lz4: 1.45511460341 zip time: 0.023008108139 lz4 time: 0.00155091285706 time zip/lz4: 14.8352036895 |
15
oldcai 2013-10-30 20:10:05 +08:00
@est
zip processing speed: 25.3951494393 MByte/s lz4 processing speed: 353.97936239 MByte/s processing speed lz4/zip: 13.9388572309 zip saving space speed: 19.4990332026 MByte/s lz4 saving space speed: 234.369320807 MByte/s saving space speed lz4/zip: 12.0195354494 恩,补充了一下。 节约CPU或者需要高速压缩的时候,用lz4就比较合适了。 |
16
min 2013-10-30 23:23:07 +08:00
lz4一般能跑3-500mb/s,和ssd的速度差不多
ZFS已经可以支持用lz4算法实时压缩了,家用基本感觉不到lz4的存在 |
17
ShiningRay OP @wjchen http://lwn.net/Articles/563914/ 看到有个帖子说zram合并到zswap了,没太理解
|
18
ShiningRay OP @wjchen 翻了一下内核的提交日志,原来zram之前叫ramzswap,真奇怪啊
|