[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2 2/2] make domain_adjust_tot_pages() __must_check
Even if unlikely, donate_page() should not ignore the possible need to obtain a domain reference. To make people look more closely when they add new uses of domain_adjust_tot_pages(), force its return value to be checked. This in turn requires a benign change to assign_pages(). Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -4009,7 +4009,8 @@ int donate_page( { if ( d->tot_pages >= d->max_pages ) goto fail; - domain_adjust_tot_pages(d, 1); + if ( unlikely(domain_adjust_tot_pages(d, 1) == 1) ) + get_knownalive_domain(d); } page->count_info = PGC_allocated | 1; --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -2273,10 +2273,8 @@ int assign_pages( goto out; } - if ( unlikely(d->tot_pages == 0) ) + if ( unlikely(domain_adjust_tot_pages(d, 1 << order) == (1 << order)) ) get_knownalive_domain(d); - - domain_adjust_tot_pages(d, 1 << order); } for ( i = 0; i < (1 << order); i++ ) --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -190,7 +190,8 @@ int destroy_xen_mappings(unsigned long v */ int populate_pt_range(unsigned long virt, unsigned long nr_mfns); /* Claim handling */ -unsigned long domain_adjust_tot_pages(struct domain *d, long pages); +unsigned long __must_check domain_adjust_tot_pages(struct domain *d, + long pages); int domain_set_outstanding_pages(struct domain *d, unsigned long pages); void get_outstanding_claims(uint64_t *free_pages, uint64_t *outstanding_pages); _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |