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

Andrew Morton (akpm@digeo.com)
Wed, 11 Jun 2003 18:22:49 -0700


Robert Love <rml@tech9.net> wrote:
>
> Fix as-iosched divide-by-zero bug.

hrm, OK. Still not convinced about `batch'.

How about this?

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