aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page-writeback.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-15 19:41:52 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-15 19:41:52 -0500
commit8c0863403f109a43d7000b4646da4818220d501f (patch)
tree925a87846bda5a0f427cbd19b65c9ea0375ebdd3 /mm/page-writeback.c
parentadea27f4ba29200c989194a3f6214b652d009e83 (diff)
dirty page balancing: Get rid of broken unmapped_ratio logic
This code harks back to the days when we didn't count dirty mapped pages, which led us to try to balance the number of dirty unmapped pages by how much unmapped memory there was in the system. That makes no sense any more, since now the dirty counts include the mapped pages. Not to mention that the math doesn't work with HIGHMEM machines anyway, and causes the unmapped_ratio to potentially turn negative (which we do catch thanks to clamping it at a minimum value, but I mention that as an indication of how broken the code is). The code also was written at a time when the default dirty ratio was much larger, and the unmapped_ratio logic effectively capped that large dirty ratio a bit. Again, we've since lowered the dirty ratio rather aggressively, further lessening the point of that code. Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r--mm/page-writeback.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 81a91e6f1f99..d55cfcae2ef1 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -297,20 +297,12 @@ get_dirty_limits(long *pbackground, long *pdirty, long *pbdi_dirty,
297{ 297{
298 int background_ratio; /* Percentages */ 298 int background_ratio; /* Percentages */
299 int dirty_ratio; 299 int dirty_ratio;
300 int unmapped_ratio;
301 long background; 300 long background;
302 long dirty; 301 long dirty;
303 unsigned long available_memory = determine_dirtyable_memory(); 302 unsigned long available_memory = determine_dirtyable_memory();
304 struct task_struct *tsk; 303 struct task_struct *tsk;
305 304
306 unmapped_ratio = 100 - ((global_page_state(NR_FILE_MAPPED) +
307 global_page_state(NR_ANON_PAGES)) * 100) /
308 available_memory;
309
310 dirty_ratio = vm_dirty_ratio; 305 dirty_ratio = vm_dirty_ratio;
311 if (dirty_ratio > unmapped_ratio / 2)
312 dirty_ratio = unmapped_ratio / 2;
313
314 if (dirty_ratio < 5) 306 if (dirty_ratio < 5)
315 dirty_ratio = 5; 307 dirty_ratio = 5;
316 308