Re: [RFC V2 PATCH 1/5] cfq-iosched: adapt slice to number of processes doing I/O

From: Corrado Zoccolo
Date: Thu Oct 22 2009 - 06:43:38 EST


Hi Jeff,
On Wed, Oct 21, 2009 at 6:36 PM, Jeff Moyer <jmoyer@xxxxxxxxxx> wrote:
> Corrado Zoccolo <czoccolo@xxxxxxxxx> writes:
>
> OK. ÂThe idea was to try to make the thing a bit more digestable.
> Honestly, I had to re-write it to figure out what it was doing. ÂCould
> you rework it so the logic is more obvious to others and still correct?

What about:
/* interested queues (we consider only the ones with the same priority class) */
unsigned iq = cfq_get_avg_queues(cfqd, cfq_class_rt(cfqq));
unsigned sync_slice = cfqd->cfq_slice[1];
unsigned expected_latency = sync_slice * iq;
if (expected_latency > target_latency) {
unsigned base_low_slice = 2 * cfqd->cfq_slice_idle;
/* scale low_slice according to IO priority and sync vs async */
unsigned low_slice = min(slice, base_low_slice * slice / sync_slice);
/* the adapted slice value is scaled to fit all iqs into the target latency */
slice = max(slice * cfq_target_latency / expected_latency, low_slice);
}

BTW, the other complex part of the patch, i.e. the definition of
cfq_get_avg_queues, could be simplified if we hard-code the divisor,
that is currently defined outside to allow for some experimentation.

Thanks for your comments
Corrado

>
> Thanks!
> Jeff
>



--
__________________________________________________________________________

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/