[PATCH V2 4/8] mtip32xx: use blk_mq_queue_tag_inflight_iter

2019-03-24 Thread Jianchao Wang
blk_mq_tagset_busy_iter is not safe that it could get stale request in tags->rqs[]. Use blk_mq_queue_tag_inflight_iter here. Signed-off-by: Jianchao Wang --- drivers/block/mtip32xx/mtip32xx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/mtip3

[PATCH V2 0/8]: blk-mq: use static_rqs to iterate busy tags

2019-03-24 Thread Jianchao Wang
he blk_mq_tagset_busy_iter. Change log V1 -> V2: - Add wrapper to hide the 'infligh' parameter to user based on Sagi's suggestion. - Other misc changes on comment. Jianchao Wang (8) blk-mq: get rid of the synchronize_rcu in blk-mq: use static_rqs instead of rqs to iterate tags blk-mq:

[PATCH V2 7/8] nvme: use blk_mq_queue_tag_inflight_iter

2019-03-24 Thread Jianchao Wang
blk_mq_tagset_inflight_iter is not safe that it could get stale request in tags->rqs[]. Use blk_mq_queue_tag_inflight_iter here. A new helper interface nvme_iterate_inflight_rqs is introduced to iterate all of the ns under a ctrl. Signed-off-by: Jianchao Wang --- drivers/nvme/host/core.c |

[PATCH V2 2/8] blk-mq: use static_rqs instead of rqs to iterate tags

2019-03-24 Thread Jianchao Wang
ueue cleanup. Add 'inflight' parameter to determine to iterate in-flight requests or just busy tags and add a new helper interface blk_mq_queue_tag_inflight_iter to iterate all of the in-flight tags and export this interface for drivers. Signed-off-by: Jianchao Wang --- block/blk-mq-tag.c | 96 +

[PATCH V2 5/8] nbd: use blk_mq_queue_tag_inflight_iter

2019-03-24 Thread Jianchao Wang
blk_mq_tagset_busy_iter is not safe that it could get stale request in tags->rqs[]. Use blk_mq_queue_tag_inflight_iter here. Signed-off-by: Jianchao Wang --- drivers/block/nbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c in

[PATCH V2 6/8] skd: use blk_mq_queue_tag_inflight_iter

2019-03-24 Thread Jianchao Wang
blk_mq_tagset_busy_iter is not safe that it could get stale request in tags->rqs[]. Use blk_mq_queue_tag_inflight_iter here. Signed-off-by: Jianchao Wang --- drivers/block/skd_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/skd_main.c b/drivers/bl

[PATCH V2 8/8] blk-mq: remove blk_mq_tagset_busy_iter

2019-03-24 Thread Jianchao Wang
As nobody uses blk_mq_tagset_busy_iter, remove it. Signed-off-by: Jianchao Wang --- block/blk-mq-tag.c | 95 -- include/linux/blk-mq.h | 2 -- 2 files changed, 97 deletions(-) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index

[PATCH V2 1/8] blk-mq: get rid of the synchronize_rcu in __blk_mq_update_nr_hw_queues

2019-03-24 Thread Jianchao Wang
In commit 530ca2c (blk-mq: Allow blocking queue tag iter callbacks), we try to get a non-zero q_usage_counter to avoid access hctxs that being modified. So the synchronize_rcu is useless and should be removed. Reviewed-by: Ming Lei Signed-off-by: Jianchao Wang --- block/blk-mq-tag.c | 4

[PATCH V2 3/8] blk-mq: use blk_mq_queue_tag_inflight_iter in debugfs

2019-03-24 Thread Jianchao Wang
blk_mq_tagset_busy_iter is not safe that it could get stale request in tags->rqs[]. Use blk_mq_queue_tag_inflight_iter here. Signed-off-by: Jianchao Wang --- block/blk-mq-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq-debugfs.c b/block/blk

[PATCH V2] blk-mq: insert rq with DONTPREP to hctx dispatch list when requeue

2019-02-11 Thread Jianchao Wang
of (32776 + 8) is not expected. Suggested-by: Jens Axboe Signed-off-by: Jianchao Wang --- V2: - refactor the code based on Jens' suggestion block/blk-mq.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 8f5b533..9437a5e 100644

[PATCH] blk-mq: insert rq with DONTPREP to hctx dispatch list when requeue

