From: Ian Jackson Subject: Re: [PATCH 1/3] libxl: Fix libxl_postfork_child_noexec deadlock etc. Date: Mon, 24 Feb 2014 15:56:27 +0000 Message-ID: <21259.27563.255108.357028@mariner.uk.xensource.com> References: <1393251555-22418-1-git-send-email-ian.jackson@eu.citrix.com> <1393251555-22418-2-git-send-email-ian.jackson@eu.citrix.com> <530B62A2.3080901@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <530B62A2.3080901@eu.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: George Dunlap Cc: xen-devel@lists.xensource.com, Ian Campbell , M A Young List-Id: xen-devel@lists.xenproject.org George Dunlap writes ("Re: [PATCH 1/3] libxl: Fix libxl_postfork_child_noexec deadlock etc."): > So it looks like this path gets called from a number of other places in xl: > > libxl_postfork_child_noexec() is called by xl.c:postfork(). In the old code the deadlock only happens when ctx->sigchld_user_registered (for the ctx passed to libxl_postfork_child_noexec). Because xl uses .chldowner = libxl_sigchld_owner_libxl rather than libxl_sigchld_owner_libxl_always, sigchld_user_registered is only true when libxl actually has a child process. In the single-threaded synchronous model used by xl for its long_running operations (ie always passing ao_how==0), libxl only has children _during_ the libxl call, when libxl calls back to the application with a progress callback. That's what happens in the pygrub case: xl needs to restart the console viewer. > postfork() is called in xl_cmdimpl.c by autoconnect_vncviewer(), > autoconnect_console(), and do_daemonize(). osstest doesn't use `xl create -c' so they weren't tested anyway. But it also works just fine in the non-pygrub case. Likewise `xl create -V' (autoconnect_vncviewer) works too. > do_daemonize() is called during "xl create", and "xl devd". These work without the bugfix. > Was this deadlock not triggered for those, or was it triggered and > nobody noticed? Mostly, the former. Ian.