From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753325AbbEFGwZ (ORCPT ); Wed, 6 May 2015 02:52:25 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:34872 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752956AbbEFGwX (ORCPT ); Wed, 6 May 2015 02:52:23 -0400 Date: Wed, 6 May 2015 15:52:14 +0900 From: Minchan Kim To: Sergey Senozhatsky Cc: Sergey Senozhatsky , Andrew Morton , Nitin Gupta , linux-kernel@vger.kernel.org Subject: Re: [PATCHv4 00/10] add on-demand device creation Message-ID: <20150506065214.GA3362@blaptop> References: <1430743142-15854-1-git-send-email-sergey.senozhatsky@gmail.com> <20150506050114.GA29132@blaptop> <20150506052557.GA820@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150506052557.GA820@swordfish> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 06, 2015 at 02:25:57PM +0900, Sergey Senozhatsky wrote: > > Hi, > > On (05/06/15 14:01), Minchan Kim wrote: > > Hello Sergey, > > > > On Mon, May 04, 2015 at 09:38:52PM +0900, Sergey Senozhatsky wrote: > > > We currently don't support zram on-demand device creation. The only way > > > to have N zram devices is to specify num_devices module parameter (default > > > value 1). That means that if, for some reason, at some point, user wants > > > to have N + 1 devies he/she must umount all the existing devices, unload > > > the module, load the module passing num_devices equals to N + 1. > > > > > > This patchset introduces zram-control sysfs class, which has two sysfs > > > attrs: > > > > > > - zram_add -- add a new zram device > > > - zram_remove -- remove a specific (device_id) zram device > > > > > > Usage example: > > > # add a new specific zram device > > > cat /sys/class/zram-control/zram_add > > > 1 > > > > > > # remove a specific zram device > > > echo 4 > /sys/class/zram-control/zram_remove > > > > I just reported bug. Please handle it. > > a-ha... found it: > http://lkml.iu.edu/hypermail/linux/kernel/1505.0/04389.html > > will take a look. thanks! > > > Other nits: > > > > 1) How about inserting a step to reset before zram_remove? > > IOW, user should echo "1" > /sys/block/zram[0-9]*/reset before > > echo zram_id > /sys/class/zram-control/zram_remove. > > > > Actually, I can't think any benefit other than consistency of > > zram interface but you might have. > > well, I did this the way it is because there is no requirement to reset any > devices before `rmmod zram' (which eventually removes all zram devices from the > system), a set of umount-s is enough. so requiring both umount and reset before > hot_remove seems to be a bit different. Okay. > > zram_remove() is called from both hot_remove and zram_exit()->destroy_devices() > (which requires reset step anyway). so I'm not sure about this change. do you > have any strong objections? No. I just wanted to know you have any idea. > > > > 2) How about using hot_add/hot_remove? > > > > /class/zram-control includes prefix zram meaning so I think > > we don't need zram prefix of the knobs. Instead, let's add > > *hot* which is more straightforward for representing *dynamic*. > > > > What do you think about it? > > ok. I can change it. I'll ask Andrew to drop the entire patch series and > will resubmit once we settle it down. > Thanks! -- Kind regards, Minchan Kim