2019-02-10 Thread Jianchao Wang
of (32776 + 8) is not expected. Signed-off-by: Jianchao Wang --- block/blk-mq.c | 12 1 file changed, 12 insertions(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index 8f5b533..2d93eb5 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -737,6 +737,18 @@ static void blk_mq_requeue_work

[PATCH] blk-mq: fix a hung issue when fsync

2019-01-30 Thread Jianchao Wang
check and clear the RESTART flag. Fixes: bd166ef1 (blk-mq-sched: add framework for MQ capable IO schedulers) Reported-by: Florian Stecker Tested-by: Florian Stecker Signed-off-by: Jianchao Wang --- block/blk-flush.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-flu

[PATCH] blk-mq: fix the cmd_flag_name array

2019-01-24 Thread Jianchao Wang
Swap REQ_NOWAIT and REQ_NOUNMAP and add REQ_HIPRI. Signed-off-by: Jianchao Wang --- block/blk-mq-debugfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 90d6876..f812083 100644 --- a/block/blk-mq-debugfs.c +++ b/block

[PATCH 1/2] blk-mq: save queue mapping result into ctx directly

2019-01-24 Thread Jianchao Wang
hctx type, like, ctx->hctxs[type] Signed-off-by: Jianchao Wang --- block/blk-mq-sched.c | 2 +- block/blk-mq-tag.c | 2 +- block/blk-mq.c | 4 ++-- block/blk-mq.h | 7 --- block/blk.h | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/block/blk-

[PATCH 0/2] small optimization for accessing queue map

2019-01-24 Thread Jianchao Wang
Hi Jens These two patches are small optimization for accessing the queue mapping in hot path. It saves the queue mapping results into blk_mq_ctx directly, then we needn't do the complicated bounce on queue_hw_ctx[] map[] and mq_map[]. Jianchao Wang (2) blk-mq: save queue mapping result into ctx

[PATCH 2/2] blk-mq: save default hctx into ctx->hctxs for not-supported type

2019-01-24 Thread Jianchao Wang
e poll is enabled or not, because the caller would clear the REQ_HIPRI in that case. Signed-off-by: Jianchao Wang --- block/blk-mq.c | 9 - block/blk-mq.h | 13 + 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 445d0a2..8a825ae

[PATCH 2/2] blk-mq: save default hctx into ctx->hctxs for not-supported type

2018-12-26 Thread Jianchao Wang
e poll is enabled or not, because the caller would clear the REQ_HIPRI in that case. Signed-off-by: Jianchao Wang --- block/blk-mq.c | 9 - block/blk-mq.h | 15 ++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 6898d24..1dab467

[PATCH 0/2] blk-mq: small optimization for accessing of queue map

2018-12-26 Thread Jianchao Wang
Hi Jens These two patches are small optimization for accessing the queue mapping in hot path. It saves the queue mapping results into blk_mq_ctx directly, then we needn't do the complicated bounce on queue_hw_ctx[] map[] and mq_map[]. Jianchao Wang(2) blk-mq: save queue mapping result into ctx

[PATCH 1/2] blk-mq: save queue mapping result into ctx directly

2018-12-26 Thread Jianchao Wang
hctx type, like, ctx->hctxs[type] Signed-off-by: Jianchao Wang --- block/blk-mq-sched.c | 2 +- block/blk-mq-tag.c | 2 +- block/blk-mq.c | 4 ++-- block/blk-mq.h | 5 +++-- block/blk.h | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/block/blk-

[PATCH] nvme-pci: fix the wrong setting of nr_maps

2018-12-23 Thread Jianchao Wang
We only set the nr_maps to 3 if poll queues are supported. Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 5a0bf6a..cc65fa8 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme

[PATCH V14 2/3] blk-mq: issue directly with bypass 'false' in blk_mq_sched_insert_requests

2018-12-13 Thread Jianchao Wang
blk_mq_try_issue_directly can handle it well.If request is direct-issued unsuccessfully, insert the reset. Signed-off-by: Jianchao Wang --- block/blk-mq-sched.c | 8 +++- block/blk-mq.c | 20 +--- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/block/blk-mq-sched.c b/block

[PATCH V14 0/3] blk-mq: refactor and fix the code of issue directly

2018-12-13 Thread Jianchao Wang
est with blk_mq_request_bypass_insert. - Modify the code to adapt the new patch 1. V2: - Add 1st and 2nd patch to refactor the code. Jianchao Wang (3) blk-mq: refactor the code of issue request directly blk-mq: issue directly with bypass 'false' in blk-mq: replace and kill blk_mq_request_issue_direc

[PATCH V14 1/3] blk-mq: refactor the code of issue request directly

2018-12-13 Thread Jianchao Wang
the merging. We just need to do that for the requests that has been through .queue_rq. This patch also could fix this. Signed-off-by: Jianchao Wang --- block/blk-mq.c | 103 ++--- 1 file changed, 54 insertions(+), 49 deletions(-) diff --git a/block/blk

[PATCH V14 3/3] blk-mq: replace and kill blk_mq_request_issue_directly

2018-12-13 Thread Jianchao Wang
Replace blk_mq_request_issue_directly with blk_mq_try_issue_directly in blk_insert_cloned_request and kill it as nobody uses it any more. Signed-off-by: Jianchao Wang --- block/blk-core.c | 4 +++- block/blk-mq.c | 9 + block/blk-mq.h | 6 -- 3 files changed, 8 insertions(+), 11

[PATCH V13 0/3] blk-mq: refactor code of issue directly

2018-12-09 Thread Jianchao Wang
sed on the return value of .queue_rq and bypass_insert (1/4) - Add the 2nd patch. It introduce a new decision result which indicates to insert request with blk_mq_request_bypass_insert. - Modify the code to adapt the new patch 1. V2: - Add 1st and 2nd patch to refactor the code. Jianchao W

[PATCH V13 2/3] blk-mq: issue directly with bypass 'false' in blk_mq_sched_insert_requests

2018-12-09 Thread Jianchao Wang
blk_mq_try_issue_directly can handle it well.If request is direct-issued unsuccessfully, insert the reset. Signed-off-by: Jianchao Wang --- block/blk-mq-sched.c | 8 +++- block/blk-mq.c | 20 +--- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/block/blk-mq-sched.c b/block

[PATCH V13 1/3] blk-mq: refactor the code of issue request directly

2018-12-09 Thread Jianchao Wang
needn't any other handling any more and then code could be cleaned up. Signed-off-by: Jianchao Wang --- block/blk-mq.c | 103 ++--- 1 file changed, 54 insertions(+), 49 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index b645275

[PATCH V13 3/3] blk-mq: replace and kill blk_mq_request_issue_directly

2018-12-09 Thread Jianchao Wang
Replace blk_mq_request_issue_directly with blk_mq_try_issue_directly in blk_insert_cloned_request and kill it as nobody uses it any more. Signed-off-by: Jianchao Wang --- block/blk-core.c | 4 +++- block/blk-mq.c | 9 + block/blk-mq.h | 6 -- 3 files changed, 8 insertions(+), 11

[PATCH V12 2/3] blk-mq: issue directly with bypass 'false' in blk_mq_sched_insert_requests

2018-12-09 Thread Jianchao Wang
blk_mq_try_issue_directly can handle it well.If request is direct-issued unsuccessfully, insert the reset. Signed-off-by: Jianchao Wang --- block/blk-mq-sched.c | 8 +++- block/blk-mq.c | 20 +--- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/block/blk-mq-sched.c b/block

[PATCH V12 3/3] blk-mq: replace and kill blk_mq_request_issue_directly

2018-12-09 Thread Jianchao Wang
Replace blk_mq_request_issue_directly with blk_mq_try_issue_directly in blk_insert_cloned_request and kill it as nobody uses it any more. Signed-off-by: Jianchao Wang --- block/blk-core.c | 4 +++- block/blk-mq.c | 9 + block/blk-mq.h | 6 -- 3 files changed, 8 insertions(+), 11

[PATCH V12 0/3] blk-mq: refactor code of issue directly

2018-12-09 Thread Jianchao Wang
_rq and bypass_insert (1/4) - Add the 2nd patch. It introduce a new decision result which indicates to insert request with blk_mq_request_bypass_insert. - Modify the code to adapt the new patch 1. V2: - Add 1st and 2nd patch to refactor the code. Jianchao Wang (3) blk-mq: refactor the code of is

[PATCH V12 1/3] blk-mq: refactor the code of issue request directly

2018-12-09 Thread Jianchao Wang
needn't any other handling any more and then code could be cleaned up. Signed-off-by: Jianchao Wang --- block/blk-mq.c | 104 ++--- 1 file changed, 55 insertions(+), 49 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index b645275

[PATCH V11 4/4] blk-mq: replace and kill blk_mq_request_issue_directly

2018-12-06 Thread Jianchao Wang
Replace blk_mq_request_issue_directly with blk_mq_try_issue_directly in blk_insert_cloned_request and kill it as nobody uses it any more. Signed-off-by: Jianchao Wang --- block/blk-core.c | 4 +++- block/blk-mq.c | 9 + block/blk-mq.h | 6 -- 3 files changed, 8 insertions(+), 11

[PATCH V11 1/4] blk-mq: insert to hctx dispatch list when bypass_insert is true

2018-12-06 Thread Jianchao Wang
-read-write request to hctx dispatch list to avoid to involve merge and io scheduler when bypass_insert is true. Signed-off-by: Jianchao Wang --- block/blk-mq.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 9005505

[PATCH V11 0/4] blk-mq: refactor code of issue directly

2018-12-06 Thread Jianchao Wang
ert request with blk_mq_request_bypass_insert. - Modify the code to adapt the new patch 1. V2: - Add 1st and 2nd patch to refactor the code. Jianchao Wang (4) blk-mq: insert to hctx dispatch list when blk-mq: refactor the code of issue request directly blk-mq: issue directly with bypass 'false' in

[PATCH V11 2/4] blk-mq: refactor the code of issue request directly

2018-12-06 Thread Jianchao Wang
needn't any other handling any more and then code could be cleaned up. Signed-off-by: Jianchao Wang --- block/blk-mq.c | 120 - 1 file changed, 59 insertions(+), 61 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 01802bf

[PATCH V11 3/4] blk-mq: issue directly with bypass 'false' in blk_mq_sched_insert_requests

2018-12-06 Thread Jianchao Wang
blk_mq_try_issue_directly can handle it well.If request is direct-issued unsuccessfully, insert the reset. Signed-off-by: Jianchao Wang --- block/blk-mq-sched.c | 8 +++- block/blk-mq.c | 29 ++--- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/block/blk-mq-sched.c b

[PATCH V2 2/4] blk-mq: change gfp flags to GFP_NOIO in blk_mq_realloc_hw_ctxs

2018-10-12 Thread Jianchao Wang
blk_mq_realloc_hw_ctxs could be invoked during update hw queues. At the momemt, IO is blocked. Change the gfp flags from GFP_KERNEL to GFP_NOIO to avoid forever hang during memory allocation in blk_mq_realloc_hw_ctxs. Signed-off-by: Jianchao Wang --- block/blk-core.c | 2 +- block/blk-flush.c

[PATCH V2 4/4] blk-mq: fallback to previous nr_hw_queues when updating fails

2018-10-12 Thread Jianchao Wang
irq affinity to map hw and cpu, fallback nr_hw_queues will cause lack of some cpu's map to hw, so use default blk_mq_map_queues to do that. Reported-by: syzbot+83e8cbe702263932d...@syzkaller.appspotmail.com Signed-off-by: Jianchao Wang --- block/blk-mq.c | 27 --- 1 file chan

[PATCH V2 2/4] blk-mq: change gfp flags to GFP_NOIO in blk_mq_realloc_hw_ctxs

2018-10-12 Thread Jianchao Wang
blk_mq_realloc_hw_ctxs could be invoked during update hw queues. At the momemt, IO is blocked. Change the gfp flags from GFP_KERNEL to GFP_NOIO to avoid forever hang during memory allocation in blk_mq_realloc_hw_ctxs. Signed-off-by: Jianchao Wang --- block/blk-core.c | 2 +- block/blk-flush.c

[PATCH V2 4/4] blk-mq: fallback to previous nr_hw_queues when updating fails

2018-10-12 Thread Jianchao Wang
irq affinity to map hw and cpu, fallback nr_hw_queues will cause lack of some cpu's map to hw, so use default blk_mq_map_queues to do that. Reported-by: syzbot+83e8cbe702263932d...@syzkaller.appspotmail.com Signed-off-by: Jianchao Wang --- block/blk-mq.c | 27 --- 1 file chan

[PATCH V2 0/2] blk-mq: some fixes about updating hw queues

2018-10-12 Thread Jianchao Wang
leak mapping of some cpus due the fallback nr_hw_queues. - Add Ming's Reviewed-by in 1st patch. Jianchao Wang[4] blk-mq: adjust debugfs and sysfs register when blk-mq: change gfp flags to GFP_NOIO in blk-mq: realloc hctx when hw queue is mapped to blk-mq: fallback to previous nr_hw_queues when

[PATCH V2 0/2] blk-mq: some fixes about updating hw queues

2018-10-12 Thread Jianchao Wang
leak mapping of some cpus due the fallback nr_hw_queues. - Add Ming's Reviewed-by in 1st patch. Jianchao Wang[4] blk-mq: adjust debugfs and sysfs register when blk-mq: change gfp flags to GFP_NOIO in blk-mq: realloc hctx when hw queue is mapped to blk-mq: fallback to previous nr_hw_queues when

[PATCH] scsi: qla2xxx: reduce time granularity of qla2x00_eh_wait_on_command

2018-09-10 Thread Jianchao Wang
recovery works. Change the granularity to 1ms, even though more context switches would be introduced, but it should be ok as it is not hot path. Signed-off-by: Jianchao Wang --- drivers/scsi/qla2xxx/qla_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx

[PATCH] scsi: qla2xxx: reduce time granularity of qla2x00_eh_wait_on_command

2018-09-10 Thread Jianchao Wang
recovery works. Change the granularity to 1ms, even though more context switches would be introduced, but it should be ok as it is not hot path. Signed-off-by: Jianchao Wang --- drivers/scsi/qla2xxx/qla_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx

[PATCH V2] nvme-pci: move nvme_kill_queues to nvme_remove_dead_ctrl

2018-06-19 Thread Jianchao Wang
emove do nothing -> blk_cleanup_queue -> blk_freeze_queue Finally, the request_queue is quiesced state when wait freeze, we will get io hang here. To fix it, move the nvme_kill_queues from nvme_remove_dead_ctrl_work to nvme_remove_dead_ctrl. Suggested-by: Keith Busch S

[PATCH V2] nvme-pci: move nvme_kill_queues to nvme_remove_dead_ctrl

2018-06-19 Thread Jianchao Wang
emove do nothing -> blk_cleanup_queue -> blk_freeze_queue Finally, the request_queue is quiesced state when wait freeze, we will get io hang here. To fix it, move the nvme_kill_queues from nvme_remove_dead_ctrl_work to nvme_remove_dead_ctrl. Suggested-by: Keith Busch S

[PATCH] nvme-pci: not invoke nvme_remove_dead_ctrl when change state fails

2018-06-19 Thread Jianchao Wang
state in nvme_reset_work, the only reason is someone has changed state to DELETING. So it is not necessary to invoke nvme_remove_dead_ctrl in that case. Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/d

[PATCH] nvme-pci: not invoke nvme_remove_dead_ctrl when change state fails

2018-06-19 Thread Jianchao Wang
state in nvme_reset_work, the only reason is someone has changed state to DELETING. So it is not necessary to invoke nvme_remove_dead_ctrl in that case. Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/d

[PATCH 1/2] nvme-pci: set nvmeq->cq_vector after alloc cq/sq

2018-05-24 Thread Jianchao Wang
to fix this. Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- drivers/nvme/host/pci.c | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 17a0190..70b79f2 100644 --- a/drivers/nvm

[PATCH 1/2] nvme-pci: set nvmeq->cq_vector after alloc cq/sq

2018-05-24 Thread Jianchao Wang
to fix this. Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 17a0190..70b79f2 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host

[PATCH 2/2] nvme-pci: don't send delete cq command when allocate sq return -EINTR

2018-05-24 Thread Jianchao Wang
. Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- drivers/nvme/host/pci.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 70b79f2..4ce1c89 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host

[PATCH 2/2] nvme-pci: don't send delete cq command when allocate sq return -EINTR

2018-05-24 Thread Jianchao Wang
. Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 70b79f2..4ce1c89 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1478,7 +1478,15

[PATCH] scsi: qla2xxx: reduce the time granularity of the qla2x00_eh_wait_on_command

2018-05-24 Thread Jianchao Wang
, ocfs2 heartbeat, etc, just before scsi recovery work completes and get back the HBA. Change the granularity to 1ms, even though more context switches would be introduced, but it should be ok as it is not hot path. Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- drivers/scsi/q

[PATCH] scsi: qla2xxx: reduce the time granularity of the qla2x00_eh_wait_on_command

2018-05-24 Thread Jianchao Wang
, ocfs2 heartbeat, etc, just before scsi recovery work completes and get back the HBA. Change the granularity to 1ms, even though more context switches would be introduced, but it should be ok as it is not hot path. Signed-off-by: Jianchao Wang --- drivers/scsi/qla2xxx/qla_os.c | 2 +- 1 file

[PATCH V3] nvme-rdma: stop queue first before free it in config admin queue

2018-05-23 Thread Jianchao Wang
x24/0x30 To fix it, call nvme_rdma_stop_queue for all the failed cases after nvme_rdma_start_queue. Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> Suggested-by: Sagi Grimberg <s...@grimberg.me> Reviewed-by: Max Gurtovoy <m...@mellanox.com> --- V3: add Suggested-by Sagi

[PATCH V3] nvme-rdma: stop queue first before free it in config admin queue

2018-05-23 Thread Jianchao Wang
x24/0x30 To fix it, call nvme_rdma_stop_queue for all the failed cases after nvme_rdma_start_queue. Signed-off-by: Jianchao Wang Suggested-by: Sagi Grimberg Reviewed-by: Max Gurtovoy --- V3: add Suggested-by Sagi V2: based on Sagi's suggestion, add out_stop_queue lable and inv

[PATCH V2 1/2] blk-mq: abstract out blk-mq-sched rq list iteration bio merge helper

2018-05-23 Thread Jianchao Wang
From: Jens Axboe No functional changes in this patch, just a prep patch for utilizing this in an IO scheduler. Signed-off-by: Jens Axboe --- block/blk-mq-sched.c | 34 -- include/linux/blk-mq.h | 3 ++- 2 files changed, 26

[PATCH V2 1/2] blk-mq: abstract out blk-mq-sched rq list iteration bio merge helper

2018-05-23 Thread Jianchao Wang
From: Jens Axboe No functional changes in this patch, just a prep patch for utilizing this in an IO scheduler. Signed-off-by: Jens Axboe --- block/blk-mq-sched.c | 34 -- include/linux/blk-mq.h | 3 ++- 2 files changed, 26 insertions(+), 11 deletions(-)

[PATCH V2 0/2] block: kyber: make kyber more friendly with merging

2018-05-23 Thread Jianchao Wang
. - allocate kcqs per khd Jens Axboe (1) 0001-blk-mq-abstract-out-blk-mq-sched-rq-list-iteration-b.patch Jianchao Wang (1) 0002-block-kyber-make-kyber-more-friendly-with-merging.patch block/blk-mq-sched.c | 34 ++--- block/kyber-iosched.c | 197

[PATCH V2 2/2] block: kyber: make kyber more friendly with merging

2018-05-23 Thread Jianchao Wang
each 1662MB/s and 425k on my platform. Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> Tested-by: Holger Hoffstätte <hol...@applied-asynchrony.com> --- block/kyber-iosched.c | 197 +- 1 file changed, 162 insertions(+), 35 deletion

[PATCH V2 0/2] block: kyber: make kyber more friendly with merging

2018-05-23 Thread Jianchao Wang
. - allocate kcqs per khd Jens Axboe (1) 0001-blk-mq-abstract-out-blk-mq-sched-rq-list-iteration-b.patch Jianchao Wang (1) 0002-block-kyber-make-kyber-more-friendly-with-merging.patch block/blk-mq-sched.c | 34 ++--- block/kyber-iosched.c | 197

[PATCH V2 2/2] block: kyber: make kyber more friendly with merging

2018-05-23 Thread Jianchao Wang
each 1662MB/s and 425k on my platform. Signed-off-by: Jianchao Wang Tested-by: Holger Hoffstätte --- block/kyber-iosched.c | 197 +- 1 file changed, 162 insertions(+), 35 deletions(-) diff --git a/block/kyber-iosched.c b/block/kyber-iosched.c i

[PATCH] block: kyber: make kyber more friendly with merging

2018-05-22 Thread Jianchao Wang
0/0 | +--+ | w/ | 1083/616 | 277k/154k | 4.93/6.95 | 1830.62/3279.95 | 223k/3k | +--+ When set numjobs to 16, the bw and iops could reach 1662MB/s and 425k on my platform. Signed-off-by: Jianchao Wang <jianchao.w.w...@ora

[PATCH] block: kyber: make kyber more friendly with merging

2018-05-22 Thread Jianchao Wang
0/0 | +--+ | w/ | 1083/616 | 277k/154k | 4.93/6.95 | 1830.62/3279.95 | 223k/3k | +--+ When set numjobs to 16, the bw and iops could reach 1662MB/s and 425k on my platform. Signed-off-by: Jianchao Wang --- block/kyber-iosch

[PATCH] blk-mq: add plug trace event for multiple hw queues case

2018-05-22 Thread Jianchao Wang
There is no plug trace event for multiple hw queues. This is confusing when check block trace event log and find unplug one there. Add plug trace event when request is added to a empty plug list. Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- block/blk-mq.c | 3 +++ 1 file c

[PATCH] blk-mq: add plug trace event for multiple hw queues case

2018-05-22 Thread Jianchao Wang
There is no plug trace event for multiple hw queues. This is confusing when check block trace event log and find unplug one there. Add plug trace event when request is added to a empty plug list. Signed-off-by: Jianchao Wang --- block/blk-mq.c | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH] md: zero the original position of sb for 0.90 and 1.0

