Discussion:
[linux-mm-cc] Question using compacache(zram) with multi devices
Mike Cao
2010-12-23 06:48:19 UTC
Permalink
Hi, All

I design following 2 scenarios:

Scenario 1:
1.Initialize TWO zram devices with 100MB each.
#zramconfig /dev/zram0 --disksize_kb=102400 ?init
#zramconfig /dev/zram1 --disksize_kb=102400 ?init
2.Activate them as swap
#mkswap /dev/zram0
#mkswap /dev/zram1
#swapon /dev/zram0
#swapon /dev/zram1


Scenario 2:
1.Initialize ONE zram devices with 200MB
#zramconfig /dev/zram0 --disksize_kb=102400 ?init
2.Activate it as swap
#mkswap /dev/zram0
#swapon /dev/zram0


Both of scenarios,I can find 200MB swap new added.then What's the
difference between the two scenarios ,especially for performance
influence?

Hope for you all feekback,thanks!
--
Best Regards!
Mike
John McCabe-Dansted
2010-12-23 07:16:25 UTC
Permalink
Post by Mike Cao
1.Initialize TWO zram devices with 100MB each.
...
Post by Mike Cao
1.Initialize ONE zram devices with 200MB
...
Post by Mike Cao
Both of scenarios,I can find 200MB swap new added.then What's the
difference between the two scenarios ,especially for performance
influence?
Probably not much. I imagine the main difference is that in Scenario 1
you can adjust the amount of compcache more easily as you have the
option of disabling one of the two 100MB swap devices.

Presumably Scenario 1 uses up a little more memory. It may also reduce
lock contention slightly on machines with lots of cores, but I am not
familiar enough with the code to know if that is the case.
--
John C. McCabe-Dansted
Mike Cao
2010-12-23 10:24:15 UTC
Permalink
Post by John McCabe-Dansted
Post by Mike Cao
1.Initialize TWO zram devices with 100MB each.
...
Post by Mike Cao
1.Initialize ONE zram devices with 200MB
...
Post by Mike Cao
Both of scenarios,I can find 200MB swap new added.then What's the
difference between the two scenarios ,especially for performance
influence?
Probably not much. I imagine the main difference is that in Scenario 1
you can adjust the amount of compcache more easily as you have the
option of disabling one of the two 100MB swap devices.
Hi ,I also think so.

Please look at http://code.google.com/p/compcache/wiki/zcacheIOzone ,the
last 2 items in details.
*Separate partitions (all ext4) for: /boot, / and /home. So, three
separate zcache pools
*Each pool with default memlimit: 10% of RAM (memory is allocated
on-demand and is not pre-allocated)

I wonder whether the /dev/zramX means zcache pools ?if it is ,why need
three?
Post by John McCabe-Dansted
Presumably Scenario 1 uses up a little more memory. It may also reduce
lock contention slightly on machines with lots of cores, but I am not
familiar enough with the code to know if that is the case.
--
Best Regards!
Mike
John McCabe-Dansted
2010-12-23 11:07:44 UTC
Permalink
I wonder whether the /dev/zramX means zcache pools?
Mike Cao
2010-12-24 06:48:13 UTC
Permalink
I wonder whether the /dev/zramX means zcache pools?
From the page you linked "zram can be used to provide a compressed
swap, while zcache compresses filesystem cache pages". AFAICT zram and
zcache are two different tools for two different purposes.
I thought they should be the same thing, zcache now called zram.if
not ,how we can make zcache tool ?
if it is ,why need three?
Maybe Zcache needs to have a different pool for each partition it caches?
"Separate partitions (all ext4) for: /boot, / and /home. So, three
separate zcache pools"
--
Best Regards!
Mike
John McCabe-Dansted
2010-12-24 07:05:09 UTC
Permalink
Post by Mike Cao
I wonder whether the /dev/zramX means zcache pools?
From the page you linked "zram can be used to provide a compressed
swap, while zcache compresses filesystem cache pages". AFAICT zram and
zcache are two different tools for two different purposes.
I thought they should be the same thing, zcache now called zram.if
not ,how we can make zcache tool ?
I haven't found instructions on how to use zcache, but the difference
between zram and zcache is discussed here:

http://lwn.net/Articles/397574/
--
John C. McCabe-Dansted
Nitin Gupta
2010-12-24 07:18:25 UTC
Permalink
Post by John McCabe-Dansted
Post by Mike Cao
I wonder whether the /dev/zramX means zcache pools?
From the page you linked "zram can be used to provide a compressed
swap, while zcache compresses filesystem cache pages". AFAICT zram and
zcache are two different tools for two different purposes.
I thought they should be the same thing, zcache now called zram.if
not ,how we can make zcache tool ?
I haven't found instructions on how to use zcache, but the difference
http://lwn.net/Articles/397574/
The article is slightly misleading -- it gives the impression that
zcache was developed to *replace* zram. In fact, zram and zcache are
quite different: zcache compresses filesystem caches only and not
anonymous (heap) pages, OTOH zram compression only anonymous pages and
not pagecache pages.

Currently, there is no easy way to test zcache as cleancache -- which is
zcache's backend -- is not yet in mainline (or even staging).


Nitin

Loading...