From aeec4a5efe9fbc7363b6ad72a37a85c3fa37bbe2 Mon Sep 17 00:00:00 2001 From: Minchan Kim Date: Mon, 31 Oct 2011 17:06:44 -0700 Subject: [PATCH] --- yaml --- r: 272107 b: refs/heads/master c: b9e84ac1536d35aee03b2601f19694949f0bd506 h: refs/heads/master i: 272105: 77677b1b8b723bbffd93e4e4b246e9f6f61a1f96 272103: 889225df5e79764dce78e022beb798a3f52b4fc3 v: v3 --- [refs] | 2 +- trunk/mm/compaction.c | 18 +++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index 2c0e2f9f59ed..59294195f962 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fcf634098c00dd9cd247447368495f0b79be12d1 +refs/heads/master: b9e84ac1536d35aee03b2601f19694949f0bd506 diff --git a/trunk/mm/compaction.c b/trunk/mm/compaction.c index 6cc604bd5649..b2977a5d659a 100644 --- a/trunk/mm/compaction.c +++ b/trunk/mm/compaction.c @@ -35,10 +35,6 @@ struct compact_control { unsigned long migrate_pfn; /* isolate_migratepages search base */ bool sync; /* Synchronous migration */ - /* Account for isolated anon and file pages */ - unsigned long nr_anon; - unsigned long nr_file; - unsigned int order; /* order a direct compactor needs */ int migratetype; /* MOVABLE, RECLAIMABLE etc */ struct zone *zone; @@ -223,17 +219,13 @@ static void isolate_freepages(struct zone *zone, static void acct_isolated(struct zone *zone, struct compact_control *cc) { struct page *page; - unsigned int count[NR_LRU_LISTS] = { 0, }; + unsigned int count[2] = { 0, }; - list_for_each_entry(page, &cc->migratepages, lru) { - int lru = page_lru_base_type(page); - count[lru]++; - } + list_for_each_entry(page, &cc->migratepages, lru) + count[!!page_is_file_cache(page)]++; - cc->nr_anon = count[LRU_ACTIVE_ANON] + count[LRU_INACTIVE_ANON]; - cc->nr_file = count[LRU_ACTIVE_FILE] + count[LRU_INACTIVE_FILE]; - __mod_zone_page_state(zone, NR_ISOLATED_ANON, cc->nr_anon); - __mod_zone_page_state(zone, NR_ISOLATED_FILE, cc->nr_file); + __mod_zone_page_state(zone, NR_ISOLATED_ANON, count[0]); + __mod_zone_page_state(zone, NR_ISOLATED_FILE, count[1]); } /* Similar to reclaim, but different enough that they don't share logic */