From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932530AbbBZOKe (ORCPT ); Thu, 26 Feb 2015 09:10:34 -0500 Received: from mail-pd0-f181.google.com ([209.85.192.181]:45678 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932472AbbBZOKc (ORCPT ); Thu, 26 Feb 2015 09:10:32 -0500 From: Sergey Senozhatsky To: Andrew Morton , Minchan Kim Cc: Jerome Marchand , Nitin Gupta , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: [PATCH 0/8] introduce dynamic device creation/removal Date: Thu, 26 Feb 2015 23:10:35 +0900 Message-Id: <1424959843-20409-1-git-send-email-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.3.1.167.g7f4ba4b Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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