Re: Need information on elevator_dispatch_fn

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Philipp Gruber <philipp.gruber@...>
Cc: <linux-kernel@...>
Date: Wednesday, October 31, 2007 - 6:58 am

On Wed, Oct 31 2007, Philipp Gruber wrote:

elevator_dispatch_fn() is in charge of putting request on the dispatch
list. So it'll be called, if q->queue_head is empty to refill that. The
core is __elv_next_request(), which is called when a block driver wants
to queue more IO. The logic is essentially:

elv_next_request()
{
        while (1) {
                if (!list_empty(&q->queue_head))
                        return first rq of list
                if (!elevator_dispatch_fn())
                        return NULL;
        }
}

So if you queue_head is empty AND elevator_dispatch_fn returns 0, then
no request is given to the driver. IF elevator_dispatch_fn returns
non-zero, then it MUST have put request on the queue_head list.

-- 
Jens Axboe

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Need information on elevator_dispatch_fn, Philipp Gruber, (Wed Oct 31, 6:00 am)
Re: Need information on elevator_dispatch_fn, Aaron Carroll, (Wed Oct 31, 7:36 am)
Re: Need information on elevator_dispatch_fn, Jens Axboe, (Wed Oct 31, 6:58 am)