[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] x86/mem_sharing: Don't destroy a page's shared state before depleting its <gfn, domid> tuple list
# HG changeset patch # User Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx> # Date 1335430988 -3600 # Node ID 6ff8e44e8d29ce3bc42a621d660513ab9df19cd8 # Parent 12bc6abfc2649b73d8966c869c207b9e9f67edb0 x86/mem_sharing: Don't destroy a page's shared state before depleting its <gfn, domid> tuple list Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx> Acked-by: Tim Deegan <tim@xxxxxxx> Committed-by: Tim Deegan <tim@xxxxxxx> --- diff -r 12bc6abfc264 -r 6ff8e44e8d29 xen/arch/x86/mm/mem_sharing.c --- a/xen/arch/x86/mm/mem_sharing.c Thu Apr 26 10:03:08 2012 +0100 +++ b/xen/arch/x86/mm/mem_sharing.c Thu Apr 26 10:03:08 2012 +0100 @@ -963,7 +963,9 @@ gfn_found: last_gfn = list_has_one_entry(&page->sharing->gfns); if ( last_gfn ) { - /* Clean up shared state */ + /* Clean up shared state. Get rid of the <domid, gfn> tuple + * before destroying the rmap. */ + mem_sharing_gfn_destroy(d, gfn_info); audit_del_list(page); page->sharing = NULL; atomic_dec(&nr_shared_mfns); @@ -974,7 +976,8 @@ gfn_found: * (possibly freeing the page), and exit early */ if ( flags & MEM_SHARING_DESTROY_GFN ) { - mem_sharing_gfn_destroy(d, gfn_info); + if ( !last_gfn ) + mem_sharing_gfn_destroy(d, gfn_info); put_page_and_type(page); mem_sharing_page_unlock(page); if ( last_gfn && @@ -987,7 +990,6 @@ gfn_found: if ( last_gfn ) { - mem_sharing_gfn_destroy(d, gfn_info); /* Making a page private atomically unlocks it */ BUG_ON(page_make_private(d, page) != 0); goto private_page_found; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |