]>
Commit | Line | Data |
---|---|---|
74d95923 GKH |
1 | From ccb6108f5b0b541d3eb332c3a73e645c0f84278e Mon Sep 17 00:00:00 2001 |
2 | From: Peter Zijlstra <peterz@infradead.org> | |
3 | Date: Mon, 25 Jul 2011 17:11:57 -0700 | |
4 | Subject: mm/backing-dev.c: reset bdi min_ratio in bdi_unregister() | |
5 | ||
6 | From: Peter Zijlstra <peterz@infradead.org> | |
7 | ||
8 | commit ccb6108f5b0b541d3eb332c3a73e645c0f84278e upstream. | |
9 | ||
10 | Vito said: | |
11 | ||
12 | : The system has many usb disks coming and going day to day, with their | |
13 | : respective bdi's having min_ratio set to 1 when inserted. It works for | |
14 | : some time until eventually min_ratio can no longer be set, even when the | |
15 | : active set of bdi's seen in /sys/class/bdi/*/min_ratio doesn't add up to | |
16 | : anywhere near 100. | |
17 | : | |
18 | : This then leads to an unrelated starvation problem caused by write-heavy | |
19 | : fuse mounts being used atop the usb disks, a problem the min_ratio setting | |
20 | : at the underlying devices bdi effectively prevents. | |
21 | ||
22 | Fix this leakage by resetting the bdi min_ratio when unregistering the | |
23 | BDI. | |
24 | ||
25 | Signed-off-by: Peter Zijlstra <peterz@infradead.org> | |
26 | Reported-by: Vito Caputo <lkml@pengaru.com> | |
27 | Cc: Wu Fengguang <fengguang.wu@intel.com> | |
28 | Cc: Miklos Szeredi <miklos@szeredi.hu> | |
29 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | |
30 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | |
31 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
32 | ||
33 | --- | |
34 | mm/backing-dev.c | 1 + | |
35 | 1 file changed, 1 insertion(+) | |
36 | ||
37 | --- a/mm/backing-dev.c | |
38 | +++ b/mm/backing-dev.c | |
39 | @@ -606,6 +606,7 @@ static void bdi_prune_sb(struct backing_ | |
40 | void bdi_unregister(struct backing_dev_info *bdi) | |
41 | { | |
42 | if (bdi->dev) { | |
43 | + bdi_set_min_ratio(bdi, 0); | |
44 | trace_writeback_bdi_unregister(bdi); | |
45 | bdi_prune_sb(bdi); | |
46 | del_timer_sync(&bdi->wb.wakeup_timer); |