mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Shaohua Li <shaohua.li@intel.com>
Cc: Corrado Zoccolo <czoccolo@gmail.com>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"jens.axboe\@oracle.com" <jens.axboe@oracle.com>, "Zhang\,
	Yanmin" <yanmin.zhang@intel.com>
Subject: Re: [PATCH]cfq-iosched: don't take requests with long distence as close
Date: Mon, 04 Jan 2010 09:58:16 -0500	[thread overview]
Message-ID: <x49my0tc3xz.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <20091228092844.GA9710@sli10-desk.sh.intel.com> (Shaohua Li's message of "Mon, 28 Dec 2009 17:28:44 +0800")

Shaohua Li <shaohua.li@intel.com> writes:
> seek_mean could be very big sometimes, using it as close criteria is meaningless
> as this doen't improve any performance. So if it's big, let's fallback to
> default value.

I think the real problem is that we lost a check for a seeky queue.  The
close cooperator code initially was written to help interleaved
sequential I/Os.  Given that, I'm not a big fan of the proposed patch.
I'd rather see an extra check for CFQQ_SEEKY added to the close
cooperator code paths and leave cfq_rq_close alone.

Cheers,
Jeff

>
> Signed-off-by: Shaohua Li<shaohua.li@intel.com>
>
> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> index e2f8046..e80bd47 100644
> --- a/block/cfq-iosched.c
> +++ b/block/cfq-iosched.c
> @@ -1675,13 +1675,17 @@ static inline sector_t cfq_dist_from_last(struct cfq_data *cfqd,
>  #define CFQQ_SEEKY(cfqq)	((cfqq)->seek_mean > CFQQ_SEEK_THR)
>  
>  static inline int cfq_rq_close(struct cfq_data *cfqd, struct cfq_queue *cfqq,
> -			       struct request *rq)
> +			       struct request *rq, bool for_preempt)
>  {
>  	sector_t sdist = cfqq->seek_mean;
>  
>  	if (!sample_valid(cfqq->seek_samples))
>  		sdist = CFQQ_SEEK_THR;
>  
> +	/* if seek_mean is big, using it as close criteria is meaningless */
> +	if (sdist > CFQQ_SEEK_THR && !for_preempt)
> +		sdist = CFQQ_SEEK_THR;
> +
>  	return cfq_dist_from_last(cfqd, rq) <= sdist;
>  }
>  
> @@ -1709,7 +1713,7 @@ static struct cfq_queue *cfqq_close(struct cfq_data *cfqd,
>  	 * will contain the closest sector.
>  	 */
>  	__cfqq = rb_entry(parent, struct cfq_queue, p_node);
> -	if (cfq_rq_close(cfqd, cur_cfqq, __cfqq->next_rq))
> +	if (cfq_rq_close(cfqd, cur_cfqq, __cfqq->next_rq, false))
>  		return __cfqq;
>  
>  	if (blk_rq_pos(__cfqq->next_rq) < sector)
> @@ -1720,7 +1724,7 @@ static struct cfq_queue *cfqq_close(struct cfq_data *cfqd,
>  		return NULL;
>  
>  	__cfqq = rb_entry(node, struct cfq_queue, p_node);
> -	if (cfq_rq_close(cfqd, cur_cfqq, __cfqq->next_rq))
> +	if (cfq_rq_close(cfqd, cur_cfqq, __cfqq->next_rq, false))
>  		return __cfqq;
>  
>  	return NULL;
> @@ -3143,7 +3147,7 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq,
>  	 * if this request is as-good as one we would expect from the
>  	 * current cfqq, let it preempt
>  	 */
> -	if (cfq_rq_close(cfqd, cfqq, rq))
> +	if (cfq_rq_close(cfqd, cfqq, rq, true))
>  		return true;
>  
>  	return false;

  parent reply	other threads:[~2010-01-04 14:58 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-24  0:55 cfq-iosched: tiobench regression Shaohua Li
2009-12-24  7:48 ` Gui Jianfeng
2009-12-24  9:19   ` Shaohua Li
2009-12-24 11:40     ` Corrado Zoccolo
2009-12-25 10:16 ` Corrado Zoccolo
2009-12-28  2:02   ` Shaohua Li
2009-12-28  2:03   ` [PATCH]cfq-iosched: don't take requests with long distence as close Shaohua Li
2009-12-28  8:36     ` Corrado Zoccolo
2009-12-28  8:46       ` Shaohua Li
2009-12-28  9:11         ` Corrado Zoccolo
2009-12-28  9:28           ` Shaohua Li
2009-12-28  9:40             ` Corrado Zoccolo
2009-12-28 12:16             ` Jens Axboe
2010-01-04 14:58             ` Jeff Moyer [this message]
2010-01-05 21:16             ` Jeff Moyer
2010-01-06  1:19               ` Li, Shaohua
2010-01-07 13:44               ` Corrado Zoccolo
2010-01-07 14:30                 ` Jeff Moyer
2010-01-11  5:20                   ` Zhang, Yanmin
2010-01-11 15:05                     ` Corrado Zoccolo
2010-01-12  2:43                       ` Zhang, Yanmin
2010-01-15 19:32                         ` Corrado Zoccolo
2010-01-15 19:45                           ` Jeff Moyer
2010-01-15 20:24                             ` Corrado Zoccolo
2010-01-15 20:26                               ` Jeff Moyer
2009-12-28  3:19   ` [PATCH]cfq-iosched: split seeky coop queues after one slice Shaohua Li
2009-12-28  8:40     ` Corrado Zoccolo
2009-12-28  8:52       ` Shaohua Li
2010-01-04 15:04         ` Jeff Moyer

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=x49my0tc3xz.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=czoccolo@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaohua.li@intel.com \
    --cc=yanmin.zhang@intel.com \
    /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

all inboxes | Powered by JetHome®