public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Tejun Heo <htejun@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cfq-iosched: fix slice_left calculation
Date: Thu, 10 Nov 2005 18:10:52 +0100	[thread overview]
Message-ID: <20051110171051.GD3699@suse.de> (raw)
In-Reply-To: <20051110140042.GA25774@htj.dyndns.org>

On Thu, Nov 10 2005, Tejun Heo wrote:
> When cfq slice expires, remainder of slice is calculated and stored in
> cfqq->slice_left.  Current code calculates the opposite of remainder -
> how many jiffies the cfqq has used past slice end.  This patch fixes
> the bug.
> 
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> 
> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> --- a/block/cfq-iosched.c
> +++ b/block/cfq-iosched.c
> @@ -861,8 +861,8 @@ __cfq_slice_expired(struct cfq_data *cfq
>  	 * store what was left of this slice, if the queue idled out
>  	 * or was preempted
>  	 */
> -	if (time_after(now, cfqq->slice_end))
> -		cfqq->slice_left = now - cfqq->slice_end;
> +	if (time_after(cfqq->slice_end, now))
> +		cfqq->slice_left = cfqq->slice_end - now;
>  	else
>  		cfqq->slice_left = 0;

That looks more correct, good spotting. Applied.

-- 
Jens Axboe


      reply	other threads:[~2005-11-10 17:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-10 14:00 [PATCH] cfq-iosched: fix slice_left calculation Tejun Heo
2005-11-10 17:10 ` Jens Axboe [this message]

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=20051110171051.GD3699@suse.de \
    --to=axboe@suse.de \
    --cc=htejun@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