Skip to content

Commit

Permalink
[PATCH] mm: improve function of sc->may_writepage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Feb 1, 2006
1 parent ce2ea89 commit 52a8363
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc)
goto keep_locked;
if (!may_enter_fs)
goto keep_locked;
if (laptop_mode && !sc->may_writepage)
if (!sc->may_writepage)
goto keep_locked;

/* Page is dirty, try to write it out here */
Expand Down Expand Up @@ -1170,7 +1170,7 @@ int try_to_free_pages(struct zone **zones, gfp_t gfp_mask)
int i;

sc.gfp_mask = gfp_mask;
sc.may_writepage = 0;
sc.may_writepage = !laptop_mode;
sc.may_swap = 1;

inc_page_state(allocstall);
Expand Down Expand Up @@ -1273,7 +1273,7 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages, int order)
total_scanned = 0;
total_reclaimed = 0;
sc.gfp_mask = GFP_KERNEL;
sc.may_writepage = 0;
sc.may_writepage = !laptop_mode;
sc.may_swap = 1;
sc.nr_mapped = read_page_state(nr_mapped);

Expand Down

0 comments on commit 52a8363

Please sign in to comment.