diff options
author | Mel Gorman <mel@csn.ul.ie> | 2010-05-24 17:32:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-25 11:06:58 -0400 |
commit | 7f60c214fd3a360461f3286c6908084f7f8b1950 (patch) | |
tree | dba48cf988a22a40796187c7274f7903a288f7f4 /mm/rmap.c | |
parent | 3f6c82728f4e31a97c3a1b32abccb512fed0b573 (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/rmap.c')
-rw-r--r-- | mm/rmap.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -250,8 +250,7 @@ static void anon_vma_unlink(struct anon_vma_chain *anon_vma_chain) | |||
250 | list_del(&anon_vma_chain->same_anon_vma); | 250 | list_del(&anon_vma_chain->same_anon_vma); |
251 | 251 | ||
252 | /* We must garbage collect the anon_vma if it's empty */ | 252 | /* We must garbage collect the anon_vma if it's empty */ |
253 | empty = list_empty(&anon_vma->head) && !ksm_refcount(anon_vma) && | 253 | empty = list_empty(&anon_vma->head) && !anonvma_external_refcount(anon_vma); |
254 | !migrate_refcount(anon_vma); | ||
255 | spin_unlock(&anon_vma->lock); | 254 | spin_unlock(&anon_vma->lock); |
256 | 255 | ||
257 | if (empty) | 256 | if (empty) |
@@ -275,8 +274,7 @@ static void anon_vma_ctor(void *data) | |||
275 | struct anon_vma *anon_vma = data; | 274 | struct anon_vma *anon_vma = data; |
276 | 275 | ||
277 | spin_lock_init(&anon_vma->lock); | 276 | spin_lock_init(&anon_vma->lock); |
278 | ksm_refcount_init(anon_vma); | 277 | anonvma_external_refcount_init(anon_vma); |
279 | migrate_refcount_init(anon_vma); | ||
280 | INIT_LIST_HEAD(&anon_vma->head); | 278 | INIT_LIST_HEAD(&anon_vma->head); |
281 | } | 279 | } |
282 | 280 | ||