Re: [PATCH 05/14] blk-mq-sched: don't dequeue request until all in ->dispatch are flushed

2017-07-31 Thread Bart Van Assche
On Tue, 2017-08-01 at 00:51 +0800, Ming Lei wrote: > During dispatch, we moved all requests from hctx->dispatch to > one temporary list, then dispatch them one by one from this list. > Unfortunately duirng this period, run queue from other contexts > may think the queue is idle and start to

Re: [PATCH 04/14] blk-mq-sched: improve dispatching from sw queue

2017-07-31 Thread Bart Van Assche
On Tue, 2017-08-01 at 00:51 +0800, Ming Lei wrote: > SCSI devices use host-wide tagset, and the shared > driver tag space is often quite big. Meantime > there is also queue depth for each lun(.cmd_per_lun), > which is often small. > > So lots of requests may stay in sw queue, and we > always

Re: [PATCH 03/14] blk-mq: introduce blk_mq_dispatch_rq_from_ctxs()

2017-07-31 Thread Bart Van Assche
On Tue, 2017-08-01 at 00:51 +0800, Ming Lei wrote: > @@ -810,7 +810,11 @@ static void blk_mq_timeout_work(struct work_struct *work) > > struct ctx_iter_data { > struct blk_mq_hw_ctx *hctx; > - struct list_head *list; > + > + union { > + struct list_head *list; > +

Re: [PATCH 02/14] blk-mq: rename flush_busy_ctx_data as ctx_iter_data

2017-07-31 Thread Bart Van Assche
On Tue, 2017-08-01 at 00:50 +0800, Ming Lei wrote: > The following patch need to reuse this data structure, > so rename as one generic name. Hello Ming, Please drop this patch (see also my comments on the next patch). Thanks, Bart.

Re: [PATCH 01/14] blk-mq-sched: fix scheduler bad performance

2017-07-31 Thread Bart Van Assche
On Tue, 2017-08-01 at 00:50 +0800, Ming Lei wrote: > When hw queue is busy, we shouldn't take requests from > scheduler queue any more, otherwise IO merge will be > difficult to do. > > This patch fixes the awful IO performance on some > SCSI devices(lpfc, qla2xxx, ...) when mq-deadline/kyber >

[PATCH 14/14] blk-mq-sched: improve IO scheduling on SCSI devcie

2017-07-31 Thread Ming Lei
SCSI device often has per-request_queue queue depth (.cmd_per_lun), which is applied among all hw queues actually, and this patchset calls this as shared queue depth. One theory of scheduler is that we shouldn't dequeue request from sw/scheduler queue and dispatch it to driver when the low level

[PATCH 13/14] blk-mq: pass 'request_queue *' to several helpers of operating BUSY

2017-07-31 Thread Ming Lei
We need to support per-request_queue dispatch list for avoiding early dispatch in case of shared queue depth. Signed-off-by: Ming Lei --- block/blk-mq-sched.c | 6 +++--- block/blk-mq.h | 15 +-- 2 files changed, 12 insertions(+), 9 deletions(-) diff

[PATCH 12/14] blk-mq: introduce pointers to dispatch lock & list

2017-07-31 Thread Ming Lei
Prepare to support per-request-queue dispatch list, so introduce dispatch lock and list for avoiding to do runtime check. Signed-off-by: Ming Lei --- block/blk-mq-debugfs.c | 10 +- block/blk-mq.c | 7 +-- block/blk-mq.h | 26

[PATCH 11/14] blk-mq: introduce helpers for operating ->dispatch list

2017-07-31 Thread Ming Lei
Signed-off-by: Ming Lei --- block/blk-mq-sched.c | 19 +++ block/blk-mq.c | 18 +++--- block/blk-mq.h | 44 3 files changed, 58 insertions(+), 23 deletions(-) diff --git

[PATCH 10/14] blk-mq-sched: introduce helpers for query, change busy state

2017-07-31 Thread Ming Lei
Signed-off-by: Ming Lei --- block/blk-mq-sched.c | 6 +++--- block/blk-mq.h | 15 +++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index 07ff53187617..112270961af0 100644 ---

[PATCH 07/14] blk-mq-sched: use q->queue_depth as hint for q->nr_requests

2017-07-31 Thread Ming Lei
SCSI sets q->queue_depth from shost->cmd_per_lun, and q->queue_depth is per request_queue and more related to scheduler queue compared with hw queue depth, which can be shared by queues, such as TAG_SHARED. This patch trys to use q->queue_depth as hint for computing q->nr_requests, which should

[PATCH 09/14] blk-mq-sched: cleanup blk_mq_sched_dispatch_requests()

2017-07-31 Thread Ming Lei
This patch split blk_mq_sched_dispatch_requests() into two parts: 1) the 1st part is for checking if queue is busy, and handle the busy situation 2) the 2nd part is moved to __blk_mq_sched_dispatch_requests() which focuses on dispatch from sw queue or scheduler queue. Signed-off-by: Ming Lei

[PATCH 08/14] blk-mq: introduce BLK_MQ_F_SHARED_DEPTH

2017-07-31 Thread Ming Lei
SCSI devices often provides one per-requeest_queue depth via q->queue_depth(.cmd_per_lun), which is a global limit on all hw queues. After the pending I/O submitted to one rquest queue reaches this limit, BLK_STS_RESOURCE will be returned to all dispatch path. That means when one hw queue is

[PATCH 06/14] blk-mq-sched: introduce blk_mq_sched_queue_depth()

2017-07-31 Thread Ming Lei
The following patch will propose some hints to figure out default queue depth for scheduler queue, so introduce helper of blk_mq_sched_queue_depth() for this purpose. Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- block/blk-mq-sched.c | 8 +---

[PATCH 05/14] blk-mq-sched: don't dequeue request until all in ->dispatch are flushed

2017-07-31 Thread Ming Lei
During dispatch, we moved all requests from hctx->dispatch to one temporary list, then dispatch them one by one from this list. Unfortunately duirng this period, run queue from other contexts may think the queue is idle and start to dequeue from sw/scheduler queue and try to dispatch because

[PATCH 04/14] blk-mq-sched: improve dispatching from sw queue

2017-07-31 Thread Ming Lei
SCSI devices use host-wide tagset, and the shared driver tag space is often quite big. Meantime there is also queue depth for each lun(.cmd_per_lun), which is often small. So lots of requests may stay in sw queue, and we always flush all belonging to same hw queue and dispatch them all to driver,

[PATCH 03/14] blk-mq: introduce blk_mq_dispatch_rq_from_ctxs()

2017-07-31 Thread Ming Lei
This function is introduced for picking up request from sw queue so that we can dispatch in scheduler's way. More importantly, for some SCSI devices, driver tags are host wide, and the number is quite big, but each lun has very limited queue depth. This function is introduced for avoiding to take

[PATCH 02/14] blk-mq: rename flush_busy_ctx_data as ctx_iter_data

2017-07-31 Thread Ming Lei
The following patch need to reuse this data structure, so rename as one generic name. Signed-off-by: Ming Lei --- block/blk-mq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index b70a4ad78b63..94818f78c099 100644

[PATCH 01/14] blk-mq-sched: fix scheduler bad performance

2017-07-31 Thread Ming Lei
When hw queue is busy, we shouldn't take requests from scheduler queue any more, otherwise IO merge will be difficult to do. This patch fixes the awful IO performance on some SCSI devices(lpfc, qla2xxx, ...) when mq-deadline/kyber is used by not taking requests if hw queue is busy.

[PATCH 00/14] blk-mq-sched: fix SCSI-MQ performance regression

2017-07-31 Thread Ming Lei
In Red Hat internal storage test wrt. blk-mq scheduler, we found that its performance is quite bad, especially about sequential I/O on some multi-queue SCSI devcies. Turns out one big issue causes the performance regression: requests are still dequeued from sw queue/scheduler queue even when

[PATCH 00/14] blk-mq-sched: fix SCSI-MQ performance regression

2017-07-31 Thread Ming Lei
In Red Hat internal storage test wrt. blk-mq scheduler, we found that its performance is quite bad, especially about sequential I/O on some multi-queue SCSI devcies. Turns out one big issue causes the performance regression: requests are still dequeued from sw queue/scheduler queue even when

Re: [PATCH 4/6 v2] mmc: block: move single ioctl() commands to block requests

2017-07-31 Thread Linus Walleij
On Wed, Jul 5, 2017 at 9:00 PM, Christoph Hellwig wrote: > On Thu, May 18, 2017 at 11:36:14AM +0200, Christoph Hellwig wrote: >> On Thu, May 18, 2017 at 11:29:34AM +0200, Linus Walleij wrote: >> > We are storing the ioctl() in/out argument as a pointer in >> > the per-request struct

Re: blk_mq_sched_insert_request: inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage

2017-07-31 Thread Michael Ellerman
Brian King writes: > On 07/28/2017 10:17 AM, Brian J King wrote: >> Jens Axboe wrote on 07/28/2017 09:25:48 AM: >> >>> Can you try the below fix? Should be more palatable than the previous >>> one. Brian, maybe you can take a look at the IRQ issue