Re: [PATCH] lightnvm: fix memory leak in pblk_luns_init

2018-02-22 Thread Matias Bjørling
On 02/23/2018 12:03 AM, Huaicheng Li wrote: Please ignore my previous email as I found the memory is free'ed at pblk_init()'s error handling logic. Sorry for the interruption. On Thu, Feb 22, 2018 at 3:01 PM, Huaicheng Li wrote: Signed-off-by: Huaicheng Li --- drivers/lightnvm/pblk-init.c |

Re: [PATCH] blk-throttle: avoid multiple counting for same bio

2018-02-22 Thread Chengguang Xu
Hi Joseph, Thanks for quick reply, I didn’t notice that patch before. Thanks, Chengguang. > 在 2018年2月23日,上午11:55,Joseph Qi 写道: > > > > On 18/2/23 11:33, Chengguang Xu wrote: >> Hi Tejun, >> >> Sorry for delayed reply, I was on vacation last week. >> >> The problem still exists in current

Re: [PATCH] blk-throttle: avoid multiple counting for same bio

2018-02-22 Thread Joseph Qi
On 18/2/23 11:33, Chengguang Xu wrote: > Hi Tejun, > > Sorry for delayed reply, I was on vacation last week. > > The problem still exists in current code of 4.16.0-rc2, > detail test information is below, if further info is needed please let me > know. > > Thanks. > That's true, the issue S

Re: [PATCH] blk-throttle: avoid multiple counting for same bio

2018-02-22 Thread Chengguang Xu
Hi Tejun, Sorry for delayed reply, I was on vacation last week. The problem still exists in current code of 4.16.0-rc2, detail test information is below, if further info is needed please let me know. Thanks. ——— Both read/write bps are limited to 10M

Re: [PATCH v2] blk-throttle: fix race between blkcg_bio_issue_check and cgroup_rmdir

2018-02-22 Thread xuejiufei
Hi Tejun, On 2018/2/22 下午11:18, Tejun Heo wrote: > Hello, > > On Thu, Feb 22, 2018 at 02:14:34PM +0800, Joseph Qi wrote: >> I still don't get how css_tryget can work here. >> >> The race happens when: >> 1) writeback kworker has found the blkg with rcu; >> 2) blkcg is during offlining and blkg_de

[PATCH v4 1/6] block/loop: Delete gendisk before cleaning up the request queue

2018-02-22 Thread Bart Van Assche
Remove the disk, partition and bdi sysfs attributes before cleaning up the request queue associated with the disk. Signed-off-by: Bart Van Assche Cc: Josef Bacik Cc: Shaohua Li Cc: Omar Sandoval Cc: Hannes Reinecke Cc: Ming Lei --- drivers/block/loop.c | 2 +- 1 file changed, 1 insertion(+)

[PATCH v4 2/6] md: Delete gendisk before cleaning up the request queue

2018-02-22 Thread Bart Van Assche
Remove the disk, partition and bdi sysfs attributes before cleaning up the request queue associated with the disk. Signed-off-by: Bart Van Assche Cc: Shaohua Li --- drivers/md/md.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index

[PATCH v4 0/6] Fix races between blkcg code and request queue initialization and cleanup

2018-02-22 Thread Bart Van Assche
Hello Jens, Recently Joseph Qi identified races between the block cgroup code and request queue initialization and cleanup. This patch series address these races. Please consider these patches for kernel v4.17. Thanks, Bart. Changes between v3 and v4: - Added three patches that fix the calling

[PATCH v4 5/6] block: Fix a race between the cgroup code and request queue initialization

2018-02-22 Thread Bart Van Assche
Initialize the request queue lock earlier such that the following race can no longer occur: blk_init_queue_node() blkcg_print_blkgs() blk_alloc_queue_node (1) q->queue_lock = &q->__queue_lock (2) blkcg_init_queue(q) (3) spin_lock_irq(blkg->

[PATCH v4 4/6] block: Add a third argument to blk_alloc_queue_node()

2018-02-22 Thread Bart Van Assche
This patch does not change any functionality. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Joseph Qi Cc: Philipp Reisner Cc: Ulf Hansson Cc: Kees Cook --- block/blk-core.c | 7 --- block/blk-mq.c| 2 +- drivers/block/null_blk.c | 3 ++- driv

[PATCH v4 3/6] zram: Delete gendisk before cleaning up the request queue

2018-02-22 Thread Bart Van Assche
Remove the disk, partition and bdi sysfs attributes before cleaning up the request queue associated with the disk. Signed-off-by: Bart Van Assche Cc: Minchan Kim Cc: Nitin Gupta Cc: Sergey Senozhatsky --- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) dif

