From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: Re: [PATCH 06/23] libxl: init: libxl__poller_init and _get take gc Date: Thu, 19 Dec 2013 17:27:58 +0000 Message-ID: <21171.11422.48239.602523@mariner.uk.xensource.com> References: <1387305337-15355-1-git-send-email-ian.jackson@eu.citrix.com> <1387305337-15355-7-git-send-email-ian.jackson@eu.citrix.com> <1387458052.9925.65.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1387458052.9925.65.camel@kazak.uk.xensource.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: Shriram Rajagopalan , George Dunlap , xen-devel@lists.xensource.com, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [PATCH 06/23] libxl: init: libxl__poller_init and _get take gc"): > On Tue, 2013-12-17 at 18:35 +0000, Ian Jackson wrote: > > @@ -1622,7 +1617,7 @@ libxl__ao *libxl__ao_create(libxl_ctx *ctx, uint32_t domid, > > if (how) { > > ao->how = *how; > > } else { > > - ao->poller = libxl__poller_get(ctx); > > + ao->poller = libxl__poller_get(&ao->gc); > > this is a bit subtle, libxl__poller_get would previously have gotten the > toplevel ctx gc and not the ao-gc, if it had thought to init a GC at > all. Yes. > It only actually uses whatever it gets for logging, so that's ok, but > I'm not sure which would be the correct/expected gc to use. I take it > you considered this? Indeed. > libxl__poller_get does a NOGC allocation and the associated manual > memory mgmt -- now that it has the ao->gc in hand could it use that? Is > the poller's lifecycle entirely contained within the ao? No, it isn't. The poller is longer-lived, mainly as a way to avoid having to recreate the pipe on each occasion. Ian.