[PATCH V3 1/2] nvme: split resetting state into reset_prepate and resetting

2018-01-10 Thread Jianchao Wang
oph Hellwig Signed-off-by: Jianchao Wang --- drivers/nvme/host/core.c | 17 +++-- drivers/nvme/host/fc.c | 2 ++ drivers/nvme/host/nvme.h | 1 + drivers/nvme/host/pci.c| 28 ++-- drivers/nvme/host/rdma.c | 8 drivers/nvme/target/loop.c |

[PATCH V3 2/2] nvme-pci: fix the timeout case when reset is ongoing

2018-01-10 Thread Jianchao Wang
ble the dev itself, so discard the nvme_dev_disable here. 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 e477c35..0530432 100644 --

[PATCH V3 0/2] nvme-pci: fix the timeout case when reset is ongoing

2018-01-10 Thread Jianchao Wang
patch Jianchao Wang(2) 0001-nvme-split-resetting-state-into-reset_prepate-and-re.patch 0002-nvme-pci-fix-the-timeout-case-when-reset-is-ongoing.patch drivers/nvme/host/core.c | 17 ++-- drivers/nvme/host/fc.c | 2 ++ drivers/nvme/host/nvme.h | 1 + drivers/nvme/host/pci.c

[PATCH] nvme-pci: calculate iod and avg_seg_size just before use them

2018-01-10 Thread Jianchao Wang
The calculation of iod and avg_seg_size maybe meaningless if nvme_pci_use_sgls returns before uses them. So calculate just before use them. Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host

[PATCH] net/mlx4_en: ensure rx_desc updating reaches HW before prod db updating

2018-01-11 Thread Jianchao Wang
rx_desc and prod db still could lead to corruption on different inbound packages. Signed-off-by: Jianchao Wang --- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet

[PATCH] nvme-pci: ensure nvme_timeout complete before initializing procedure

2018-01-21 Thread Jianchao Wang
cel the requeue_work. Link: https://lkml.org/lkml/2018/1/19/68 Suggested-by: Keith Busch Signed-off-by: Keith Busch Signed-off-by: Jianchao Wang --- drivers/nvme/host/core.c | 20 ++-- drivers/nvme/host/nvme.h | 1 + drivers/nvme/host/pci.c | 9 - 3 files changed,

[PATCH 1/4] nvme-pci: introduce RECONNECTING state to mark initializing procedure

2018-01-22 Thread Jianchao Wang
some other initializing things. Introduce RECONNECTING to nvme-pci transport to do the same mark. Then we get a coherent state definition among nvme pci/rdma/fc transports. Suggested-by: James Smart Reviewed-by: James Smart Signed-off-by: Jianchao Wang --- drivers/nvme/host/c

[PATCH RESENT] nvme-pci: introduce RECONNECTING state to mark initializing procedure

2018-01-22 Thread Jianchao Wang
some other initializing things. Introduce RECONNECTING to nvme-pci transport to do the same mark. Then we get a coherent state definition among nvme pci/rdma/fc transports. Suggested-by: James Smart Reviewed-by: James Smart Signed-off-by: Jianchao Wang --- drivers/nvme/host/c

[PATCH V3] nvme-pci: fix NULL pointer reference in nvme_alloc_ns

2018-01-04 Thread Jianchao Wang
/WARN_ON_ONCE/ - Other misc code changes V2: - Based on Sagi's suggestion, add new state NVME_CTRL_ADMIN_LIVE. - Change patch name and comment. Suggested-by: Sagi Grimberg Signed-off-by: Jianchao Wang --- drivers/nvme/host/core.c | 25 ++--- drivers/nvme/host/nvme.h | 1 + dr

[PATCH RESENT V3] nvme-pci: fix NULL pointer reference in nvme_alloc_ns

2018-01-05 Thread Jianchao Wang
/WARN_ON_ONCE/ - Other misc code changes V2: - Based on Sagi's suggestion, add new state NVME_CTRL_ADMIN_LIVE. - Change patch name and comment. Suggested-by: Sagi Grimberg Signed-off-by: Jianchao Wang --- drivers/nvme/host/core.c | 25 ++--- drivers/nvme/host/nvme.h | 1 + dr

[PATCH V2 2/2] nvme-pci: fix the timeout case when reset is ongoing

2018-01-08 Thread Jianchao Wang
ble the dev itself, so discard the nvme_dev_disable here. 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 e477c35..2947757 100644 --

[PATCH V2 1/2] nvme: split resetting state into reset_prepate and resetting

2018-01-08 Thread Jianchao Wang
oph Hellwig Signed-off-by: Jianchao Wang --- drivers/nvme/host/core.c | 17 +++-- drivers/nvme/host/fc.c | 2 ++ drivers/nvme/host/nvme.h | 1 + drivers/nvme/host/pci.c| 28 ++-- drivers/nvme/host/rdma.c | 8 drivers/nvme/target/loop.c |

[PATCH V2 0/2] nvme-pci: fix the timeout case when reset is ongoing

