mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[PATCH] Direct Migration V9: remove_from_swap() to remove swap ptes
Add remove_from_swap remove_from_swap() allows the restoration of the pte entries that existed before page migration occurred for anonymous pages by walking the reverse maps. This reduces swap use and establishes regular pte's without the need for page faults. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
a48d07afdf
commit
a3351e525e
5 changed files with 49 additions and 0 deletions
29
mm/rmap.c
29
mm/rmap.c
|
@ -206,6 +206,35 @@ out:
|
|||
return anon_vma;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MIGRATION
|
||||
/*
|
||||
* Remove an anonymous page from swap replacing the swap pte's
|
||||
* through real pte's pointing to valid pages and then releasing
|
||||
* the page from the swap cache.
|
||||
*
|
||||
* Must hold page lock on page.
|
||||
*/
|
||||
void remove_from_swap(struct page *page)
|
||||
{
|
||||
struct anon_vma *anon_vma;
|
||||
struct vm_area_struct *vma;
|
||||
|
||||
if (!PageAnon(page) || !PageSwapCache(page))
|
||||
return;
|
||||
|
||||
anon_vma = page_lock_anon_vma(page);
|
||||
if (!anon_vma)
|
||||
return;
|
||||
|
||||
list_for_each_entry(vma, &anon_vma->head, anon_vma_node)
|
||||
remove_vma_swap(vma, page);
|
||||
|
||||
spin_unlock(&anon_vma->lock);
|
||||
|
||||
delete_from_swap_cache(page);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* At what user virtual address is page expected in vma?
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue