Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality

2015-05-04 Thread Sergey Senozhatsky
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c > index 3df4394..7fb72dc 100644 > --- a/drivers/block/zram/zram_drv.c > +++ b/drivers/block/zram/zram_drv.c > @@ -1074,13 +1074,6 @@ static ssize_t reset_store(struct device *dev, > if (!bdev) > return

Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality

2015-05-03 Thread Sergey Senozhatsky
On (05/04/15 11:28), Minchan Kim wrote: > [minchan]: use zram->claim to avoid lockdep splat > Reported-by: Minchan Kim > Signed-off-by: Sergey Senozhatsky > --- will take a look today, cleanup and re-submit. thanks! > /* >* Remove sysfs first, so no one will perform a disksize >

Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality

2015-05-03 Thread Sergey Senozhatsky
On (05/04/15 11:20), Minchan Kim wrote: > I had a time to think over it. > > I think your patch is rather tricky so someone cannot see sysfs > although he already opened /dev/zram but after a while he can see sysfs. > It's weired. > > I want to fix it more generic way. Othewise, we might have tro

Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality

2015-05-03 Thread Minchan Kim
On Mon, May 04, 2015 at 11:20:08AM +0900, Minchan Kim wrote: > Hello Sergey, > > On Thu, Apr 30, 2015 at 03:51:12PM +0900, Sergey Senozhatsky wrote: > > On (04/30/15 15:44), Minchan Kim wrote: > > > > > I think the problem of deadlock is that you are trying to remove > > > > > sysfs file > > > >

Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality

2015-05-03 Thread Minchan Kim
Hello Sergey, On Thu, Apr 30, 2015 at 03:51:12PM +0900, Sergey Senozhatsky wrote: > On (04/30/15 15:44), Minchan Kim wrote: > > > > I think the problem of deadlock is that you are trying to remove sysfs > > > > file > > > > in sysfs handler. > > > > > > > > #> echo 1 > /sys/xxx/zram_remove > > >

Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality

2015-04-29 Thread Sergey Senozhatsky
On (04/30/15 15:44), Minchan Kim wrote: > > > I think the problem of deadlock is that you are trying to remove sysfs > > > file > > > in sysfs handler. > > > > > > #> echo 1 > /sys/xxx/zram_remove > > > > > > kernfs_fop_write - hold s_active > > > -> zram_remove_store > > > -> zram_remove

Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality

2015-04-29 Thread Minchan Kim
On Thu, Apr 30, 2015 at 03:34:57PM +0900, Sergey Senozhatsky wrote: > Hello Minchan, > > On (04/30/15 14:47), Minchan Kim wrote: > [..] > > > > Isn't it related to bd_mutex? > > I think it is: > > [ 216.713922] Possible unsafe locking scenario: > [ 216.713923]CPU0

Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality

2015-04-29 Thread Sergey Senozhatsky
On (04/30/15 15:34), Sergey Senozhatsky wrote: > > Isn't it related to bd_mutex? > > I think it is: > I meant: I think it's related > [ 216.713922] Possible unsafe locking scenario: > [ 216.713923]CPU0CPU1 > [ 216.713924] > [

Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality

2015-04-29 Thread Sergey Senozhatsky
Hello Minchan, On (04/30/15 14:47), Minchan Kim wrote: [..] > > Isn't it related to bd_mutex? I think it is: [ 216.713922] Possible unsafe locking scenario: [ 216.713923]CPU0CPU1 [ 216.713924] [ 216.713925] lock(&bdev->bd_mu

Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality

2015-04-29 Thread Minchan Kim
Hello Sergey, On Wed, Apr 29, 2015 at 04:23:28PM +0900, Sergey Senozhatsky wrote: > On (04/29/15 16:02), Sergey Senozhatsky wrote: > > sure. I was talking about this one: > > > > CPU0CPU1 > > umount > > zram_remove() > > lock ->bd_mutex > > zram_reset_devic

Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality

2015-04-29 Thread Sergey Senozhatsky
On (04/29/15 16:02), Sergey Senozhatsky wrote: > sure. I was talking about this one: > > CPU0CPU1 > umount > zram_remove() > lock ->bd_mutex > zram_reset_device() > unlock ->bd_mutex > disksize_store >

Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality

2015-04-29 Thread Sergey Senozhatsky
Hello Minchan, On (04/29/15 15:48), Minchan Kim wrote: [..] > > > > CPU0CPU1 > > umount > > zram_remove() > > zram_reset_device() disksize_store() > > mount > > kfree zram > > > > or > > > > CPU0

Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality

2015-04-28 Thread Minchan Kim
Hello Sergey, On Wed, Apr 29, 2015 at 09:16:24AM +0900, Sergey Senozhatsky wrote: > Hello, > > Minchan, a quick question. just to avoid resends and to make sure that I'm > not missing any better solution. > > > lockdep is unhappy here: > > > -static void zram_remove(struct zram *zram) > > +sta

Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality

2015-04-28 Thread Sergey Senozhatsky
Hello, Minchan, a quick question. just to avoid resends and to make sure that I'm not missing any better solution. lockdep is unhappy here: > -static void zram_remove(struct zram *zram) > +static int zram_remove(struct zram *zram) > { > - pr_info("Removed device: %s\n", zram->disk->disk_na

[PATCHv3 9/9] zram: add dynamic device add/remove functionality

2015-04-27 Thread Sergey Senozhatsky
We currently don't support on-demand device creation. The one and only way to have N zram devices is to specify num_devices module parameter (default value: 1). IOW 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, lo