From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: Re: [PATCH 17/29] libxl: cancellation: Provide public ao cancellation API Date: Tue, 31 Mar 2015 19:33:24 +0100 Message-ID: <21786.59508.990333.644604@mariner.uk.xensource.com> References: <1423599016-32639-1-git-send-email-ian.jackson@eu.citrix.com> <1423599016-32639-18-git-send-email-ian.jackson@eu.citrix.com> <1427197737.21742.361.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1427197737.21742.361.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel@lists.xensource.com, Euan Harris List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [Xen-devel] [PATCH 17/29] libxl: cancellation: Provide public ao cancellation API"): > On Tue, 2015-02-10 at 20:10 +0000, Ian Jackson wrote: > > + /* > > + * For nested aos: > > + * Semantically, cancellation affects the whole tree of aos, > > + * not just the parent. > > + * libxl__ao_cancellable.ao refers to the child, so > > + * that the child callback sees the right ao. (After all, > > + * it was code dealing with the child that set .ao.) > > + * But, the cancellable is recorded on the "cancellables" list > > + * for the ultimate root ao, so that every possible child > > + * cancellation occurs as a result of the cancellation of the > > + * parent. > > + * We set ao->cancelling only in the root. > > + */ > > WRT this, given a tree of ao's, which ones need to be cancellable for a > cancellation to succeed? I would assume all of them do, or else the > cancellation can only occur if/when the non-cancellable ones happen to > end? It depends what you mean by `succeed'. libxl_ao_cancel reports success if it did something. That is, if anyone was listening. For this purpose, with a tree of ao's, it is sufficient for any one of the children to have registered a cancellable. > Do we(/are we going to) take steps to stop new non-cancellable ao's to > the tree once the root is cancelled? Yes. Individual callback setups, and operations, can check by calling libxl__ao_cancelling. Normally this is done by libxl__ao_cancellable_register: it is not possible to register a new cancellable for an ao which we are supposed to be cancelling. This affects, for example, libxl__ev_time_register_*. Ian.