diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2007-10-17 02:25:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:45 -0400 |
commit | 04fbfdc14e5f48463820d6b9807daa5e9c92c51f (patch) | |
tree | c62905212c8c6373b2258c7f528398d3c831b075 /kernel | |
parent | 145ca25eb2fbd20d4faf1bad4628c7650332058f (diff) |
mm: per device dirty threshold
Scale writeback cache per backing device, proportional to its writeout speed.
By decoupling the BDI dirty thresholds a number of problems we currently have
will go away, namely:
- mutual interference starvation (for any number of BDIs);
- deadlocks with stacked BDIs (loop, FUSE and local NFS mounts).
It might be that all dirty pages are for a single BDI while other BDIs are
idling. By giving each BDI a 'fair' share of the dirty limit, each one can have
dirty pages outstanding and make progress.
A global threshold also creates a deadlock for stacked BDIs; when A writes to
B, and A generates enough dirty pages to get throttled, B will never start
writeback until the dirty pages go away. Again, by giving each BDI its own
'independent' dirty limit, this problem is avoided.
So the problem is to determine how to distribute the total dirty limit across
the BDIs fairly and efficiently. A DBI that has a large dirty limit but does
not have any dirty pages outstanding is a waste.
What is done is to keep a floating proportion between the DBIs based on
writeback completions. This way faster/more active devices get a larger share
than slower/idle devices.
[akpm@linux-foundation.org: fix warnings]
[hugh@veritas.com: Fix occasional hang when a task couldn't get out of balance_dirty_pages]
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sysctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 96efbb859997..c676b5ec88f5 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -813,7 +813,7 @@ static ctl_table vm_table[] = { | |||
813 | .data = &vm_dirty_ratio, | 813 | .data = &vm_dirty_ratio, |
814 | .maxlen = sizeof(vm_dirty_ratio), | 814 | .maxlen = sizeof(vm_dirty_ratio), |
815 | .mode = 0644, | 815 | .mode = 0644, |
816 | .proc_handler = &proc_dointvec_minmax, | 816 | .proc_handler = &dirty_ratio_handler, |
817 | .strategy = &sysctl_intvec, | 817 | .strategy = &sysctl_intvec, |
818 | .extra1 = &zero, | 818 | .extra1 = &zero, |
819 | .extra2 = &one_hundred, | 819 | .extra2 = &one_hundred, |