mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] vm_dirty_ration goes to zero
@ 2004-10-18 20:37 Andy Whitcroft
  0 siblings, 0 replies; only message in thread
From: Andy Whitcroft @ 2004-10-18 20:37 UTC (permalink / raw)
  To: apkm; +Cc: linux-kernel

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@shadowen.org>

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();

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-18 20:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-18 20:37 [PATCH] vm_dirty_ration goes to zero Andy Whitcroft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®