diff options
author | Dan Magenheimer <dan.magenheimer@oracle.com> | 2012-12-10 11:15:53 +0000 |
---|---|---|
committer | Dan Magenheimer <dan.magenheimer@oracle.com> | 2012-12-10 11:15:53 +0000 |
commit | 1c3b9dd61dabb6415fad0c0ae432a4a78bfca7f5 (patch) | |
tree | ee94213bc075524ee82cb8873c88d8bca0716977 /xen/arch/x86/mm | |
parent | e93e0d9d73ce77bd1f3471af68a194b47e0e8c45 (diff) | |
download | xen-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')
-rw-r--r-- | xen/arch/x86/mm/mem_sharing.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c index 510328554e..e91aac5cfd 100644 --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -639,7 +639,7 @@ static int page_make_sharable(struct domain *d, } page_set_owner(page, dom_cow); - d->tot_pages--; + domain_adjust_tot_pages(d, -1); drop_dom_ref = (d->tot_pages == 0); page_list_del(page, &d->page_list); spin_unlock(&d->page_alloc_lock); @@ -680,7 +680,7 @@ static int page_make_private(struct domain *d, struct page_info *page) ASSERT(page_get_owner(page) == dom_cow); page_set_owner(page, d); - if ( d->tot_pages++ == 0 ) + if ( domain_adjust_tot_pages(d, 1) == 1 ) get_domain(d); page_list_add_tail(page, &d->page_list); spin_unlock(&d->page_alloc_lock); |