Re: [RFC]cfq-iosched: quantum check tweak

From: Corrado Zoccolo
Date: Fri Dec 25 2009 - 04:45:20 EST


On Fri, Dec 25, 2009 at 10:10 AM, Shaohua Li <shaohua.li@xxxxxxxxx> 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@xxxxxxxxx>
> ---
> Â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@xxxxxxxxx
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/