Commit 0d761325 authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

[PATCH] vm: writeout watermark tuning

Slightly change the writeout watermark calculations so we keep background
and synchronous writeout watermarks in the same ratios after adjusting them
for the amout of mapped memory.  This ensures we should always attempt to
start background writeout before synchronous writeout and preserves the
admin's desired background-versus-forground ratios after we've
auto-adjusted one of them.
Signed-off-by: default avatarNick Piggin <nickpiggin@cyberone.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8a34e562
......@@ -153,9 +153,11 @@ get_dirty_limits(struct writeback_state *wbs, long *pbackground, long *pdirty)
if (dirty_ratio < 5)
dirty_ratio = 5;
background_ratio = dirty_background_ratio;
if (background_ratio >= dirty_ratio)
background_ratio = dirty_ratio / 2;
/*
* Keep the ratio between dirty_ratio and background_ratio roughly
* what the sysctls are after dirty_ratio has been scaled (above).
*/
background_ratio = dirty_background_ratio * dirty_ratio/vm_dirty_ratio;
background = (background_ratio * total_pages) / 100;
dirty = (dirty_ratio * total_pages) / 100;
......
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