aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/mm.c
diff options
context:
space:
mode:
authorDan Magenheimer <dan.magenheimer@oracle.com>2012-12-10 11:15:53 +0000
committerDan Magenheimer <dan.magenheimer@oracle.com>2012-12-10 11:15:53 +0000
commit1c3b9dd61dabb6415fad0c0ae432a4a78bfca7f5 (patch)
treeee94213bc075524ee82cb8873c88d8bca0716977 /xen/arch/x86/mm.c
parente93e0d9d73ce77bd1f3471af68a194b47e0e8c45 (diff)
downloadxen-1c3b9dd61dabb6415fad0c0ae432a4a78bfca7f5.tar.gz
xen-1c3b9dd61dabb6415fad0c0ae432a4a78bfca7f5.tar.bz2
xen-1c3b9dd61dabb6415fad0c0ae432a4a78bfca7f5.zip
xen: centralize accounting for domain tot_pages
Provide and use a common function for all adjustments to a domain's tot_pages counter in anticipation of future and/or out-of-tree patches that must adjust related counters atomically. Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/mm.c')
-rw-r--r--xen/arch/x86/mm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 3657b258cd..c474e587ec 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3843,7 +3843,7 @@ int donate_page(
{
if ( d->tot_pages >= d->max_pages )
goto fail;
- d->tot_pages++;
+ domain_adjust_tot_pages(d, 1);
}
page->count_info = PGC_allocated | 1;
@@ -3893,7 +3893,7 @@ int steal_page(
} while ( (y = cmpxchg(&page->count_info, x, x | 1)) != x );
/* Unlink from original owner. */
- if ( !(memflags & MEMF_no_refcount) && !--d->tot_pages )
+ if ( !(memflags & MEMF_no_refcount) && !domain_adjust_tot_pages(d, -1) )
drop_dom_ref = 1;
page_list_del(page, &d->page_list);