Re: [patch] as-iosched divide by zero fix

From: Nick Piggin (piggin@cyberone.com.au)
Date: Wed Jun 11 2003 - 20:31:33 EST


Andrew Morton wrote:

>Robert Love <rml@tech9.net> wrote:
>
>>Fix as-iosched divide-by-zero bug.
>>
>
>hrm, OK. Still not convinced about `batch'.
>
>How about this?
>

Yeah, thats the way to do it, of course. It was too
jumpy at that setting though, so make it batch*3
(or <<1+batch if you don't want the multiply).

>
>--- 25/drivers/block/as-iosched.c~as-div-by-zero-fix 2003-06-11 18:17:04.000000000 -0700
>+++ 25-akpm/drivers/block/as-iosched.c 2003-06-11 18:20:58.000000000 -0700
>@@ -930,13 +930,12 @@ void update_write_batch(struct as_data *
> write_time = 0;
>
> if (write_time > batch + 5 && !ad->write_batch_idled) {
>- if (write_time / batch > 2)
>+ if (write_time > batch * 2)
> ad->write_batch_count /= 2;
> else
> ad->write_batch_count--;
>-
> } else if (write_time + 5 < batch && ad->current_write_count == 0) {
>- if (batch / write_time > 2)
>+ if (batch > write_time * 2)
> ad->write_batch_count *= 2;
> else
> ad->write_batch_count++;
>
>_
>
>
>
>

-
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/



This archive was generated by hypermail 2b29 : Sun Jun 15 2003 - 22:00:30 EST