linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Corrado Zoccolo <czoccolo@gmail.com>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: Re: bug in elevator/cfq regarding start_time?
Date: Sun, 4 Oct 2009 22:59:55 +0200	[thread overview]
Message-ID: <20091004205955.GM26573@kernel.dk> (raw)
In-Reply-To: <4e5e476b0910041354o54c95626g974264976adaf53c@mail.gmail.com>

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


  reply	other threads:[~2009-10-04 21:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-04 20:54 bug in elevator/cfq regarding start_time? Corrado Zoccolo
2009-10-04 20:59 ` Jens Axboe [this message]
2009-10-05 15:08   ` Corrado Zoccolo
2009-10-05 20:26     ` Corrado Zoccolo
2009-10-06  7:12       ` Jens Axboe
2009-10-06  8:43         ` Corrado Zoccolo
2009-10-06  8:54           ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091004205955.GM26573@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=czoccolo@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).