From: Ming Lei <ming.lei@redhat.com>
To: Damien Le Moal <Damien.LeMoal@wdc.com>
Cc: Jens Axboe <axboe@kernel.dk>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
Sagi Grimberg <sagi@grimberg.me>,
Baolin Wang <baolin.wang7@gmail.com>,
"hch@infradead.org" <hch@infradead.org>,
Christoph Hellwig <hch@lst.de>,
Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Subject: Re: [PATCH V4 2/6] blk-mq: pass hctx to blk_mq_dispatch_rq_list
Date: Tue, 2 Jun 2020 21:49:45 +0800 [thread overview]
Message-ID: <20200602134945.GA1824688@T590> (raw)
In-Reply-To: <CY4PR04MB375131F4C9F24369D00D0F3CE78B0@CY4PR04MB3751.namprd04.prod.outlook.com>
On Tue, Jun 02, 2020 at 09:39:18AM +0000, Damien Le Moal wrote:
> On 2020/06/02 18:32, Ming Lei wrote:
> > On Tue, Jun 02, 2020 at 09:25:01AM +0000, Damien Le Moal wrote:
> >> On 2020/06/02 18:15, Ming Lei wrote:
> >>> All requests in the 'list' of blk_mq_dispatch_rq_list belong to same
> >>> hctx, so it is better to pass hctx instead of request queue, because
> >>> blk-mq's dispatch target is hctx instead of request queue.
> >>>
> >>> Cc: Sagi Grimberg <sagi@grimberg.me>
> >>> Cc: Baolin Wang <baolin.wang7@gmail.com>
> >>> Cc: Christoph Hellwig <hch@infradead.org>
> >>> Reviewed-by: Christoph Hellwig <hch@lst.de>
> >>> Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
> >>> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> >>> Tested-by: Baolin Wang <baolin.wang7@gmail.com>
> >>> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> >>> ---
> >>> block/blk-mq-sched.c | 14 ++++++--------
> >>> block/blk-mq.c | 6 +++---
> >>> block/blk-mq.h | 2 +-
> >>> 3 files changed, 10 insertions(+), 12 deletions(-)
> >>>
> >>> diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
> >>> index a31e281e9d31..632c6f8b63f7 100644
> >>> --- a/block/blk-mq-sched.c
> >>> +++ b/block/blk-mq-sched.c
> >>> @@ -96,10 +96,9 @@ static int blk_mq_do_dispatch_sched(struct blk_mq_hw_ctx *hctx)
> >>> struct elevator_queue *e = q->elevator;
> >>> LIST_HEAD(rq_list);
> >>> int ret = 0;
> >>> + struct request *rq;
> >>>
> >>> do {
> >>> - struct request *rq;
> >>> -
> >>> if (e->type->ops.has_work && !e->type->ops.has_work(hctx))
> >>> break;
> >>>
> >>> @@ -131,7 +130,7 @@ static int blk_mq_do_dispatch_sched(struct blk_mq_hw_ctx *hctx)
> >>> * in blk_mq_dispatch_rq_list().
> >>> */
> >>> list_add(&rq->queuelist, &rq_list);
> >>> - } while (blk_mq_dispatch_rq_list(q, &rq_list, true));
> >>> + } while (blk_mq_dispatch_rq_list(rq->mq_hctx, &rq_list, true));
> >>
> >> Why not use the hctx argument passed to the function instead of rq->mq_hctx ?
> >
> > e->type->ops.dispatch_request(hctx) may return one request which's
> > .mq_hctx isn't same with the 'hctx' argument, so far bfq and deadline
> > may do that.
>
> Ah, OK. But then all requests in rq_list may have different hctx. So is it wise
> to pass hctx as an argument to blk_mq_dispatch_rq_list() ? The loop in that
&rq_list is one single request list.
> function will still need to look at each rq hctx (hctx = rq->mq_hctx) for the
> budget. So the hctx argument may not be needed at all, no ? Am I missing something ?
The final patch will add batching dispatch support, and more requests in
same hctx will be added to this list, at that time, the hctx argument
becomes reasonable.
Thanks,
Ming
next prev parent reply other threads:[~2020-06-02 13:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-02 9:14 [PATCH V4 0/6] blk-mq: support batching dispatch from scheduler Ming Lei
2020-06-02 9:14 ` [PATCH V4 1/6] blk-mq: pass request queue into get/put budget callback Ming Lei
2020-06-02 9:14 ` [PATCH V4 2/6] blk-mq: pass hctx to blk_mq_dispatch_rq_list Ming Lei
2020-06-02 9:25 ` Damien Le Moal
2020-06-02 9:32 ` Ming Lei
2020-06-02 9:39 ` Damien Le Moal
2020-06-02 13:49 ` Ming Lei [this message]
2020-06-02 9:14 ` [PATCH V4 3/6] blk-mq: move getting driver tag and budget into one helper Ming Lei
2020-06-02 9:32 ` Damien Le Moal
2020-06-02 9:15 ` [PATCH V4 4/6] blk-mq: remove dead check from blk_mq_dispatch_rq_list Ming Lei
2020-06-02 9:15 ` [PATCH V4 5/6] blk-mq: pass obtained budget count to blk_mq_dispatch_rq_list Ming Lei
2020-06-02 9:45 ` Damien Le Moal
2020-06-02 9:15 ` [PATCH V4 6/6] blk-mq: support batching dispatch in case of io scheduler Ming Lei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200602134945.GA1824688@T590 \
--to=ming.lei@redhat.com \
--cc=Damien.LeMoal@wdc.com \
--cc=Johannes.Thumshirn@wdc.com \
--cc=axboe@kernel.dk \
--cc=baolin.wang7@gmail.com \
--cc=hch@infradead.org \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox