From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org,
Kashyap Desai <kashyap.desai@broadcom.com>,
Laurence Oberman <loberman@redhat.com>,
Omar Sandoval <osandov@fb.com>, Christoph Hellwig <hch@lst.de>,
Bart Van Assche <bart.vanassche@wdc.com>,
Hannes Reinecke <hare@suse.de>
Subject: Re: [PATCH V2 3/3] blk-mq: dequeue request one by one from sw queue iff hctx is busy
Date: Fri, 29 Jun 2018 23:34:53 +0800 [thread overview]
Message-ID: <20180629153447.GA15227@ming.t460p> (raw)
In-Reply-To: <9913ff1d-197b-32f8-254f-d554dde06f71@kernel.dk>
On Fri, Jun 29, 2018 at 08:58:16AM -0600, Jens Axboe wrote:
> On 6/29/18 2:12 AM, Ming Lei wrote:
> > It won't be efficient to dequeue request one by one from sw queue,
> > but we have to do that when queue is busy for better merge performance.
> >
> > This patch takes EWMA to figure out if queue is busy, then only dequeue
> > request one by one from sw queue when queue is busy.
> >
> > Kashyap verified that this patch basically brings back rand IO perf
> > on megasas_raid in case of none io scheduler. Meantime I tried this
> > patch on HDD, and not see obvious performance loss on sequential IO
> > test too.
>
> Outside of the comments of others, please also export ->busy from
> the blk-mq debugfs code.
Good idea!
>
> > diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
> > index e3147eb74222..a5113e22d720 100644
> > --- a/include/linux/blk-mq.h
> > +++ b/include/linux/blk-mq.h
> > @@ -34,6 +34,7 @@ struct blk_mq_hw_ctx {
> >
> > struct sbitmap ctx_map;
> >
> > + unsigned int busy;
> > struct blk_mq_ctx *dispatch_from;
> >
> > struct blk_mq_ctx **ctxs;
>
> This adds another hole. Consider swapping it a bit, ala:
>
> struct blk_mq_ctx *dispatch_from;
> unsigned int busy;
>
> unsigned int nr_ctx;
> struct blk_mq_ctx **ctxs;
>
> to eliminate a hole, instead of adding one more.
OK
Thanks,
Ming
prev parent reply other threads:[~2018-06-29 15:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-29 8:12 [PATCH V2 0/3] blk-mq: improve IO perf in case of none io sched Ming Lei
2018-06-29 8:12 ` [PATCH V2 1/3] blk-mq: use list_splice_tail_init() to insert requests Ming Lei
2018-06-29 8:34 ` Christoph Hellwig
2018-06-29 8:12 ` [PATCH V2 2/3] blk-mq: only attempt to merge bio if there is rq in sw queue Ming Lei
2018-06-29 8:35 ` Christoph Hellwig
2018-06-29 8:12 ` [PATCH V2 3/3] blk-mq: dequeue request one by one from sw queue iff hctx is busy Ming Lei
2018-06-29 8:39 ` Christoph Hellwig
2018-06-29 15:24 ` Ming Lei
2018-06-29 14:58 ` Jens Axboe
2018-06-29 15:34 ` Ming Lei [this message]
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=20180629153447.GA15227@ming.t460p \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=bart.vanassche@wdc.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=kashyap.desai@broadcom.com \
--cc=linux-block@vger.kernel.org \
--cc=loberman@redhat.com \
--cc=osandov@fb.com \
/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;
as well as URLs for NNTP newsgroup(s).