diff options
author | Christoph Lameter <clameter@engr.sgi.com> | 2006-02-01 06:05:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-01 11:53:15 -0500 |
commit | 52a8363eae3872af15880292ff4e06d0fab36986 (patch) | |
tree | 9ac9d0f00cc2e35e5d95c7be77874477e25847b4 /mm | |
parent | ce2ea89ba101d976907128441ba3aca72a8804b9 (diff) |
[PATCH] mm: improve function of sc->may_writepage
Make sc->may_writepage control the writeout behavior of shrink_list.
Remove the laptop_mode trick from shrink_list and instead set may_writepage
in try_to_free_pages properly.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/vmscan.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 0ca6007d655b..a29efb2c06c8 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -492,7 +492,7 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc) | |||
492 | goto keep_locked; | 492 | goto keep_locked; |
493 | if (!may_enter_fs) | 493 | if (!may_enter_fs) |
494 | goto keep_locked; | 494 | goto keep_locked; |
495 | if (laptop_mode && !sc->may_writepage) | 495 | if (!sc->may_writepage) |
496 | goto keep_locked; | 496 | goto keep_locked; |
497 | 497 | ||
498 | /* Page is dirty, try to write it out here */ | 498 | /* Page is dirty, try to write it out here */ |
@@ -1170,7 +1170,7 @@ int try_to_free_pages(struct zone **zones, gfp_t gfp_mask) | |||
1170 | int i; | 1170 | int i; |
1171 | 1171 | ||
1172 | sc.gfp_mask = gfp_mask; | 1172 | sc.gfp_mask = gfp_mask; |
1173 | sc.may_writepage = 0; | 1173 | sc.may_writepage = !laptop_mode; |
1174 | sc.may_swap = 1; | 1174 | sc.may_swap = 1; |
1175 | 1175 | ||
1176 | inc_page_state(allocstall); | 1176 | inc_page_state(allocstall); |
@@ -1273,7 +1273,7 @@ loop_again: | |||
1273 | total_scanned = 0; | 1273 | total_scanned = 0; |
1274 | total_reclaimed = 0; | 1274 | total_reclaimed = 0; |
1275 | sc.gfp_mask = GFP_KERNEL; | 1275 | sc.gfp_mask = GFP_KERNEL; |
1276 | sc.may_writepage = 0; | 1276 | sc.may_writepage = !laptop_mode; |
1277 | sc.may_swap = 1; | 1277 | sc.may_swap = 1; |
1278 | sc.nr_mapped = read_page_state(nr_mapped); | 1278 | sc.nr_mapped = read_page_state(nr_mapped); |
1279 | 1279 | ||