aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorNick Piggin <nickpiggin@yahoo.com.au>2004-08-23 21:25:33 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-23 21:25:33 -0700
commit0d76132512fa9df6ea820fa06435eb4a80de538b (patch)
tree65c9e84a0165d9a73fedd753566c1dfb54107a5b /mm
parent8a34e562b3613ff2d68308c69ea8842caf9c0df7 (diff)
downloadhistory-0d76132512fa9df6ea820fa06435eb4a80de538b.tar.gz
[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: Nick Piggin <nickpiggin@cyberone.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page-writeback.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 343998d46bb033..ab9fb2dfbece2a 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -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;