From 6f8981467e8ef470fe42fe43a636340c1416e853 Mon Sep 17 00:00:00 2001 From: Martin Hicks Date: Tue, 21 Jun 2005 17:14:40 -0700 Subject: [PATCH] --- yaml --- r: 2443 b: refs/heads/master c: bfbb38fb808ac23ef44472d05d9bb36edfb49ed0 h: refs/heads/master i: 2441: 8fc9c022a3bd2b1b77f72d8df583a5d3a731a5b9 2439: 569a21cc75c085f171e9c03822973772cea284ad v: v3 --- [refs] | 2 +- trunk/mm/vmscan.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 12f8449288e8..6f793b28cf12 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 295ab93497ec703f7d6eaf0787dd9768b83035fe +refs/heads/master: bfbb38fb808ac23ef44472d05d9bb36edfb49ed0 diff --git a/trunk/mm/vmscan.c b/trunk/mm/vmscan.c index c62cadce0426..6379ddbffd9b 100644 --- a/trunk/mm/vmscan.c +++ b/trunk/mm/vmscan.c @@ -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 @@ -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; } @@ -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); @@ -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);