zram: device management utility needed
From: Sami Kerola
Date: Tue Jul 29 2014 - 19:15:04 EST
Not so long ago Timofey has reached both util-linux and kernel
contributors with intention to make zram device management too. I think
the proposal is good, and there should be distribution independent tool
like that. Also such command fits fairly well to a scope of util-linux
package. But a tool is only as good as kernel support of it is. This
mail is a bit about both.
Existing proposal for zramctl, wrote by Timofey, does what I would
call great starting point. It can resize zram device, select algorithm,
and set number of threads. Unfortunately it cannot create or remove zram
The zram devices are not created by any sort of equipment appearing in a
bus so an method of creating new or removing existing devices will be
needed. When the zram module is loaded it should create
/dev/zram-control device, that responds to ioctl() calls. The calls
could be similar with /dev/loop-control, that allow adding or removing
specified device, and discover adding a free device.
This proposal would not affect the current initialization of the zram
devices. It would be an addition to manage zram devices after kernel
module is loaded, of course each device separately and individually. At
the moment adding a device requires removing the existing devices,
which can mean data loss, and at least unnecessary hassle when performing
a device addition task.
But before getting too exited and asking for ioctl() allocation, or
thinking too much about code, does an overall plan like this make sense?
Is there an alternative that would be better than /dev/zram-control +
ioctl()'s? Any other comments, better proposal, and so on?
Finally, Hats off to Timofey, you got the ball rolling getting the zram
devices being dynamic someday in future.
 such as: modprobe zram num_devices=4
 requires 'rmmod zram' which is not possible if any zram device is busy
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/