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

Re: [PATCH 2/3] xen/domain: Introduce domain_teardown()


  • To: Julien Grall <julien@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 21 Dec 2020 18:45:19 +0000
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 21 Dec 2020 18:45:35 +0000
  • Ironport-sdr: KmrKu6tyXI44dlyjth7EerEZMBcoOmchz5Fv/c06MGRdHEIjQe5FSakBUmK3TBQcWKu8p6evJl HhT6sZByUk9fBTlVcyXUEaRrt8/871XfWdzPQO+QPfBBVnUhdW1gVe2A6WBoPiEAKAh0g8TYCu V3P5Ocy0g9tiA2QHeVGMJYmfiXiw429V1Qqnb90dKHPkF6Ci4dEhYcqZv1rsruz1zkjBI+pLe6 mvFKIuE5AsYkZ1AjpgYhXhBa67r/3AvWiCv2xVLmg82DvzS513mfBcTIDFCiQ+fjDN3lFqSic0 XIo=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21/12/2020 18:36, Julien Grall wrote:
>> @@ -553,6 +606,9 @@ struct domain *domain_create(domid_t domid,
>>       if ( init_status & INIT_watchdog )
>>           watchdog_domain_destroy(d);
>>   +    /* Must not hit a continuation in this context. */
>> +    ASSERT(domain_teardown(d) == 0);
> The ASSERT() will become a NOP in production build, so
> domain_teardown_down() will not be called.

Urgh - its not really a nop, but it's evaluation isn't symmetric between
debug and release builds.  I'll need an extra local variable.

>
> However, I think it would be better if we pass an extra argument to
> indicated wheter the code is allowed to preempt. This would make the
> preemption check more obvious in evtchn_destroy() compare to the
> current d->is_dying != DOMDYING_dead.

We can have a predicate if you'd prefer, but plumbing an extra parameter
is wasteful, and can only cause confusion if it is out of sync with
d->is_dying.

~Andrew



 


Rackspace

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