Re: [PATCH 14/14] mm,migration: Allow the migration of PageSwapCache pages

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: KAMEZAWA Hiroyuki
Date: Wednesday, March 31, 2010 - 10:42 pm

On Thu, 1 Apr 2010 13:44:29 +0900
Minchan Kim <minchan.kim@gmail.com> wrote:

Hmm. Consiering again.

Now.
	if (PageAnon(page)) {
		rcu_locked = 1;
		rcu_read_lock();
		if (!page_mapped(page)) {
			if (!PageSwapCache(page))
				goto rcu_unlock;
		} else {
			anon_vma = page_anon_vma(page);
			atomic_inc(&anon_vma->external_refcount);
		}


Maybe this is a fix.

==
	skip_remap = 0;
	if (PageAnon(page)) {
		rcu_read_lock();
		if (!page_mapped(page)) {
			if (!PageSwapCache(page))
				goto rcu_unlock;
			/*
			 * We can't convice this anon_vma is valid or not because
			 * !page_mapped(page). Then, we do migration(radix-tree replacement)
			 * but don't remap it which touches anon_vma in page->mapping.
			 */
			skip_remap = 1;
			goto skip_unmap;
		} else {
			anon_vma = page_anon_vma(page);
			atomic_inc(&anon_vma->external_refcount);
		}
	}	
	.....copy page, radix-tree replacement,....

	if (!rc && !skip_remap)
		 remove_migration_ptes(page, page);
==

Thanks,
-Kame











--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ..., KAMEZAWA Hiroyuki, (Tue Mar 30, 10:26 pm)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ..., KAMEZAWA Hiroyuki, (Wed Mar 31, 4:57 pm)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ..., KAMEZAWA Hiroyuki, (Wed Mar 31, 8:01 pm)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ..., KAMEZAWA Hiroyuki, (Wed Mar 31, 10:42 pm)