2018-01-08 Thread Jianchao Wang
o the comment of the 2nd patch. V2: - split NVME_CTRL_RESETTING into NVME_CTRL_RESET_PREPARE and NVME_CTRL_RESETTING. Introduce new patch based on this. - distinguish the requests based on the new state in nvme_timeout - change comments of patch Jianchao Wang(2) 0001-nvme-split-resetting-state

[PATCH] nvme-pci: use NOWAIT flag for nvme_set_host_mem

2018-01-28 Thread Jianchao Wang
NOWAIT flag. Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 6fe7af0..9532529 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1736,7 +1736,8

[PATCH V4 0/2] nvme-pci: fix the timeout case when reset is ongoing

2018-01-16 Thread Jianchao Wang
meout - change comments of patch Jianchao Wang (2) 0001-nvme-add-NVME_CTRL_RESET_PREPARE-state.patch 0002-nvme-pci-fix-the-timeout-case-when-reset-is-ongoing.patch drivers/nvme/host/core.c | 18 +--- drivers/nvme/host/fc.c | 4 ++-- drivers/nvme/host/nvme.h | 8 +++ drivers/

[PATCH V4 1/2] nvme: add NVME_CTRL_RESET_PREPARE state

2018-01-16 Thread Jianchao Wang
ror recovery work, scheduling gap and disable procedure. After that, - For nvme-pci, nvmet-loop, set state to RESETTING, start initialization. - For nvme-rdma, nvme-fc, set state to RECONNECTING, start initialization or reconnect. Suggested-by: Christoph Hellwig Signed-off-by: Jianchao W

[PATCH V4 2/2] nvme-pci: fix the timeout case when reset is ongoing

2018-01-16 Thread Jianchao Wang
ble the dev itself, so discard the nvme_dev_disable here. Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c | 29 - 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index f4b47b9..f3f6113 100644 --

[PATCH V5 2/2] nvme-pci: fixup the timeout case when reset is ongoing

2018-01-18 Thread Jianchao Wang
ING, handle it as the original method and discard the nvme_dev_disable there, the nvme_reset_work will see the error and invoke itself. Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/nvme

[PATCH V5 1/2] nvme-pci: introduce RECONNECTING state to mark initializing procedure

2018-01-18 Thread Jianchao Wang
some other initializing things. Introduce RECONNECTING to nvme-pci transport to do the same mark. Then we get a coherent state definition among nvme pci/rdma/fc transports. Suggested-by: James Smart Signed-off-by: Jianchao Wang --- drivers/nvme/host/core.c | 2 +- drivers/nvme

[PATCH V5 0/2] nvme-pci: fix the timeout case when reset is ongoing

2018-01-18 Thread Jianchao Wang
Hello Please consider the following scenario. nvme_reset_ctrl -> set state to RESETTING -> queue reset_work (scheduling) nvme_reset_work -> nvme_dev_disable -> quiesce queues -> nvme_cancel_request on outstanding requests ---_boundary_

[PATCH] scsi: iscsi_tcp: set BDI_CAP_STABLE_WRITES when data digest enabled

2018-03-07 Thread Jianchao Wang
st is enabled in iscsi_tcp .slave_configure callback. Signed-off-by: Jianchao Wang --- drivers/scsi/iscsi_tcp.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index 6198559..261c686 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers

[PATCH] blk-throttle: discard stale last_low_overflow_time

2018-04-08 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: Jia

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

2018-04-08 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] 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 V4 2/5] nvme: add helper interface to flush in-flight requests

2018-03-07 Thread Jianchao Wang
completes. More details please refer to the comment of this interface. - nvme_flush_aborted_requests complete the requests 'aborted' by nvme_abort_requests_sync. It will be invoked after the controller is disabled/shutdown. Signed-off-by: Jianchao Wang --- drivers/nvme/host/c

[PATCH V4 5/5] nvme-pci: add the timeout case for DELETEING state

2018-03-07 Thread Jianchao Wang
hang forever. Add case for DELETEING in nvme_timeout, when abort fails, disable the controller and complete the request directly. Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c | 27 +++ 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/nvme

[PATCH V4 3/5] nvme-pci: avoid nvme_dev_disable to be invoked in nvme_timeout

2018-03-07 Thread Jianchao Wang
for this, it doesn't send commands on adminq and the shutdown_lock is not needed here, because the nvme_abort_requests_sync in nvme_dev_disable could synchronize with nvme_timeout. Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c

PATCH V4 0/5 nvme-pci: fixes on nvme_timeout and nvme_dev_disable

2018-03-07 Thread Jianchao Wang
flush in-flight requests in nvme core. 3rd patch is to avoid the nvme_dev_disable in nvme_timeout, it introduce new interface nvme_pci_disable_ctrl_directly and refactor the nvme_timeout 4th~5th is to fix issues introduced after 3rd patch. Jianchao Wang (5) 0001-nvme-do-atomically-bit-operations-o

[PATCH V4 4/5] nvme-pci: discard wait timeout when delete cq/sq