2018-05-16 Thread Jianchao Wang
. applications have to take some workarounds such as sync_min/max to avoid resync. It is easy and convevient for md to zero the older sb position after write sb to new position, so do it here. Cc: robert.but...@oracle.com Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- drivers/md/md.

[PATCH] md: zero the original position of sb for 0.90 and 1.0

2018-05-16 Thread Jianchao Wang
. applications have to take some workarounds such as sync_min/max to avoid resync. It is easy and convevient for md to zero the older sb position after write sb to new position, so do it here. Cc: robert.but...@oracle.com Signed-off-by: Jianchao Wang --- drivers/md/md.c | 27

[PATCH V2] nvme-rdma: stop queue first before free it in config admin queue

2018-05-10 Thread Jianchao Wang
x24/0x30 To fix it, call nvme_rdma_stop_queue for all the failed cases after nvme_rdma_start_queue. Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- V2: based on Sagi's suggestion, add out_stop_queue lable and invoke nvme_rdma_stop_queue in all the failed ca

[PATCH V2] nvme-rdma: stop queue first before free it in config admin queue

2018-05-10 Thread Jianchao Wang
x24/0x30 To fix it, call nvme_rdma_stop_queue for all the failed cases after nvme_rdma_start_queue. Signed-off-by: Jianchao Wang --- V2: based on Sagi's suggestion, add out_stop_queue lable and invoke nvme_rdma_stop_queue in all the failed cases after nvme_rdma_start_queue drivers/nvme/host/rdm

[PATCH V2] nvme-rdma: fix double free in nvme_rdma_free_queue

2018-05-10 Thread Jianchao Wang
ctrl_work -> nvme_rdma_shutdown_ctrl ->nvme_rdma_destroy_admin_queue -> nvme_rdma_free_queue Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- V2: handle it in nvme_rdma_free_queue and add some comment to explain it. drivers/nvme/host/rdma.c | 15 --- 1 file changed, 12 in

[PATCH V2] nvme-rdma: fix double free in nvme_rdma_free_queue

2018-05-10 Thread Jianchao Wang
ctrl_work -> nvme_rdma_shutdown_ctrl ->nvme_rdma_destroy_admin_queue -> nvme_rdma_free_queue Signed-off-by: Jianchao Wang --- V2: handle it in nvme_rdma_free_queue and add some comment to explain it. drivers/nvme/host/rdma.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) di

[PATCH V2] nvme-rdma: stop queue first before free it in config admin queue

2018-05-10 Thread Jianchao Wang
x24/0x30 To fix it, call nvme_rdma_stop_queue for all the failed cases after nvme_rdma_start_queue. Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- drivers/nvme/host/rdma.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/rdma.c

[PATCH V2] nvme-rdma: stop queue first before free it in config admin queue

2018-05-10 Thread Jianchao Wang
x24/0x30 To fix it, call nvme_rdma_stop_queue for all the failed cases after nvme_rdma_start_queue. Signed-off-by: Jianchao Wang --- drivers/nvme/host/rdma.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c in

