public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
To: Corrado Zoccolo <czoccolo@gmail.com>
Cc: Jeff Moyer <jmoyer@redhat.com>, Shaohua Li <shaohua.li@intel.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: Tue, 12 Jan 2010 10:43:38 +0800	[thread overview]
Message-ID: <1263264218.29897.41.camel@localhost> (raw)
In-Reply-To: <4e5e476b1001110705y6c3319ducf6a15c2a2be5670@mail.gmail.com>

On Mon, 2010-01-11 at 16:05 +0100, Corrado Zoccolo wrote: 
> On Mon, Jan 11, 2010 at 6:20 AM, Zhang, Yanmin
> <yanmin_zhang@linux.intel.com> wrote:
> > On Thu, 2010-01-07 at 09:30 -0500, Jeff Moyer wrote:
> >> Corrado Zoccolo <czoccolo@gmail.com> writes:
> >>
> >> > On Tue, Jan 5, 2010 at 10:16 PM, Jeff Moyer <jmoyer@redhat.com> wrote:
> >> >>
> >> >> For now, I'm leaning towards asking Jens to revert this.  It may still
> >> >> be worth making sure that we don't merge a seeky queue with a non-seeky
> >> >> queue.  I have a patch for that if folks are interested.
> >> > Jeff, can you send this patch to Yanmin, that is investigating a
> >> > regression apparently caused by excessive queue merge?
> >> >
> >> > http://lkml.org/lkml/2010/1/4/194
> >>
> >>
> >> You first have to back out Shaohua's patch, then apply this one.
> > Thanks for forwarding me the patches.
> > Actually, we found tiobench randread has about 20% regression since kernel
> > 2.6.33-rc1, and fio randread has more than 40% regression.
> >
> >>
> >> Cheers,
> >> Jeff
> >>
> >> cfq-iosched: don't allow merging with seeky queues
> > With your new patch applied on 2.6.33-rc1, I don't see improvement on
> > both tiobench and fio randread regression. I know unexpected merge/unmerge
> > is just one root cause of the regressions. A couple of other patches
> > are also related to them.
> 
> Hi Yanmin,
> are you testing Jeff's patch with your full fio script, instead of the
> simplified one?
Thanks for your reminder. I tested the patch with simplified one.

> Since they are fixing the merging part, that happens only with the
> full fio script.
Ok. I tested the full fio script a moment ago and didn't find improvement.

> 
> >
> > I also tried to apply both your patch and Corrado's patch at
> > http://lkml.org/lkml/2010/1/9/57. The result seems like the one when I just apply
> > Corrado's patch, with which regression almost disappears when low_latency=0. But
> > when low_latency=1, there is still about 25% regression.
> >
> Yes, low_latency is supposed to bring some regression.
> http://lkml.org/lkml/2009/12/30/47
> 
> Thanks,
> Corrado
> >
> >>
> >> Shaohua Li noticed that cfq currently can merge with seeky queues, which
> >> causes unwanted merge/unmerge activity.  We already know that the
> >> cur_cfqq is not seeky, so this patch just makes sure that the non-seeky
> >> queue is not merged with a seeky one.
> >>
> >> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
> >>
> >> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> >> index 8df4fe5..3db9050 100644
> >> --- a/block/cfq-iosched.c
> >> +++ b/block/cfq-iosched.c
> >> @@ -1677,6 +1677,10 @@ static inline int cfq_rq_close(struct cfq_data *cfqd, struct cfq_queue *cfqq,
> >>       return cfq_dist_from_last(cfqd, rq) <= sdist;
> >>  }
> >>
> >> +/*
> >> + * Search for a cfqq that is issuing non-seeky I/Os within the seek
> >> + * mean of the current cfqq.
> >> + */
> >>  static struct cfq_queue *cfqq_close(struct cfq_data *cfqd,
> >>                                   struct cfq_queue *cur_cfqq)
> >>  {
> >> @@ -1701,7 +1705,14 @@ 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 the cfqq does not have enough seek samples, assume it is
> >> +      * sequential until proven otherwise.  If it is assumed that the
> >> +      * queue is seeky first, then the close cooperator detection logic
> >> +      * may never trigger as one queue strays further from the other(s).
> >> +      */
> >> +     if (cfq_rq_close(cfqd, cur_cfqq, __cfqq->next_rq) &&
> >> +         (!sample_valid(__cfqq->seek_samples) || !CFQQ_SEEKY(__cfqq)))
> >>               return __cfqq;
> >>
> >>       if (blk_rq_pos(__cfqq->next_rq) < sector)
> >> @@ -1712,7 +1723,8 @@ 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) &&
> >> +         (!sample_valid(__cfqq->seek_samples) || !CFQQ_SEEKY(__cfqq)))
> >>               return __cfqq;
> >>
> >>       return NULL;




  reply	other threads:[~2010-01-12  2:43 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
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 [this message]
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=1263264218.29897.41.camel@localhost \
    --to=yanmin_zhang@linux.intel.com \
    --cc=czoccolo@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=jmoyer@redhat.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