Re: [Xen-devel] Re: [PATCH 01/10] xen: Make all reserved pages forthe balloon be INVALID_P2M_ENTRY.

From: Ian Campbell
Date: Wed Dec 22 2010 - 03:50:54 EST


On Tue, 2010-12-21 at 22:19 +0000, Jeremy Fitzhardinge wrote:
> On 12/21/2010 01:37 PM, Konrad Rzeszutek Wilk wrote:
> > + BUG_ON(!set_phys_to_machine(pfn, INVALID_P2M_ENTRY));
[...]
> I'm not a fan of hiding real side-effectful code in a BUG_ON
> predicate.
>
> > + BUG_ON(get_phys_to_machine(pfn) != INVALID_P2M_ENTRY);

I'm also not a fan of this "is the previous I called function buggy"
BUG_ON.

If we aren't confident that set_phys_to_machine() is doing the right
thing then adding a post-condition check to that function would be a
more preferable option.

Ian.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/