[PATCH] nvme-rdma: clear NVME_RDMA_Q_LIVE before free the queue

2018-05-04 Thread Jianchao Wang
x30 To fix it, clear the NVME_RDMA_Q_LIVE before free the ctrl->queues[0]. The queue will be freed, so it certainly is not LIVE any more. Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- drivers/nvme/host/rdma.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/nvme

[PATCH] nvme-rdma: clear NVME_RDMA_Q_LIVE before free the queue

2018-05-04 Thread Jianchao Wang
x30 To fix it, clear the NVME_RDMA_Q_LIVE before free the ctrl->queues[0]. The queue will be freed, so it certainly is not LIVE any more. Signed-off-by: Jianchao Wang --- drivers/nvme/host/rdma.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/

[PATCH] nvme: fix use-after-free in nvme_free_ns_head

2018-05-04 Thread Jianchao Wang
/0x380 task_work_run+0xaf/0xe0 do_exit+0x501/0x1440 do_group_exit+0x89/0x140 __x64_sys_exit_group+0x28/0x30 do_syscall_64+0x72/0x230 Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- drivers/nvme/host/core.c | 5 + 1 file changed, 5 insertions(+) diff --git a/driver

[PATCH] nvme-rdma: fix double free in nvme_rdma_free_queue

2018-05-04 Thread Jianchao Wang
down_ctrl ->nvme_rdma_destroy_admin_queue -> nvme_rdma_free_queue Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- drivers/nvme/host/rdma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index a0ead1d..fd965d0 100644 --- a/drivers/n

[PATCH] nvme: fix use-after-free in nvme_free_ns_head

2018-05-04 Thread Jianchao Wang
/0x380 task_work_run+0xaf/0xe0 do_exit+0x501/0x1440 do_group_exit+0x89/0x140 __x64_sys_exit_group+0x28/0x30 do_syscall_64+0x72/0x230 Signed-off-by: Jianchao Wang --- drivers/nvme/host/core.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme

[PATCH] nvme-rdma: fix double free in nvme_rdma_free_queue

2018-05-04 Thread Jianchao Wang
down_ctrl ->nvme_rdma_destroy_admin_queue -> nvme_rdma_free_queue Signed-off-by: Jianchao Wang --- drivers/nvme/host/rdma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index a0ead1d..fd965d0 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/n

[PATCH] IB/rxe: add RXE_START_MASK for rxe_opcode IB_OPCODE_RC_SEND_ONLY_INV

2018-04-25 Thread Jianchao Wang
with last_psn 0 is still there. This causes large amount of io timeout when nvmeof is over rxe. Add RXE_START_MASK for IB_OPCODE_RC_SEND_ONLY_INV to fix this. Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- drivers/infiniband/sw/rxe/rxe_opcode.c | 2 +- 1 file changed, 1 ins

[PATCH] IB/rxe: add RXE_START_MASK for rxe_opcode IB_OPCODE_RC_SEND_ONLY_INV

