aboutsummaryrefslogtreecommitdiffstats
path: root/mm/rmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/rmap.c')
-rw-r--r--mm/rmap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index 0feeef860a8f..f522cb008646 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -250,7 +250,8 @@ 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) && !ksm_refcount(anon_vma) &&
254 !migrate_refcount(anon_vma);
254 spin_unlock(&anon_vma->lock); 255 spin_unlock(&anon_vma->lock);
255 256
256 if (empty) 257 if (empty)
@@ -275,6 +276,7 @@ static void anon_vma_ctor(void *data)
275 276
276 spin_lock_init(&anon_vma->lock); 277 spin_lock_init(&anon_vma->lock);
277 ksm_refcount_init(anon_vma); 278 ksm_refcount_init(anon_vma);
279 migrate_refcount_init(anon_vma);
278 INIT_LIST_HEAD(&anon_vma->head); 280 INIT_LIST_HEAD(&anon_vma->head);
279} 281}
280 282
@@ -1355,10 +1357,8 @@ static int rmap_walk_anon(struct page *page, int (*rmap_one)(struct page *,
1355 /* 1357 /*
1356 * Note: remove_migration_ptes() cannot use page_lock_anon_vma() 1358 * Note: remove_migration_ptes() cannot use page_lock_anon_vma()
1357 * because that depends on page_mapped(); but not all its usages 1359 * because that depends on page_mapped(); but not all its usages
1358 * are holding mmap_sem, which also gave the necessary guarantee 1360 * are holding mmap_sem. Users without mmap_sem are required to
1359 * (that this anon_vma's slab has not already been destroyed). 1361 * take a reference count to prevent the anon_vma disappearing
1360 * This needs to be reviewed later: avoiding page_lock_anon_vma()
1361 * is risky, and currently limits the usefulness of rmap_walk().
1362 */ 1362 */
1363 anon_vma = page_anon_vma(page); 1363 anon_vma = page_anon_vma(page);
1364 if (!anon_vma) 1364 if (!anon_vma)