From: Tejun Heo <htejun@gmail.com>
To: Shaohua Li <shaohua.li@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
"jaxboe@fusionio.com" <jaxboe@fusionio.com>,
"hch@infradead.org" <hch@infradead.org>,
"jgarzik@pobox.com" <jgarzik@pobox.com>,
"djwong@us.ibm.com" <djwong@us.ibm.com>,
"sshtylyov@mvista.com" <sshtylyov@mvista.com>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"ricwheeler@gmail.com" <ricwheeler@gmail.com>
Subject: Re: [patch v3 2/3] block: hold queue if flush is running for non-queueable flush drive
Date: Fri, 6 May 2011 08:53:47 +0200 [thread overview]
Message-ID: <20110506065347.GA8824@htj.dyndns.org> (raw)
In-Reply-To: <1304656325.3828.22.camel@sli10-conroe>
Hello,
On Fri, May 06, 2011 at 12:32:05PM +0800, Shaohua Li wrote:
> > - This is much more minor but if block layer already knows flushes are
> > non-queueable, it might be a good idea to hold dispatching of
> > flushes if other requests are already in progress. It will only
> > save dispatch/requeue overhead which might not matter at all, so
> > this has pretty good chance of not being worth of the added
> > complexity tho.
>
> I did some experiment to hold flush too, but no obvious performance
> difference. It doesn't make more flush requests merge. Avoiding
> unnecessary requeue is a gain for fast devices, but my test doesn't
> show.
I see. Thanks for testing.
> Subject: block: hold queue if flush is running for non-queueable flush drive
>
> Commit 53d63e6b0dfb9(block: make the flush insertion use the tail of
> the dispatch list) causes about 20% regression running a sysbench fileio
> workload. Let's consider the following scenario:
> - flush1 is dispatched with write1 in the elevator.
> - Driver dispatches write1 and requeues it.
> - flush2 is issued and appended to dispatch queue after the requeued write1.
> As write1 has been requeued flush2 can't be put in front of it.
> - When flush1 finishes, the driver has to process write1 before flush2 even
> though there's no fundamental reason flush2 can't be processed first and,
> when two flushes are issued back-to-back without intervening writes, the
> second one essentially becomes noop.
> Without the commit, flush2 is inserted before write1, so the issue is hiden.
> But the commit itself makes sense, because flush request isn't a preempt
> request, there is no reason to add it to queue head.
>
> The regression is exposed in a SATA device. In SATA, flush requests are
> non-queueable. When flush request is running, normal read/write requests
> can't run. If block layer dispatches such request, driver can't handle it
> and requeue it. Tejun suggested we can hold the queue when flush is running.
> This can avoid unnecessary requeue.
>
> And also this can improve performance and solve the regression. In above
> scenario, when flush1 is running, queue is hold, so write1 isn't dispatched.
> flush2 will be the only request in the queue. After flush1 is finished, flush2
> will be dispatched soon. Since there is no write between flush1 and flush2,
> flush2 essentially becomes noop.
>
> Signed-off-by: Shaohua Li <shaohua.li@intel.com>
> Acked-by: Tejun Heo <tj@kernel.org>
Jens, can you please queue this for the next merge window?
Thanks.
--
tejun
next prev parent reply other threads:[~2011-05-06 6:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20110505015932.306763905@sli10-conroe.sh.intel.com>
[not found] ` <20110505020417.817084678@sli10-conroe.sh.intel.com>
2011-05-05 8:38 ` [patch v3 2/3] block: hold queue if flush is running for non-queueable flush drive Tejun Heo
2011-05-06 4:32 ` Shaohua Li
2011-05-06 6:53 ` Tejun Heo [this message]
2011-05-06 17:28 ` Jens Axboe
2011-05-09 13:03 ` Vivek Goyal
2011-05-09 13:50 ` Shaohua Li
2011-05-09 13:58 ` Vivek Goyal
2011-05-09 14:37 ` Tejun Heo
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=20110506065347.GA8824@htj.dyndns.org \
--to=htejun@gmail.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=djwong@us.ibm.com \
--cc=hch@infradead.org \
--cc=jaxboe@fusionio.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=ricwheeler@gmail.com \
--cc=shaohua.li@intel.com \
--cc=sshtylyov@mvista.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).