Commit fcb4b9ea authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Linus Torvalds

[PATCH] vm_dirty_ratio initialisation fix

When a 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%.
Signed-off-by: default avatarAndy Whitcroft <apw@shadowen.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7ff822e1
......@@ -504,6 +504,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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment