|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 1 of 3] x86/mem_sharing: Don't destroy a page's shared state before depleting its <gfn, domid> tuple list
xen/arch/x86/mm/mem_sharing.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
diff -r 08946bbc8036 -r 796b523346ac xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -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-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |