aboutsummaryrefslogtreecommitdiff
path: root/mm/page-writeback.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2006-09-25 23:30:58 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 08:48:44 -0700
commitedc79b2a46ed854595e40edcf3f8b37f9f14aa3f (patch)
treec1120bebede9660ab00f9439aa7a84ab9434ac38 /mm/page-writeback.c
parentd08b3851da41d0ee60851f2c75b118e1f7a5fc89 (diff)
[PATCH] mm: balance dirty pages
Now that we can detect writers of shared mappings, throttle them. Avoids OOM by surprise. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r--mm/page-writeback.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 1c87430b7a2..b9f4c6f1be8 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -244,6 +244,16 @@ static void balance_dirty_pages(struct address_space *mapping)
pdflush_operation(background_writeout, 0);
}
+void set_page_dirty_balance(struct page *page)
+{
+ if (set_page_dirty(page)) {
+ struct address_space *mapping = page_mapping(page);
+
+ if (mapping)
+ balance_dirty_pages_ratelimited(mapping);
+ }
+}
+
/**
* balance_dirty_pages_ratelimited_nr - balance dirty memory state
* @mapping: address_space which was dirtied