lkml.org 
[lkml]   [2009]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: bug in elevator/cfq regarding start_time?
On Sun, Oct 04 2009, Corrado Zoccolo wrote:
> Hi Jens,
> I found that the start_time is not monotonic in the cfqq fifo_list.
> The problem seems to be that:
> * attempt_merge overrides one of the start_time:
> if (time_after(req->start_time, next->start_time))
> req->start_time = next->start_time;
> * then it calls elv_merge_requests, that in turn invokes cfq's
> elevator_merge_req_fn, i.e. cfq_merged_requests
> * cfq_merged_requests checks start_times to decide whether requests
> need to be repositioned
> if (!list_empty(&rq->queuelist) && !list_empty(&next->queuelist) &&
> time_before(next->start_time, rq->start_time))
> list_move(&rq->queuelist, &next->queuelist);
>
> Other I/O schedulers are not affected, since none of them uses
> start_time explicitly, but they have a copy in one of the private
> fields.

Good spotting! So we can either add the same copy in cfq, or we can just
move the ->start_time check and assignment in attempt_merge() to post
the elv_merge_requests() call. I think the latter would work fine, but
I'll check and fix tomorrow.

--
Jens Axboe



\
 
 \ /
  Last update: 2009-10-04 23:05    [from the cache]
©2003-2011 Jasper Spaans