Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18907
b: refs/heads/master
c: f1fd106
h: refs/heads/master
i:
  18905: ad69350
  18903: 113640f
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Jan 19, 2006
1 parent 44df614 commit 8521910
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fc3012896337c83a056c496d7cfb0072e1591181
refs/heads/master: f1fd1067ece574ab56e4a70878b9a5a1ed4c3c42
7 changes: 7 additions & 0 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ struct scan_control {

int may_writepage;

/* Can pages be swapped as part of reclaim? */
int may_swap;

/* This context's SWAP_CLUSTER_MAX. If freeing memory for
* suspend, we effectively ignore SWAP_CLUSTER_MAX.
* In this context, it doesn't matter that we scan the
Expand Down Expand Up @@ -458,6 +461,8 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc)
* Try to allocate it some swap space here.
*/
if (PageAnon(page) && !PageSwapCache(page)) {
if (!sc->may_swap)
goto keep_locked;
if (!add_to_swap(page, GFP_ATOMIC))
goto activate_locked;
}
Expand Down Expand Up @@ -1166,6 +1171,7 @@ int try_to_free_pages(struct zone **zones, gfp_t gfp_mask)

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

inc_page_state(allocstall);

Expand Down Expand Up @@ -1268,6 +1274,7 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages, int order)
total_reclaimed = 0;
sc.gfp_mask = GFP_KERNEL;
sc.may_writepage = 0;
sc.may_swap = 1;
sc.nr_mapped = read_page_state(nr_mapped);

inc_page_state(pageoutrun);
Expand Down

0 comments on commit 8521910

Please sign in to comment.