lkml.org 
[lkml]   [2010]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 01/10] Replace ioctls with sysfs interface
From
Date
On Mon, 2010-08-09 at 22:56 +0530, Nitin Gupta wrote:
> Creates per-device sysfs nodes in /sys/block/zram<id>/
> Currently following stats are exported:
> - disksize
> - num_reads
> - num_writes
> - invalid_io
> - zero_pages
> - orig_data_size
> - compr_data_size
> - mem_used_total
>
> By default, disksize is set to 0. So, to start using
> a zram device, fist write a disksize value and then
> initialize device by writing any positive value to
> initstate. For example:
>
> # initialize /dev/zram0 with 50MB disksize
> echo 50*1024*1024 | bc > /sys/block/zram0/disksize
> echo 1 > /sys/block/zram0/initstate
>
> When done using a disk, issue reset to free its memory
> by writing any positive value to reset node:
>
> echo 1 > /sys/block/zram0/reset

Maybe I'm just a weirdo, but I don't really use modules much. That
effectively means that I'm stuck at boot with one zram device.

Making it a read-only module param also means that someone can't add a
second at runtime while the first is still in use.

It doesn't seem to be used very pervasively, but there is a
module_param_cb() function so you can register callbacks when the param
gets updated. Might come in handy for this.

-- Dave



\
 
 \ /
  Last update: 2010-09-01 01:09    [W:0.437 / U:0.504 seconds]
©2003-2014 Jasper Spaans. Advertise on this site