All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv3 0/8] introduce dynamic device creation/removal
@ 2015-03-03 12:49 Sergey Senozhatsky
  2015-03-03 12:49 ` [PATCH 1/8] zram: cosmetic ZRAM_ATTR_RO code formatting tweak Sergey Senozhatsky
                   ` (8 more replies)
  0 siblings, 9 replies; 27+ messages in thread
From: Sergey Senozhatsky @ 2015-03-03 12:49 UTC (permalink / raw)
  To: Andrew Morton, Minchan Kim
  Cc: Nitin Gupta, linux-kernel, Sergey Senozhatsky, Sergey Senozhatsky

Hello,

This patchset introduces zram-control sysfs class, which has two sysfs
attrs:
 - zram_add     -- add a new specific (device_id) zram device
 - zram_remove  -- remove a specific (device_id) zram device


    Usage example:
        # add a new specific zram device
        echo 4 > /sys/class/zram-control/zram_add

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


Patch set also does some cleanups and huge code reorganization.

v3:
-- add missing add/remove documentation
-- add patch 0008
-- pair class register with unregister, not class destroy function
-- do not leak class on register_blkdev() error
-- fix kernel version typo (should be 4.1) in documentation

v2:
-- switch to sysfs class, rather than using /dev/zram-control node and
doing IOCTL on it. we lose some features, though. like automatic
device_id generation.


Sergey Senozhatsky (8):
  zram: cosmetic ZRAM_ATTR_RO code formatting tweak
  zram: use idr instead of `zram_devices' array
  zram: factor out device reset from reset_store()
  zram: reorganize code layout
  zram: add dynamic device add/remove functionality
  zram: remove max_num_devices limitation
  zram: report every added and removed device
  zram: trivial: correct flag operations comment

 Documentation/ABI/testing/sysfs-class-zram |  23 +
 Documentation/blockdev/zram.txt            |  21 +-
 drivers/block/zram/zram_drv.c              | 795 +++++++++++++++++------------
 drivers/block/zram/zram_drv.h              |   6 -
 4 files changed, 499 insertions(+), 346 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-class-zram

-- 
2.3.1.167.g7f4ba4b


^ permalink raw reply	[flat|nested] 27+ messages in thread
* [PATCH 0/8] introduce dynamic device creation/removal
@ 2015-02-26 14:10 Sergey Senozhatsky
  2015-02-26 14:10 ` [PATCH 3/8] zram: factor out device reset from reset_store() Sergey Senozhatsky
  0 siblings, 1 reply; 27+ messages in thread
From: Sergey Senozhatsky @ 2015-02-26 14:10 UTC (permalink / raw)
  To: Andrew Morton, Minchan Kim
  Cc: Jerome Marchand, Nitin Gupta, Sergey Senozhatsky, linux-kernel,
	Sergey Senozhatsky

Hello,

this patchset introduces dynamic (on demand) zram device add-remove
functionality via /dev/zram-control interface. Two ioctl commands are
defined as of now (accessible in user-space via new zram.h header file):
-- ZRAM_CTL_ADD
	add new device (generates device_id automatically or uses provided
	device_id)
-- ZRAM_CTL_REMOVE
	remove device (by device_id)

util-linux zramctl update will be done later, after we land this patchset.


This also opens a possibility to drop some of sysfs device attrs and FOO_show()
code duplication in the future, and provide device stats/info via ioctl call
instead, providing something like (via zram.h):

	struct zram_info {
		__u64 orig_data_size;
		__u64 mem_used_total;
		__u64 max_comp_streams;

		[..]
	};


fill it under ->init_lock in zram_fill_info() (or any other name) function and
return all device stats at once back to user-space in a single syscall.

This is a long term plan, of course, but I'd like to see sysfs functions go away
in a year or so. What do you think?


Sergey Senozhatsky (8):
  zram: cosmetic ZRAM_ATTR_RO code formatting tweak
  zram: use idr instead of `zram_devices' array
  zram: factor out device reset from reset_store()
  zram: add dynamic device add/remove functionality
  zram: return zram device_id value from zram_add()
  zram: allow automatic new zram device_id assignment
  zram: remove max_num_devices limitation
  zram: report every added and removed device

 drivers/block/zram/zram_drv.c | 326 ++++++++++++++++++++++++++++--------------
 drivers/block/zram/zram_drv.h |   6 -
 include/linux/miscdevice.h    |   1 +
 include/uapi/linux/Kbuild     |   1 +
 include/uapi/linux/zram.h     |  17 +++
 5 files changed, 238 insertions(+), 113 deletions(-)
 create mode 100644 include/uapi/linux/zram.h

-- 
2.3.1.167.g7f4ba4b


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2015-04-16  0:47 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-03 12:49 [PATCHv3 0/8] introduce dynamic device creation/removal Sergey Senozhatsky
2015-03-03 12:49 ` [PATCH 1/8] zram: cosmetic ZRAM_ATTR_RO code formatting tweak Sergey Senozhatsky
2015-03-03 12:49 ` [PATCH 2/8] zram: use idr instead of `zram_devices' array Sergey Senozhatsky
2015-03-03 22:01   ` Andrew Morton
2015-03-04  0:21     ` Sergey Senozhatsky
2015-03-04  7:06   ` Minchan Kim
2015-03-04  7:34     ` Sergey Senozhatsky
2015-03-04  7:49     ` Sergey Senozhatsky
2015-03-05  0:59       ` Minchan Kim
2015-03-03 12:49 ` [PATCH 3/8] zram: factor out device reset from reset_store() Sergey Senozhatsky
2015-03-05  2:28   ` Minchan Kim
2015-03-03 12:49 ` [PATCH 4/8] zram: reorganize code layout Sergey Senozhatsky
2015-03-03 12:49 ` [PATCH 5/8] zram: add dynamic device add/remove functionality Sergey Senozhatsky
2015-03-03 22:01   ` Andrew Morton
2015-03-04  0:18     ` Sergey Senozhatsky
2015-03-04  7:10   ` Minchan Kim
2015-03-04  7:29     ` Sergey Senozhatsky
2015-03-04  8:19       ` Sergey Senozhatsky
2015-03-04  8:36         ` Sergey Senozhatsky
2015-03-03 12:49 ` [PATCH 6/8] zram: remove max_num_devices limitation Sergey Senozhatsky
2015-03-03 12:49 ` [PATCH 7/8] zram: report every added and removed device Sergey Senozhatsky
2015-03-03 12:49 ` [PATCH 8/8] zram: trivial: correct flag operations comment Sergey Senozhatsky
2015-04-15 21:37 ` [PATCHv3 0/8] introduce dynamic device creation/removal Andrew Morton
2015-04-15 23:40   ` Minchan Kim
2015-04-16  0:30     ` Sergey Senozhatsky
2015-04-16  0:47   ` Sergey Senozhatsky
  -- strict thread matches above, loose matches on Subject: below --
2015-02-26 14:10 [PATCH " Sergey Senozhatsky
2015-02-26 14:10 ` [PATCH 3/8] zram: factor out device reset from reset_store() Sergey Senozhatsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.