aboutsummaryrefslogtreecommitdiffstats
path: root/mm/migrate.c
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2010-05-24 17:32:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 11:06:58 -0400
commit7f60c214fd3a360461f3286c6908084f7f8b1950 (patch)
treedba48cf988a22a40796187c7274f7903a288f7f4 /mm/migrate.c
parent3f6c82728f4e31a97c3a1b32abccb512fed0b573 (diff)
mm: migration: share the anon_vma ref counts between KSM and page migration
For clarity of review, KSM and page migration have separate refcounts on the anon_vma. While clear, this is a waste of memory. This patch gets KSM and page migration to share their toys in a spirit of harmony. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Reviewed-by: Christoph Lameter <cl@linux-foundation.org> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r--mm/migrate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index b768a1d4fa43..42a3d24d1107 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -601,7 +601,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
601 rcu_read_lock(); 601 rcu_read_lock();
602 rcu_locked = 1; 602 rcu_locked = 1;
603 anon_vma = page_anon_vma(page); 603 anon_vma = page_anon_vma(page);
604 atomic_inc(&anon_vma->migrate_refcount); 604 atomic_inc(&anon_vma->external_refcount);
605 } 605 }
606 606
607 /* 607 /*
@@ -643,7 +643,7 @@ skip_unmap:
643rcu_unlock: 643rcu_unlock:
644 644
645 /* Drop an anon_vma reference if we took one */ 645 /* Drop an anon_vma reference if we took one */
646 if (anon_vma && atomic_dec_and_lock(&anon_vma->migrate_refcount, &anon_vma->lock)) { 646 if (anon_vma && atomic_dec_and_lock(&anon_vma->external_refcount, &anon_vma->lock)) {
647 int empty = list_empty(&anon_vma->head); 647 int empty = list_empty(&anon_vma->head);
648 spin_unlock(&anon_vma->lock); 648 spin_unlock(&anon_vma->lock);
649 if (empty) 649 if (empty)