[PATCH] vm_dirty_ration goes to zero

From: Andy Whitcroft
Date: Mon Oct 18 2004 - 15:44:39 EST


When a 32 system has a very large imbalance of overall memory size
to ZONE_NORMAL (for example when large amounts of numa remap space
are in use) page_writeback_init() may incorrectly set vm_dirty_ratio
and dirty_background_ratio to zero; leading to divide by zero errors
elsewhere. This patch bounds these at 1%.

Revision: $Rev: 721 $

Signed-off-by: Andy Whitcroft <apw@xxxxxxxxxxxx>

diffstat 500-vm_dirty_ratio-goes-to-zero
---

diff -X /home/apw/brief/lib/vdiff.excl -rupN reference/mm/page-writeback.c current/mm/page-writeback.c
--- reference/mm/page-writeback.c
+++ current/mm/page-writeback.c
@@ -506,6 +506,11 @@ void __init page_writeback_init(void)
dirty_background_ratio /= 100;
vm_dirty_ratio *= correction;
vm_dirty_ratio /= 100;
+
+ if (dirty_background_ratio <= 0)
+ dirty_background_ratio = 1;
+ if (vm_dirty_ratio <= 0)
+ vm_dirty_ratio = 1;
}
mod_timer(&wb_timer, jiffies + (dirty_writeback_centisecs * HZ) / 100);
set_ratelimit();
-
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/