public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Corrado Zoccolo <czoccolo@gmail.com>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>,
	Jeff Moyer <jmoyer@redhat.com>, Vivek Goyal <vgoyal@redhat.com>,
	Shaohua Li <shaohua.li@intel.com>,
	Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Subject: Re: [PATCH] cfq-iosched: replace sync_flight by rq_in_driver[BLK_RW_SYNC]
Date: Wed, 30 Dec 2009 22:16:43 +0100	[thread overview]
Message-ID: <20091230211643.GO4489@kernel.dk> (raw)
In-Reply-To: <4e5e476b0912301250x4a0de523v8c1d0a03720c8fa8@mail.gmail.com>

On Wed, Dec 30 2009, Corrado Zoccolo wrote:
> On Wed, Dec 30, 2009 at 7:47 PM, Jens Axboe <jens.axboe@oracle.com> wrote:
> > On Wed, Dec 30 2009, Corrado Zoccolo wrote:
> >> According to my intuition (and brief testing), sync_flight is always
> >> equal to rq_in_driver[BLK_RW_SYNC] at the point of usage, so it can
> >> be removed and replaced by the other.
> >
> > They are not fully identical. ->sync_flight is incremented on insertion
> > on the dispatch list, ->rq_in_driver not until the request is activated
> > (eg the driver has retrieved it and wants to dispatch to the hardware).
> Usually (only exceptions are forced dispatch, or when a conflict in the
> rb tree is found), a request is activated as soon as cfq returns from
> cfq_dispatch_requests.

Yes, but then it may be deactivated immediately for requeue.

> > They will usually be identical, but that may not be true for requeues
> > for instance.
> 
> For our purpose, it is sufficient that in cfq_may_dispatch, they are either
> both 0 or both non-0.
> Since we have sync_flight >= rq_in_driver[1], the only question is:
> can the number of requests in the driver drop to 0 with requests still
> in flight?

It's mostly a theoretical issue, but yes it could happen. I'm assuming
you mean ->rq_in_driver[1] == 0 while ->sync_flight != 0. But then we
are into the area of some starvation problem, in hardware or in the
kernel. So it's not likely, but still.

> I'm asking because to drain async requests, we are using the rq_in_driver
> counter instead. Maybe they need the same treatment.

In theory, yes the same applies there. Normal operations would not have
that distinction between activated and on dispatch list.

-- 
Jens Axboe


  reply	other threads:[~2009-12-30 21:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-30 15:08 [PATCH] cfq-iosched: replace sync_flight by rq_in_driver[BLK_RW_SYNC] Corrado Zoccolo
2009-12-30 18:47 ` Jens Axboe
2009-12-30 20:50   ` Corrado Zoccolo
2009-12-30 21:16     ` Jens Axboe [this message]
2009-12-30 22:24       ` [PATCH] cfq-iosched: requests "in flight" vs "in driver" clarification Corrado Zoccolo

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=20091230211643.GO4489@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=czoccolo@gmail.com \
    --cc=guijianfeng@cn.fujitsu.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaohua.li@intel.com \
    --cc=vgoyal@redhat.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