|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] x86/mm: Allow a page in p2m_ram_paged_out state to be loaded
# HG changeset patch
# User Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
# Date 1326365550 0
# Node ID 75b8e982eb7e9346d157daf89a9b42f94fcab157
# Parent 9cdcedc133e5227c635dbb00bd4779015311107a
x86/mm: Allow a page in p2m_ram_paged_out state to be loaded
This removes the need for a page to be accessed in order to be pageable
again. A pager can now page-in pages at will with no need to map them
in a separate thread.
Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
Acked-by: Tim Deegan <tim@xxxxxxx>
Committed-by: Tim Deegan <tim@xxxxxxx>
---
diff -r 9cdcedc133e5 -r 75b8e982eb7e xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c Wed Jan 11 10:34:45 2012 +0100
+++ b/xen/arch/x86/mm/p2m.c Thu Jan 12 10:52:30 2012 +0000
@@ -964,7 +964,7 @@
int p2m_mem_paging_prep(struct domain *d, unsigned long gfn, uint64_t buffer)
{
struct page_info *page;
- p2m_type_t p2mt;
+ p2m_type_t p2mt, target_p2mt;
p2m_access_t a;
mfn_t mfn;
struct p2m_domain *p2m = p2m_get_hostp2m(d);
@@ -982,8 +982,8 @@
mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query, NULL);
ret = -ENOENT;
- /* Allow only missing pages */
- if ( p2mt != p2m_ram_paging_in_start )
+ /* Allow missing pages */
+ if ( (p2mt != p2m_ram_paging_in_start) && (p2mt != p2m_ram_paged) )
goto out;
/* Allocate a page if the gfn does not have one yet */
@@ -1018,8 +1018,15 @@
}
}
+ target_p2mt = (p2mt == p2m_ram_paging_in_start) ?
+ /* If we kicked the pager with a populate event, the pager will send
+ * a resume event back */
+ p2m_ram_paging_in :
+ /* If this was called asynchronously by the pager, then we can
+ * transition directly to the final guest-accessible type */
+ (paging_mode_log_dirty(d) ? p2m_ram_logdirty : p2m_ram_rw);
/* Fix p2m mapping */
- set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2m_ram_paging_in, a);
+ set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, target_p2mt, a);
atomic_dec(&d->paged_pages);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |