Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2443
b: refs/heads/master
c: bfbb38f
h: refs/heads/master
i:
  2441: 8fc9c02
  2439: 569a21c
v: v3
  • Loading branch information
Martin Hicks authored and Linus Torvalds committed Jun 22, 2005
1 parent 699702c commit 6f89814
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 295ab93497ec703f7d6eaf0787dd9768b83035fe
refs/heads/master: bfbb38fb808ac23ef44472d05d9bb36edfb49ed0
7 changes: 6 additions & 1 deletion trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,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 @@ -414,7 +417,7 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc)
* Anonymous process memory has backing store?
* Try to allocate it some swap space here.
*/
if (PageAnon(page) && !PageSwapCache(page)) {
if (PageAnon(page) && !PageSwapCache(page) && sc->may_swap) {
if (!add_to_swap(page))
goto activate_locked;
}
Expand Down Expand Up @@ -927,6 +930,7 @@ int try_to_free_pages(struct zone **zones,

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

inc_page_state(allocstall);

Expand Down Expand Up @@ -1027,6 +1031,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 6f89814

Please sign in to comment.