2018-04-25 Thread Jianchao Wang
with last_psn 0 is still there. This causes large amount of io timeout when nvmeof is over rxe. Add RXE_START_MASK for IB_OPCODE_RC_SEND_ONLY_INV to fix this. Signed-off-by: Jianchao Wang --- drivers/infiniband/sw/rxe/rxe_opcode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] nvme: unquiesce the queue before cleaup it

2018-04-19 Thread Jianchao Wang
t_queue directly before nvme_ns_remove. We have spliced the ctrl->namespaces, so nobody could access them and quiesce the queue any more. Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- drivers/nvme/host/core.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) d

[PATCH] nvme: unquiesce the queue before cleaup it

2018-04-19 Thread Jianchao Wang
t_queue directly before nvme_ns_remove. We have spliced the ctrl->namespaces, so nobody could access them and quiesce the queue any more. Signed-off-by: Jianchao Wang --- drivers/nvme/host/core.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/co

[PATCH] nvme: fix the suspicious RCU usage warning in nvme_mpath_clear_current_path

2018-04-18 Thread Jianchao Wang
With lockdep enabled, when trigger nvme_remove, suspicious RCU usage warning will be printed out. Fix it with adding srcu_read_lock/unlock in it. Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- drivers/nvme/host/nvme.h | 9 +++-- 1 file changed, 7 insertions(+), 2 del

[PATCH] nvme: fix the suspicious RCU usage warning in nvme_mpath_clear_current_path

2018-04-18 Thread Jianchao Wang
With lockdep enabled, when trigger nvme_remove, suspicious RCU usage warning will be printed out. Fix it with adding srcu_read_lock/unlock in it. Signed-off-by: Jianchao Wang --- drivers/nvme/host/nvme.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/nvme

[PATCH] blk-mq: start request gstate with gen 1

