• Jens Axboe's avatar
    [PATCH] io scheduler update · 33fb2ab5
    Jens Axboe authored
    This fixes a problem with the deadline io scheduler, if the correct
    insertion point is at the front of the list.  This is something that we
    never have gotten right in 2.4 either.
    
    The problem is that the elevator merge function has to return a pointer
    to a struct request, and for front insert we really have to return the
    head of the list which cannot be expressed as a request of course.
    
    The real issue is that the elevator_merge function actually performs two
    functions - it scans for a merge, and if it can't find any, it selects
    and insertion point.  It's done this way for efficiency reasons, even if
    the design isn't all that clean.
    
    So we change the io scheduler merge functions to get passed a pointer to
    a list_head pointer instead.  This works for both inserts and merges.
    In addition, deadline checks if it really should insert at the very
    front.
    
    Also don't pass in request to elv_try_last_merge(), the very name of the
    function suggests that it's q->last_merge that we are interested in.
    33fb2ab5
elevator.c 7.76 KB