From: Ian Jackson Subject: Re: [PATCH 2/2] call ao_how callback explicitly Date: Tue, 5 Nov 2013 15:51:21 +0000 Message-ID: <21113.5113.251975.983741@mariner.uk.xensource.com> References: <1383643331-6703-1-git-send-email-bjzhang@suse.com> <1383643331-6703-3-git-send-email-bjzhang@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1383643331-6703-3-git-send-email-bjzhang@suse.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: Bamvor Jian Zhang Cc: jfehlig@suse.com, stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Bamvor Jian Zhang writes ("[PATCH 2/2] call ao_how callback explicitly"): > ao_how callback is not called after inserted into list. > in my test, i directly call it in > libxl__ao_complete_check_progress_reports. i know it should not > work like this. Could you give some suggestion about it? I'm not sure what you mean. Under what conditions do you not see the callback happen ? The existing machinery is supposed to take care of that. Specifically, in the patch you're changing, libxl__ao_complete_check_progress_reports puts the ao onto egc->aos_for_callback. On the return path from the libxl event function back to the application, we are supposed to call libxl__egc_cleanup, which in turn calls egc_run_callbacks, which should pick up the aos on aos_for_callback. libxl__egc_cleanup is called from the event loops in libxl_event_wait and libxl__ao_inprogress and from the macro EGC_FREE. It should be impossible for a path to be missed because inside libxl one needs an egc to call libxl__ao_complete. What kind of an ao_how is your application passing to libxl ? Is your application multithreaded ? Ian.