[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v4 1/4] x86/mem_sharing: reorder when pages are unlocked and released



>>> On 03.05.19 at 00:13, <tamas@xxxxxxxxxxxxx> wrote:
> @@ -1002,7 +989,10 @@ static int share_pages(struct domain *sd, gfn_t sgfn, 
> shr_handle_t sh,
>      /* Free the client page */
>      if(test_and_clear_bit(_PGC_allocated, &cpage->count_info))
>          put_page(cpage);
> -    put_page(cpage);
> +
> +    BUG_ON(!put_count);
> +    while ( put_count-- )
> +        put_page_and_type(cpage);

Strictly speaking I think the BUG_ON() should be moved ahead of the
if() in context, so that a problematic put_page() would not get
executed in the first place (even if the system is to die soon after).

Jan



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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.