• Jens Axboe's avatar
    [PATCH] Fix cfq_find_next_crq() · 3d25f356
    Jens Axboe authored
    In cfq_find_next_crq(), cfq tries to find the next request by choosing
    one of two requests before and after the current one.  Currently, when
    choosing the next request, if there's no next request, the next
    candidate is NULL, resulting in selection of the previous request.  This
    results in weird scheduling.  Once we reach the end, we always seek
    backward.
    
    The correct behavior is using the first request as the next candidate.
    cfq_choose_req() already has logics for handling wrapped requests.
    Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
    Signed-off-by: default avatarJens Axboe <axboe@suse.de>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    3d25f356
cfq-iosched.c 58 KB