Re: [PATCH v3 2/3] zram: revalidate disk under init_lock

2016-11-25 Thread Sergey Senozhatsky

Hi,

On (11/25/16 17:35), Minchan Kim wrote:
> [1] moved revalidate_disk call out of init_lock to avoid lockdep
> false-positive splat. However, [2] remove init_lock in IO path
> so there is no worry about lockdep splat. So, let's restore it.
> This patch need to set BDI_CAP_STABLE_WRITES atomically in
> next patch.

can we break that dependency on the next patch if we would
set BDI_CAP_STABLE_WRITES when we allocate the queue?

queue->backing_dev_info.capabilities |= BDI_CAP_CGROUP_WRITEBACK;

-ss


Re: [PATCH v3 2/3] zram: revalidate disk under init_lock

2016-11-25 Thread Sergey Senozhatsky

Hi,

On (11/25/16 17:35), Minchan Kim wrote:
> [1] moved revalidate_disk call out of init_lock to avoid lockdep
> false-positive splat. However, [2] remove init_lock in IO path
> so there is no worry about lockdep splat. So, let's restore it.
> This patch need to set BDI_CAP_STABLE_WRITES atomically in
> next patch.

can we break that dependency on the next patch if we would
set BDI_CAP_STABLE_WRITES when we allocate the queue?

queue->backing_dev_info.capabilities |= BDI_CAP_CGROUP_WRITEBACK;

-ss


[PATCH v3 2/3] zram: revalidate disk under init_lock

2016-11-25 Thread Minchan Kim
[1] moved revalidate_disk call out of init_lock to avoid lockdep
false-positive splat. However, [2] remove init_lock in IO path
so there is no worry about lockdep splat. So, let's restore it.
This patch need to set BDI_CAP_STABLE_WRITES atomically in
next patch.

[1] b4c5c60920e3: zram: avoid lockdep splat by revalidate_disk
[2] 08eee69fcf6b: zram: remove init_lock in zram_make_request

Fixes: da9556a2367c ("zram: user per-cpu compression streams")
Cc: sta...@vger.kernel.org
Signed-off-by: Minchan Kim 
---
 drivers/block/zram/zram_drv.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 5163c8f918cb..d93a4b2135c2 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1094,14 +1094,8 @@ static ssize_t disksize_store(struct device *dev,
zram->comp = comp;
zram->disksize = disksize;
set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT);
-   up_write(>init_lock);
-
-   /*
-* Revalidate disk out of the init_lock to avoid lockdep splat.
-* It's okay because disk's capacity is protected by init_lock
-* so that revalidate_disk always sees up-to-date capacity.
-*/
revalidate_disk(zram->disk);
+   up_write(>init_lock);
 
return len;
 
-- 
2.7.4



[PATCH v3 2/3] zram: revalidate disk under init_lock

2016-11-25 Thread Minchan Kim
[1] moved revalidate_disk call out of init_lock to avoid lockdep
false-positive splat. However, [2] remove init_lock in IO path
so there is no worry about lockdep splat. So, let's restore it.
This patch need to set BDI_CAP_STABLE_WRITES atomically in
next patch.

[1] b4c5c60920e3: zram: avoid lockdep splat by revalidate_disk
[2] 08eee69fcf6b: zram: remove init_lock in zram_make_request

Fixes: da9556a2367c ("zram: user per-cpu compression streams")
Cc: sta...@vger.kernel.org
Signed-off-by: Minchan Kim 
---
 drivers/block/zram/zram_drv.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 5163c8f918cb..d93a4b2135c2 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1094,14 +1094,8 @@ static ssize_t disksize_store(struct device *dev,
zram->comp = comp;
zram->disksize = disksize;
set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT);
-   up_write(>init_lock);
-
-   /*
-* Revalidate disk out of the init_lock to avoid lockdep splat.
-* It's okay because disk's capacity is protected by init_lock
-* so that revalidate_disk always sees up-to-date capacity.
-*/
revalidate_disk(zram->disk);
+   up_write(>init_lock);
 
return len;
 
-- 
2.7.4