public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: tlinder@codeaurora.org
Cc: linux-mmc@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	alex.lemberg@sandisk.com,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 1/3] block: Add support for reinsert a dispatched req
Date: Thu, 28 Mar 2013 12:49:22 -0600	[thread overview]
Message-ID: <20130328184922.GE19488@kernel.dk> (raw)
In-Reply-To: <d6658b60b7e09376cfcf692dc54ac922.squirrel@www.codeaurora.org>

On Wed, Mar 27 2013, tlinder@codeaurora.org wrote:
> Hi Jens
> 
> >> Add support for reinserting a dispatched request back to the
> >> scheduler's internal data structures.
> >> This capability is used by the device driver when it chooses to
> >> interrupt the current request transmission and execute another (more
> >> urgent) pending request. For example: interrupting long write in order
> >> to handle pending read. The device driver re-inserts the
> >> remaining write request back to the scheduler, to be rescheduled
> >> for transmission later on.
> >>
> >> Add API for verifying whether the current scheduler
> >> supports reinserting requests mechanism. If reinsert mechanism isn't
> >> supported by the scheduler, this code path will never be activated.
> >
> > This is practically the exact same operation as a requeue.
> 
> Not exactly. When you requeue request X it will be the next one to be
> dispatched and handled by the device driver. When you reinsert a request,
> you reinset it back to the I/O scheduler and not to the dispatch queue.
> That means that this reinserted request will be rescheduled and its
> possible that it wont be the next one to be dispatched since there might
> be more urgent requests pending.
> For example: an urgent request notification was sent to the device driver
> that is currently transmitting a long packed WRITE command. The urgent
> request pending to be served is a READ request. The device driver decides
> to stop the packed WRITE request and handle the urgent READ. This is the
> difference between requeue and reinsert:
>  - if we requeue the stopped packed WRITE, it will be immediately fetched
> and transmitted again and the READ will be left pending till the packed
> WRITE completes. In this case there was no point in stopping the packed
> WRITE
> - if we reinsert the stopped packed WRITE the next request to be
> dispatched will be the urgent READ request (since READ is given priority
> over WRITE) and this will reduce the READ latency greatly.

I said practically the same, not exactly the same! In any case, the
point is that you could reuse the exact same infrastructure for this,
instead of literally duplicating everything. Have some helper that does
the grunt of the work, pass in whether or not you want the existing
requeue event, or a reinsert event.

-- 
Jens Axboe


  reply	other threads:[~2013-03-28 18:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25  9:01 [PATCH v5 1/3] block: Add support for reinsert a dispatched req Tanya Brokhman
2013-03-25 12:34 ` Jens Axboe
2013-03-27 19:09   ` tlinder
2013-03-28 18:49     ` Jens Axboe [this message]
2013-03-29 19:07       ` Tanya Brokhman

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=20130328184922.GE19488@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=alex.lemberg@sandisk.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=tlinder@codeaurora.org \
    /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