[lkml]   [2009]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] cfq-iosched: replace sync_flight by rq_in_driver[BLK_RW_SYNC]
    On Wed, Dec 30 2009, Corrado Zoccolo wrote:
    > On Wed, Dec 30, 2009 at 7:47 PM, Jens Axboe <> 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

     \ /
      Last update: 2009-12-30 22:19    [W:0.020 / U:14.456 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site