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>,
	Jeff Moyer <jmoyer@redhat.com>
Subject: Re: [PATCH] cfq-iosched: avoid slice overrun when idling
Date: Wed, 7 Oct 2009 19:51:12 +0200	[thread overview]
Message-ID: <20091007175112.GI8703@kernel.dk> (raw)
In-Reply-To: <200910071059.01146.czoccolo@gmail.com>

On Wed, Oct 07 2009, Corrado Zoccolo wrote:
> Idle window for a queue is reduced when the queue is about to finish
> its slice.
> 
> Signed-off-by: Corrado Zoccolo <czoccolo@gmail.com>
> ---
>  block/cfq-iosched.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> index 4ab33d8..55bb8ca 100644
> --- a/block/cfq-iosched.c
> +++ b/block/cfq-iosched.c
> @@ -1105,8 +1105,10 @@ static void cfq_arm_slice_timer(struct cfq_data *cfqd)
>  	 * we don't want to idle for seeks, but we do want to allow
>  	 * fair distribution of slice time for a process doing back-to-back
>  	 * seeks. so allow a little bit of time for him to submit a new rq
> +	 * but avoid overrunning its timeslice
>  	 */
> -	sl = cfqd->cfq_slice_idle;
> +	sl = min_t(unsigned long, cfqd->cfq_slice_idle,
> +		cfqq->slice_end - jiffies);
>  	if (sample_valid(cic->seek_samples) && CIC_SEEKY(cic))
>  		sl = min(sl, msecs_to_jiffies(CFQ_MIN_TT));

This was actually done this way on purpose, since shorter idling more
often don't suceed. So the logic was rather overrun the slice slightly
than wait shortly and just miss the incoming IO.

Of course this will overrun the slice even more, which the above will
also do since it wants to do IO within that time frame too.

So I think we should either leave it as-is, OR simply not arm the idle
timer when it has less than slice_idle time left and immediately select
a new queue.

-- 
Jens Axboe


  reply	other threads:[~2009-10-07 17:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-07  8:59 [PATCH] cfq-iosched: avoid slice overrun when idling Corrado Zoccolo
2009-10-07 17:51 ` Jens Axboe [this message]
2009-10-07 19:30   ` Corrado Zoccolo
2009-10-07 21:15     ` [PATCH v2] cfq-iosched: avoid probable " Corrado Zoccolo
2009-10-08  6:41       ` 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=20091007175112.GI8703@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=czoccolo@gmail.com \
    --cc=jmoyer@redhat.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).