public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Karel Zak <kzak@redhat.com>
Cc: Minchan Kim <minchan@kernel.org>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	linux-kernel@vger.kernel.org, util-linux@vger.kernel.org
Subject: what's cooking in zram for 4.2
Date: Thu, 13 Aug 2015 09:58:12 +0900	[thread overview]
Message-ID: <20150813005812.GA17958@swordfish> (raw)

Hello Karel,

... planned to write this earlier.


zram will see some user-space visible improvements in 4.2 we'd love
to let you know about -- on-demand device creation/removal.

For that purpose we introduce zram control sysfs class, which has two
sysfs attrs:
 - hot_add      -- add a new zram device
 - hot_remove   -- remove a specific (device_id) zram device


-- hot_add sysfs attr is read-only and has only automatic device id
assignment mode.  Read operation performed on this attr creates a
new zram device and returns back its device_id (or error (ret < 0)).

Usage example:
  # add a new zram device
  cat /sys/class/zram-control/hot_add
  2

an example of returning error code (-ENOMEM in this case)

  cat /sys/class/zram-control/hot_add
  cat: /sys/class/zram-control/hot_add: Cannot allocate memory



-- hot_remove is write only and requires a valid zram device_id as
its input parameter:

  # remove a specific zram device
  echo 4 > /sys/class/zram-control/hot_remove


	-ss

                 reply	other threads:[~2015-08-13  0:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150813005812.GA17958@swordfish \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=kzak@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox