On 20/11/2018 16:17, Jan Beulich wrote:
> When such pages get assigned to domains (and hence their ->tot_pages
> not incremented accordingly) we would otherwise also need to suppress
> decrementing the count when freeing those pages.
>
> Signed-off-by: Jan Beulich <jbeul...@suse.com>
>
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -2303,6 +2303,8 @@ struct page_info *alloc_domheap_pages(
>  
>      if ( memflags & MEMF_no_owner )
>          memflags |= MEMF_no_refcount;
> +    else if ( (memflags & MEMF_no_refcount) && d )
> +        return NULL;

Perhaps ASSERT_UNREACHABLE() in here as well?

As we've learnt the hard way, this is definitely a programming error, so
providing a stack trace is liable to be more helpful to someone
debugging why their memory allocations are suddenly failing.

~Andrew

>  
>      if ( dma_bitsize && ((dma_zone = bits_to_zone(dma_bitsize)) < zone_hi) )
>          pg = alloc_heap_pages(dma_zone + 1, zone_hi, order, memflags, d);
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to