ArchiveOrangemail archive

Compressed Caching for Linux


linux-mm-cc.lists.laptop.org
(List home) (Recent threads) (86 other One Laptop per Child lists)

Subscription Options

  • RSS or Atom: Read-only subscription using a browser or aggregator. This is the recommended way if you don't need to send messages to the list. You can learn more about feed syndication and clients here.
  • Conventional: All messages are delivered to your mail address, and you can reply. To subscribe, send an email to the list's subscribe address with "subscribe" in the subject line, or visit the list's homepage here.
  • Low traffic list: less than 3 messages per day
  • This list contains about 551 messages, beginning Jun 2006
  • 0 messages added yesterday
Report the Spam
This button sends a spam report to the moderator. Please use it sparingly. For other removal requests, read this.
Are you sure? yes no

Question using compacache(zram) with multi devices

Ad
Mike Cao 1293086915Thu, 23 Dec 2010 06:48:35 +0000 (UTC)
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 1293088620Thu, 23 Dec 2010 07:17:00 +0000 (UTC)
On Thu, Dec 23, 2010 at 2:48 PM, Mike Cao  wrote:
> Scenario 1:
> 1.Initialize TWO zram devices with 100MB each....> Scenario 2:
> 1.Initialize ONE zram devices with 200MB...> 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 1293099870Thu, 23 Dec 2010 10:24:30 +0000 (UTC)
On Thu, 2010-12-23 at 15:16 +0800, John McCabe-Dansted wrote:
> On Thu, Dec 23, 2010 at 2:48 PM, Mike Cao  wrote:
> > Scenario 1:
> > 1.Initialize TWO zram devices with 100MB each.
> ...
> > Scenario 2:
> > 1.Initialize ONE zram devices with 200MB
> ...
> > 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/zcach... ,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?> 
> 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 1293102491Thu, 23 Dec 2010 11:08:11 +0000 (UTC)
On Thu, Dec 23, 2010 at 6:24 PM, Mike Cao  wrote:
> 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.

> 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"-- 
John C. McCabe-Dansted
Mike Cao 1293173312Fri, 24 Dec 2010 06:48:32 +0000 (UTC)
On Thu, 2010-12-23 at 19:07 +0800, John McCabe-Dansted wrote:
> On Thu, Dec 23, 2010 at 6:24 PM, Mike Cao  wrote:
> > 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 1293174337Fri, 24 Dec 2010 07:05:37 +0000 (UTC)
On Fri, Dec 24, 2010 at 2:48 PM, Mike Cao  wrote:
> On Thu, 2010-12-23 at 19:07 +0800, John McCabe-Dansted wrote:
>> On Thu, Dec 23, 2010 at 6:24 PM, Mike Cao  wrote:
>> > 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 1293175089Fri, 24 Dec 2010 07:18:09 +0000 (UTC)
On 12/24/2010 02:05 AM, John McCabe-Dansted wrote:
> On Fri, Dec 24, 2010 at 2:48 PM, Mike Cao<bcao@redhat.com>  wrote:
>> On Thu, 2010-12-23 at 19:07 +0800, John McCabe-Dansted wrote:
>>> On Thu, Dec 23, 2010 at 6:24 PM, Mike Cao<bcao@redhat.com>  wrote:
>>>> 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/
>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
Home | About | Privacy