2018-03-07 Thread Jianchao Wang
parallel. Use wait_for_completion instead of the timeout one here. The timeout path is reliable now and will complete the request to wakeup it. Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/nvme/host/pci.c b

[PATCH V4 1/5] nvme: do atomically bit operations on nvme_request.flags

2018-03-07 Thread Jianchao Wang
Do atomically bit operations on nvme_request.flags instead of regular read/write, then we could add other flags and set/clear them safely. Signed-off-by: Jianchao Wang --- drivers/nvme/host/core.c | 4 ++-- drivers/nvme/host/lightnvm.c | 4 ++-- drivers/nvme/host/nvme.h | 4

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

2018-03-13 Thread Jianchao Wang
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 --- V2->V3 - change changelog based on Min

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

2018-12-06 Thread Jianchao Wang
hen caller 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.

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

2018-12-06 Thread Jianchao Wang
patch check, because 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/bl

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

2018-12-06 Thread Jianchao Wang
tch. 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 (4) blk-mq: insert to hctx dispatch list when blk-mq: refactor the code of issu

[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
serting the non-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.

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

2018-12-09 Thread Jianchao Wang
hen caller 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.

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

2018-12-09 Thread Jianchao Wang
rt, end or just return based 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 refac

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

2018-12-09 Thread Jianchao Wang
patch check, because 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/bl

[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 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 V13 0/3] blk-mq: refactor code of issue directly

2018-12-09 Thread Jianchao Wang
mq_make_request is introduced to decide insert, end or just return based 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 ne

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

2018-12-09 Thread Jianchao Wang
patch check, because 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/bl

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

2018-12-09 Thread Jianchao Wang
hen caller 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.

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

2018-05-24 Thread Jianchao Wang
hang. 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 +14

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

2018-05-24 Thread Jianchao Wang
successes 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

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

2018-06-19 Thread Jianchao Wang
ate 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 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 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 V14 0/3] blk-mq: refactor and fix the code of issue directly

2018-12-13 Thread Jianchao Wang
. 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 issue request directly blk-mq: issue directly

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

2018-12-13 Thread Jianchao Wang
d will harm 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 --

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

2018-12-13 Thread Jianchao Wang
patch check, because 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/bl

[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 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 int

[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 2/2] blk-mq: save default hctx into ctx->hctxs for not-supported type

2018-12-26 Thread Jianchao Wang
the 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..1da

[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
tion 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

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

2018-10-12 Thread Jianchao Wang
driver's .map_queues 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 pre

[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 V2 0/2] block: kyber: make kyber more friendly with merging

2018-05-22 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-22 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 V2 1/2] blk-mq: abstract out blk-mq-sched rq list iteration bio merge helper

2018-05-22 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(-) diff

[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 an

[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 V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-02-28 Thread Jianchao Wang
kick_requeue_list == true and put the reference of scsi_device. V1 -> V2: - add put_device on scsi_device->sdev_gendev Cc: Christoph Hellwig Signed-off-by: Jianchao Wang --- drivers/scsi/scsi_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_l

[PATCH V2] nvme-pci: assign separate irq vectors for adminq and ioq0

2018-02-28 Thread Jianchao Wang
add new helper interface nvme_ioq_vector to get ioq vector. V1->V2 - add case to handle the scenario where there is only one irq vector - add nvme_ioq_vector to map ioq vector and qid Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c | 30 ++ 1 file chan

[PATCH V3] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread Jianchao Wang
kick_requeue_list == true and put the reference of scsi_device. Cc: Christoph Hellwig Signed-off-by: Jianchao Wang Reviewed-by: Bart Van Assche --- Changelog: V2 -> V3: - add commit to explain why we need a put_device in __scsi_queue_insert - add reviewed-by V1 -> V2: - add put_dev

[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] 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 a

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

2019-02-10 Thread Jianchao Wang
ue 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

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

2019-02-11 Thread Jianchao Wang
ue 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..9437

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

2019-01-30 Thread Jianchao Wang
o 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/bl

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

2019-01-24 Thread Jianchao Wang
the 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..8a8

[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 int

[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] 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 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 2/8] blk-mq: use static_rqs instead of rqs to iterate tags

2019-03-24 Thread Jianchao Wang
e 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

[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 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 0/8]: blk-mq: use static_rqs to iterate busy tags

2019-03-24 Thread Jianchao Wang
e 8th patch get rid of the 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

[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] 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] 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 V4] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-02 Thread Jianchao Wang
kick_requeue_list == true and put the reference of scsi_device. Cc: Christoph Hellwig Signed-off-by: Jianchao Wang Reviewed-by: Bart Van Assche --- Changelog: V3 -> V4: - modify the comment and make it more clearly V2 -> V3: - add comment to explain why we need a put_dev

[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] nvme-rdma: clear NVME_RDMA_Q_LIVE before free the queue

2018-05-04 Thread Jianchao Wang
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] 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] 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..ce626

[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..ce626

[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 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 --- 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/hos

[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] 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

  1   2   >