Re: [PATCH] cfq-iosched: reduce write depth only if sync was delayed

From: Corrado Zoccolo
Date: Wed Dec 09 2009 - 14:45:13 EST


On Wed, Dec 9, 2009 at 8:05 PM, Jens Axboe <jens.axboe@xxxxxxxxxx> wrote:
> On Wed, Dec 09 2009, Jeff Moyer wrote:
>> OK. Can we put a comment in there and change the initialization to
>> cfq_slice_sync * 10?
>
> Agree, that would be MUCH easier to understand.
>
Sure, we can put a comment there, but I don't like hardcoding a constant that depends on how the formula is computed (what if the formula is changed,
and it doesn't depend on cfq_slice_sync any more, or if cfq_slice_sync changes dynamically?).
When I wrote it, what I really meant was exactly what you read in the C code (assume the last delayed sync happened 1 second ago). Then, the effect
would be to start with a queue depth of 10 with the current formula, but even if we change the formula, 1 second is still meaningful (while 10
*cfq_slice_sync, that has the same value, becomes misleading). So my proposed fix is just: