From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDXHx-0004W5-W0 for qemu-devel@nongnu.org; Thu, 16 Jun 2016 09:24:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDXHt-0006Oz-04 for qemu-devel@nongnu.org; Thu, 16 Jun 2016 09:24:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDXHs-0006Ou-Pe for qemu-devel@nongnu.org; Thu, 16 Jun 2016 09:24:48 -0400 References: <1465928228-1184-1-git-send-email-stefanha@redhat.com> <1465928228-1184-3-git-send-email-stefanha@redhat.com> From: Paolo Bonzini Message-ID: Date: Thu, 16 Jun 2016 15:24:43 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 2/5] blockjob: add pause points List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Stefan Hajnoczi , qemu-devel , Kevin Wolf , Jeff Cody , Fam Zheng , "Jason J. Herne" , Max Reitz On 16/06/2016 15:17, Stefan Hajnoczi wrote: >> Right, we should document job->busy as a quiescent state where no one >> will re-enter the coroutine. > > That statement doesn't correspond with how it's used: > > block_job_sleep_ns() leaves a timer pending and the job will re-enter > when the timer expires. So "no one will re-enter the coroutine" is > too strict. And of course you're right. :) What I (sloppily) meant was "where the block job code will not re-enter the coroutine", which is what makes it safe to call block_job_enter(). > The important thing is it's safe to call block_job_enter(). In the > block_job_sleep_ns() case the timer is cancelled to prevent doubly > re-entry. > > The doc comment I have in v4 allows the block_job_sleep_ns() case: > > /* > * Set to false by the job while the coroutine has yielded and may be > * re-entered by block_job_enter(). There may still be I/O or event loop > * activity pending. > */ > bool busy; Sounds good! Paolo