Thread (8 messages) 8 messages, 4 authors, 2013-02-19

RE: behavior of zram stats, and zram allocation limit

From: Dan Magenheimer <hidden>
Date: 2012-11-23 16:45:45

From: Minchan Kim [mailto:minchan@kernel.org]
Sent: Thursday, November 22, 2012 10:52 PM
To: Luigi Semenzato
Cc: linux-mm@kvack.org; Dan Magenheimer
Subject: Re: behavior of zram stats, and zram allocation limit

On Wed, Nov 21, 2012 at 02:58:48PM -0800, Luigi Semenzato wrote:
quoted
Hi,

Two questions for zram developers/users.  (Please let me know if it is
NOT acceptable to use this list for these questions.)

1. When I run a synthetic load using zram from kernel 3.4.0,
compr_data_size from /sys/block/zram0 seems to decrease even though
orig_data_size stays constant (see below).  Is this a bug that was
fixed in a later release?  (The synthetic load is a bunch of processes
that allocate memory, fill half of it with data from /dev/urandom, and
touch the memory randomly.)  I looked at the code and it looks right.
:-P

2. Is there a way of setting the max amount of RAM that zram is
allowed to allocate?  Right now I can set the size of the
*uncompressed* swap device, but how much memory gets allocated depends
on the compression ratio, which could vary.
There is no method to limit the RAM size but I think we can implement
it easily. The only thing we need is just a "voice of customer".
Why do you need it?
Hi Minchan --

I am not an expert on zram, but I do recall a conversation
with hughd in 2010 along this line and, after some thought,
he concluded it was far harder than it sounds.  Since
zram appears as a block device, it is not easy to reject
writes.  Zcache circumvents the block I/O system entirely
so "writes" can be managed much more dynamically.

Dan

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help