aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorBron Gondwana <brong@fastmail.fm>2008-02-05 01:29:20 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 12:44:18 -0500
commit195cf453d2c3d789cbe80e3735755f860c2fb222 (patch)
treefad48a8167744b6c091c8ca499bc78b859af8957 /mm
parent3dfa5721f12c3d5a441448086bee156887daa961 (diff)
mm/page-writeback: highmem_is_dirtyable option
Add vm.highmem_is_dirtyable toggle A 32 bit machine with HIGHMEM64 enabled running DCC has an MMAPed file of approximately 2Gb size which contains a hash format that is written randomly by the dbclean process. On 2.6.16 this process took a few minutes. With lowmem only accounting of dirty ratios, this takes about 12 hours of 100% disk IO, all random writes. Include a toggle in /proc/sys/vm/highmem_is_dirtyable which can be set to 1 to add the highmem back to the total available memory count. [akpm@linux-foundation.org: Fix the CONFIG_DETECT_SOFTLOCKUP=y build] Signed-off-by: Bron Gondwana <brong@fastmail.fm> Cc: Ethan Solomita <solo@google.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: WU Fengguang <wfg@mail.ustc.edu.cn> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page-writeback.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 8137482abd6e..c689b60af000 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -69,6 +69,12 @@ static inline long sync_writeback_pages(void)
69int dirty_background_ratio = 5; 69int dirty_background_ratio = 5;
70 70
71/* 71/*
72 * free highmem will not be subtracted from the total free memory
73 * for calculating free ratios if vm_highmem_is_dirtyable is true
74 */
75int vm_highmem_is_dirtyable;
76
77/*
72 * The generator of dirty data starts writeback at this percentage 78 * The generator of dirty data starts writeback at this percentage
73 */ 79 */
74int vm_dirty_ratio = 10; 80int vm_dirty_ratio = 10;
@@ -287,7 +293,10 @@ static unsigned long determine_dirtyable_memory(void)
287 x = global_page_state(NR_FREE_PAGES) 293 x = global_page_state(NR_FREE_PAGES)
288 + global_page_state(NR_INACTIVE) 294 + global_page_state(NR_INACTIVE)
289 + global_page_state(NR_ACTIVE); 295 + global_page_state(NR_ACTIVE);
290 x -= highmem_dirtyable_memory(x); 296
297 if (!vm_highmem_is_dirtyable)
298 x -= highmem_dirtyable_memory(x);
299
291 return x + 1; /* Ensure that we never return 0 */ 300 return x + 1; /* Ensure that we never return 0 */
292} 301}
293 302