lkml.org 
[lkml]   [2003]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [patch] as-iosched divide by zero fix
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/

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.073 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site