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/ksm.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/ksm.c')
-rw-r--r-- | mm/ksm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -318,14 +318,14 @@ static void hold_anon_vma(struct rmap_item *rmap_item, | |||
318 | struct anon_vma *anon_vma) | 318 | struct anon_vma *anon_vma) |
319 | { | 319 | { |
320 | rmap_item->anon_vma = anon_vma; | 320 | rmap_item->anon_vma = anon_vma; |
321 | atomic_inc(&anon_vma->ksm_refcount); | 321 | atomic_inc(&anon_vma->external_refcount); |
322 | } | 322 | } |
323 | 323 | ||
324 | static void drop_anon_vma(struct rmap_item *rmap_item) | 324 | static void drop_anon_vma(struct rmap_item *rmap_item) |
325 | { | 325 | { |
326 | struct anon_vma *anon_vma = rmap_item->anon_vma; | 326 | struct anon_vma *anon_vma = rmap_item->anon_vma; |
327 | 327 | ||
328 | if (atomic_dec_and_lock(&anon_vma->ksm_refcount, &anon_vma->lock)) { | 328 | if (atomic_dec_and_lock(&anon_vma->external_refcount, &anon_vma->lock)) { |
329 | int empty = list_empty(&anon_vma->head); | 329 | int empty = list_empty(&anon_vma->head); |
330 | spin_unlock(&anon_vma->lock); | 330 | spin_unlock(&anon_vma->lock); |
331 | if (empty) | 331 | if (empty) |