[PATCH v4 6/6] block: Fix a race between request queue removal and the block cgroup controller

2018-02-22 Thread Bart Van Assche
Avoid that the following race can occur: blk_cleanup_queue() blkcg_print_blkgs() spin_lock_irq(lock) (1) spin_lock_irq(blkg->q->queue_lock) (2,5) q->queue_lock = &q->__queue_lock (3) spin_unlock_irq(lock) (4) spin_unlock_irq(blkg-

Re: v4.16-rc2: I/O hang with dm-rq + Kyber

2018-02-22 Thread Bart Van Assche
On Thu, 2018-02-22 at 14:42 -0800, Omar Sandoval wrote: > On Thu, Feb 22, 2018 at 09:10:23PM +, Bart Van Assche wrote: > > I/O hangs if I run the following command on top of kernel v4.16-rc2 + the > > ib_srpt patch that adds RDMA/CM support: > > > > srp-test/run_tests -c -d -r 10 -t 02-mq -e k

Re: v4.16-rc2: I/O hang with dm-rq + Kyber

2018-02-22 Thread Omar Sandoval
On Thu, Feb 22, 2018 at 09:10:23PM +, Bart Van Assche wrote: > Hello Omar, > > I/O hangs if I run the following command on top of kernel v4.16-rc2 + the > ib_srpt patch that adds RDMA/CM support: > > srp-test/run_tests -c -d -r 10 -t 02-mq -e kyber > > This does not happen with the deadline

v4.16-rc2: I/O hang with dm-rq + Kyber

2018-02-22 Thread Bart Van Assche
Hello Omar, I/O hangs if I run the following command on top of kernel v4.16-rc2 + the ib_srpt patch that adds RDMA/CM support: srp-test/run_tests -c -d -r 10 -t 02-mq -e kyber This does not happen with the deadline scheduler nor without a scheduler. This test passed a few months ago. I have atta

[PATCH] lightnvm: fix memory leak in pblk_luns_init

2018-02-22 Thread Huaicheng Li
Signed-off-by: Huaicheng Li --- drivers/lightnvm/pblk-init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index 93d671ca518e..330665d91d8d 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -510,6 +510,

Re: [PATCH V15 06/22] mmc: block: Add blk-mq support

2018-02-22 Thread Dmitry Osipenko
On 22.02.2018 10:42, Adrian Hunter wrote: > On 21/02/18 22:50, Dmitry Osipenko wrote: >> On 29.11.2017 16:41, Adrian Hunter wrote: >>> Define and use a blk-mq queue. Discards and flushes are processed >>> synchronously, but reads and writes asynchronously. In order to support >>> slow DMA unmapping

Re: [PATCH v3 3/3] block: Fix a race between request queue removal and the block cgroup controller

2018-02-22 Thread Bart Van Assche
On Thu, 2018-02-22 at 10:25 +0800, Joseph Qi wrote: > I notice that several devices such as loop and zram will call > blk_cleanup_queue before del_gendisk, so it will hit this warning. Is > this normal? Hello Joseph, Since the disk object has a reference to the queue I agree with Ming that it's w

Re: disk-io lockup in 4.14.13 kernel

2018-02-22 Thread Bart Van Assche
On 02/22/18 02:58, Jaco Kroon wrote: We've been seeing sporadic IO lockups on recent kernels. Are you using the legacy I/O stack or blk-mq? If you are not yet using blk-mq, can you switch to blk-mq + scsi-mq + dm-mq? If the lockup is reproducible with blk-mq, can you share the output of the f

Re: [PATCH v2] blk-throttle: fix race between blkcg_bio_issue_check and cgroup_rmdir

2018-02-22 Thread Tejun Heo
Hello, On Thu, Feb 22, 2018 at 02:14:34PM +0800, Joseph Qi wrote: > I still don't get how css_tryget can work here. > > The race happens when: > 1) writeback kworker has found the blkg with rcu; > 2) blkcg is during offlining and blkg_destroy() has already been called. > Then, writeback kworker w

Re: [PATCH 01/20] lightnvm: simplify geometry structure.

2018-02-22 Thread Javier Gonzalez
> On 22 Feb 2018, at 13.22, Matias Bjørling wrote: > > On 02/22/2018 08:44 AM, Javier Gonzalez wrote: >>> On 22 Feb 2018, at 08.25, Matias Bjørling wrote: >>> >>> On 02/21/2018 10:26 AM, Javier González wrote: Currently, the device geometry is stored redundantly in the nvm_id and nvm_

Re: how can one drain MQ request queue ?

2018-02-22 Thread Ming Lei
On Thu, Feb 22, 2018 at 09:10:26PM +0800, Ming Lei wrote: > On Thu, Feb 22, 2018 at 12:56:05PM +0200, Max Gurtovoy wrote: > > > > > > On 2/22/2018 4:59 AM, Ming Lei wrote: > > > Hi Max, > > > > Hi Ming, > > > > > > > > On Tue, Feb 20, 2018 at 11:56:07AM +0200, Max Gurtovoy wrote: > > > > hi al

Re: how can one drain MQ request queue ?

2018-02-22 Thread Ming Lei
On Thu, Feb 22, 2018 at 12:56:05PM +0200, Max Gurtovoy wrote: > > > On 2/22/2018 4:59 AM, Ming Lei wrote: > > Hi Max, > > Hi Ming, > > > > > On Tue, Feb 20, 2018 at 11:56:07AM +0200, Max Gurtovoy wrote: > > > hi all, > > > is there a way to drain a blk-mq based request queue (similar to > > >

Re: [PATCH 01/20] lightnvm: simplify geometry structure.

2018-02-22 Thread Matias Bjørling
On 02/22/2018 08:44 AM, Javier Gonzalez wrote: On 22 Feb 2018, at 08.25, Matias Bjørling wrote: On 02/21/2018 10:26 AM, Javier González wrote: Currently, the device geometry is stored redundantly in the nvm_id and nvm_geo structures at a device level. Moreover, when instantiating targets on

disk-io lockup in 4.14.13 kernel

2018-02-22 Thread Jaco Kroon
Hi, We've been seeing sporadic IO lockups on recent kernels. Currently installed on the server is 4.14.13. Previously we ran 4.0.9, due to various problems from 4.1 onward with respect to RAID problems, and netfilter etc ... with 4.13 being the first usable kernel again that doesn't require addi

Re: [PATCH 03/20] lightnvm: fix capabilities for 2.0 sysfs

2018-02-22 Thread Javier Gonzalez
> On 22 Feb 2018, at 12.10, Matias Bjørling wrote: > > On 02/22/2018 11:25 AM, Javier Gonzalez wrote: >>> On 22 Feb 2018, at 10.39, Matias Bjørling wrote: >>> >>> On 02/22/2018 08:47 AM, Javier Gonzalez wrote: > On 22 Feb 2018, at 08.28, Matias Bjørling wrote: > >> On 02/21/2018 1

Re: [PATCH 03/20] lightnvm: fix capabilities for 2.0 sysfs

2018-02-22 Thread Matias Bjørling
On 02/22/2018 11:25 AM, Javier Gonzalez wrote: On 22 Feb 2018, at 10.39, Matias Bjørling wrote: On 02/22/2018 08:47 AM, Javier Gonzalez wrote: On 22 Feb 2018, at 08.28, Matias Bjørling wrote: On 02/21/2018 10:26 AM, Javier González wrote: Both 1.2 and 2.0 specs define a field for media a

Re: how can one drain MQ request queue ?

2018-02-22 Thread Max Gurtovoy
On 2/22/2018 4:59 AM, Ming Lei wrote: Hi Max, Hi Ming, On Tue, Feb 20, 2018 at 11:56:07AM +0200, Max Gurtovoy wrote: hi all, is there a way to drain a blk-mq based request queue (similar to blk_drain_queue for non MQ) ? Generally speaking, blk_mq_freeze_queue() should be fine to drain b

Re: [PATCH 03/20] lightnvm: fix capabilities for 2.0 sysfs

2018-02-22 Thread Javier Gonzalez
> On 22 Feb 2018, at 10.39, Matias Bjørling wrote: > > On 02/22/2018 08:47 AM, Javier Gonzalez wrote: >>> On 22 Feb 2018, at 08.28, Matias Bjørling wrote: >>> On 02/21/2018 10:26 AM, Javier González wrote: Both 1.2 and 2.0 specs define a field for media and controller capabilit

Re: [PATCH 08/20] lightnvm: complete geo structure with maxoc*

2018-02-22 Thread Javier Gonzalez
Javier > On 22 Feb 2018, at 11.00, Matias Bjørling wrote: > > On 02/22/2018 10:52 AM, Javier Gonzalez wrote: >>> On 22 Feb 2018, at 10.45, Matias Bjørling wrote: >>> >>> On 02/22/2018 08:55 AM, Javier Gonzalez wrote: > On 22 Feb 2018, at 08.45, Matias Bjørling wrote: > > On 02/2

Re: [PATCH 08/20] lightnvm: complete geo structure with maxoc*

2018-02-22 Thread Matias Bjørling
On 02/22/2018 10:52 AM, Javier Gonzalez wrote: On 22 Feb 2018, at 10.45, Matias Bjørling wrote: On 02/22/2018 08:55 AM, Javier Gonzalez wrote: On 22 Feb 2018, at 08.45, Matias Bjørling wrote: On 02/21/2018 10:26 AM, Javier González wrote: Complete the generic geometry structure with the max

Re: [PATCH 08/20] lightnvm: complete geo structure with maxoc*

2018-02-22 Thread Javier Gonzalez
> On 22 Feb 2018, at 10.45, Matias Bjørling wrote: > > On 02/22/2018 08:55 AM, Javier Gonzalez wrote: >>> On 22 Feb 2018, at 08.45, Matias Bjørling wrote: >>> >>> On 02/21/2018 10:26 AM, Javier González wrote: Complete the generic geometry structure with the maxoc and maxocpu felds, p

Re: [PATCH 08/20] lightnvm: complete geo structure with maxoc*

2018-02-22 Thread Matias Bjørling
On 02/22/2018 08:55 AM, Javier Gonzalez wrote: On 22 Feb 2018, at 08.45, Matias Bjørling wrote: On 02/21/2018 10:26 AM, Javier González wrote: Complete the generic geometry structure with the maxoc and maxocpu felds, present in the 2.0 spec. Signed-off-by: Javier González --- drivers/nvme/h

Re: [PATCH 09/20] lightnvm: use generic identify structure

2018-02-22 Thread Matias Bjørling
On 02/22/2018 08:49 AM, Javier González wrote: On 22 Feb 2018, at 08.47, Matias Bjørling wrote: On 02/21/2018 10:26 AM, Javier González wrote: Create a generic identify structure to collect the identify information before knowing the spec. version. This forces different version paths to cast t

Re: [PATCH 03/20] lightnvm: fix capabilities for 2.0 sysfs

2018-02-22 Thread Matias Bjørling
On 02/22/2018 08:47 AM, Javier Gonzalez wrote: On 22 Feb 2018, at 08.28, Matias Bjørling wrote: On 02/21/2018 10:26 AM, Javier González wrote: Both 1.2 and 2.0 specs define a field for media and controller capabilities. Also, 1.2 defines a separate field dedicated to device capabilities. In 2.

Re: [PATCH 13/20] lightnvm: add support for 2.0 address format

2018-02-22 Thread Matias Bjørling
On 02/21/2018 10:26 AM, Javier González wrote: Add support for 2.0 address format. Also, align address bits for 1.2 and 2.0 to be able to operate on channel and luns without requiring a format conversion. Use a generic address format for this purpose. Signed-off-by: Javier González --- driver

Re: [PATCH v2] block: Move SECTOR_SIZE and SECTOR_SHIFT definitions into

2018-02-22 Thread Johannes Thumshirn
Thanks Bart, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG

[PATCH] lightnvm: fix bad block initialization

2018-02-22 Thread Heiner Litz
fix reading bad block device information to correctly setup the per line blk_bitmap during lightnvm initialization Signed-off-by: Heiner Litz --- drivers/lightnvm/pblk-init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/p

Re: [PATCH 08/20] lightnvm: complete geo structure with maxoc*

2018-02-22 Thread Javier Gonzalez
> On 22 Feb 2018, at 08.45, Matias Bjørling wrote: > > On 02/21/2018 10:26 AM, Javier González wrote: >> Complete the generic geometry structure with the maxoc and maxocpu >> felds, present in the 2.0 spec. >> Signed-off-by: Javier González >> --- >> drivers/nvme/host/lightnvm.c | 4 >> in