2018-04-16 Thread Jianchao Wang
. Cc: Bart Van Assche <bart.vanass...@wdc.com> Cc: Tejun Heo <t...@kernel.org> Cc: Ming Lei <ming@redhat.com> Cc: Martin Steigerwald <mar...@lichtvoll.de> Cc: sta...@vger.kernel.org Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- block/blk-core.c |

[PATCH] blk-mq: start request gstate with gen 1

2018-04-16 Thread Jianchao Wang
. Cc: Bart Van Assche Cc: Tejun Heo Cc: Ming Lei Cc: Martin Steigerwald Cc: sta...@vger.kernel.org Signed-off-by: Jianchao Wang --- block/blk-core.c | 4 block/blk-mq.c | 7 +++ 2 files changed, 11 insertions(+) diff --git a/block/blk-core.c b/block/blk-core.c index abcb868.

[PATCH] blk-mq: start request gstate with gen 1

2018-04-16 Thread Jianchao Wang
. Cc: Bart Van Assche <bart.vanass...@wdc.com> Cc: Tejun Heo <t...@kernel.org> Cc: Ming Lei <ming@redhat.com> Cc: Martin Steigerwald <mar...@lichtvoll.de> Cc: sta...@vger.kernel.org Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- block/blk-core.c |

[PATCH] blk-mq: start request gstate with gen 1

2018-04-16 Thread Jianchao Wang
. Cc: Bart Van Assche Cc: Tejun Heo Cc: Ming Lei Cc: Martin Steigerwald Cc: sta...@vger.kernel.org Signed-off-by: Jianchao Wang --- block/blk-core.c | 4 block/blk-mq.c | 7 +++ 2 files changed, 11 insertions(+) diff --git a/block/blk-core.c b/block/blk-core.c index abcb868.

[PATCH] blk-mq: mark hctx RESTART when get budget fails

2018-04-16 Thread Jianchao Wang
When get budget fails, blk_mq_sched_dispatch_requests does not do anything to ensure the hctx to be restarted. We can survive from this, because only the scsi implements .get_budget and it always runs the hctx queues when request is completed. Signed-off-by: Jianchao Wang <jianchao.

[PATCH] blk-mq: mark hctx RESTART when get budget fails

2018-04-16 Thread Jianchao Wang
When get budget fails, blk_mq_sched_dispatch_requests does not do anything to ensure the hctx to be restarted. We can survive from this, because only the scsi implements .get_budget and it always runs the hctx queues when request is completed. Signed-off-by: Jianchao Wang --- block/blk-mq

[PATCH] scsi: qla2xxx: reduce the time granularity of qla2x00_eh_wait_on_command

2018-04-10 Thread Jianchao Wang
recovery works. Change the granularity to 1ms, even though more context switches would be introduced, but it should be ok as it is not hot path. Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- drivers/scsi/qla2xxx/qla_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH] scsi: qla2xxx: reduce the time granularity of qla2x00_eh_wait_on_command

2018-04-10 Thread Jianchao Wang
recovery works. Change the granularity to 1ms, even though more context switches would be introduced, but it should be ok as it is not hot path. Signed-off-by: Jianchao Wang --- drivers/scsi/qla2xxx/qla_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx

[PATCH] blk-throttle: only update last_low_overflow_time when LIMIT_MAX

2018-04-09 Thread Jianchao Wang
not update last_low_overflow_time at the moment. Otherwise, it will be hard to upgrade limit_index when there is always bios to be submitted. Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> --- block/blk-throttle.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

[PATCH] blk-throttle: only update last_low_overflow_time when LIMIT_MAX

2018-04-09 Thread Jianchao Wang
not update last_low_overflow_time at the moment. Otherwise, it will be hard to upgrade limit_index when there is always bios to be submitted. Signed-off-by: Jianchao Wang --- block/blk-throttle.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block/blk-throttle.c b/block

[PATCH] blk-throttle: discard stale last_low_overflow_time

2018-04-09 Thread Jianchao Wang
bps/iops are indeed lower than low limit, return 0 as the last_low_overflow_time which indicates it is stale. We will discard the stale last_low_overflow_time, but if both types are stale, return 0, Otherwise, the cgroups which don't have any traffic will prevent upgrade. Signed-off-by: Jianchao

[PATCH] blk-throttle: discard stale last_low_overflow_time

2018-04-09 Thread Jianchao Wang
bps/iops are indeed lower than low limit, return 0 as the last_low_overflow_time which indicates it is stale. We will discard the stale last_low_overflow_time, but if both types are stale, return 0, Otherwise, the cgroups which don't have any traffic will prevent upgrade. Signed-off-by: Jianchao

[PATCH V3] nvme-pci: assign separate irq vectors for adminq and ioq1

2018-03-13 Thread Jianchao Wang
the first one to adminq which will have affinity cpumask with all possible cpus. On the other hand, if controller has only legacy or single -message MSI, we will setup adminq and 1 ioq and let them share the only one irq vector. Signed-off-by: Jianchao Wang <jianchao.w.w...@oracle.com> ---

  1   2   3   >