lkml.org 
[lkml]   [2009]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [RFC]cfq-iosched: quantum check tweak
    From
    On Fri, Dec 25, 2009 at 10:10 AM, Shaohua Li <shaohua.li@intel.com> wrote:
    > Currently a queue can only dispatch up to 4 requests if there are other queues.
    > This isn't optimal, device can handle more requests, for example, AHCI can
    > handle 31 requests. I can understand the limit is for fairness, but we could
    > do some tweaks:
    > 1. if the queue still has a lot of slice left, sounds we could ignore the limit
    ok. You can even scale the limit proportionally to the remaining slice
    (see below).

    > 2. we could keep the check only when cfq_latency is on. For uses who don't care
    > about latency should be happy to have device fully piped on.
    I wouldn't overload low_latency with this meaning. You can obtain the
    same by setting the quantum to 32.
    >
    > I have a test of random direct io of two threads, each has 32 requests one time
    > without patch: 78m/s
    > with tweak 1: 138m/s
    > with two tweaks and disable latency: 156m/s

    Please, test also with competing seq/random(depth1)/async workloads,
    and measure also introduced latencies.

    >
    > Signed-off-by: Shaohua Li <shaohua.li@intel.com>
    > ---
    >  block/cfq-iosched.c |   15 ++++++++++++++-
    >  1 file changed, 14 insertions(+), 1 deletion(-)
    >
    > Index: linux-2.6/block/cfq-iosched.c
    > ===================================================================
    > --- linux-2.6.orig/block/cfq-iosched.c
    > +++ linux-2.6/block/cfq-iosched.c
    > @@ -2242,6 +2242,18 @@ static int cfq_forced_dispatch(struct cf
    >        return dispatched;
    >  }
    >
    > +static inline bool cfq_slice_used_soon(struct cfq_data *cfqd,
    > +       struct cfq_queue *cfqq)
    > +{
    > +       /* the queue hasn't finished any request, can't estimate */
    > +       if (cfq_cfqq_slice_new(cfqq))
    > +               return 1;
    > +       if (time_after(jiffies + cfqd->cfq_slice_idle, cfqq->slice_end))
    here I would use
    jiffies + cfqd->cfq_slice_idle * (cfqq->queued[0] + cfqq->queued[1])
    to obtain the proper scaling
    > +               return 1;
    > +
    > +       return 0;
    > +}
    > +
    >  static bool cfq_may_dispatch(struct cfq_data *cfqd, struct cfq_queue *cfqq)
    >  {
    >        unsigned int max_dispatch;

    Thanks,
    Corrado

    --
    __________________________________________________________________________

    dott. Corrado Zoccolo mailto:czoccolo@gmail.com
    PhD - Department of Computer Science - University of Pisa, Italy
    --------------------------------------------------------------------------
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2009-12-25 10:47    [W:0.023 / U:2.736 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site