From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bD6aF-0006Pi-Jc for qemu-devel@nongnu.org; Wed, 15 Jun 2016 04:54:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bD6aA-0006SK-L2 for qemu-devel@nongnu.org; Wed, 15 Jun 2016 04:53:58 -0400 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:38910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bD6aA-0006SB-Dz for qemu-devel@nongnu.org; Wed, 15 Jun 2016 04:53:54 -0400 Received: by mail-wm0-x234.google.com with SMTP id m124so25320076wme.1 for ; Wed, 15 Jun 2016 01:53:54 -0700 (PDT) Sender: Paolo Bonzini 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: Wed, 15 Jun 2016 10:53:50 +0200 MIME-Version: 1.0 In-Reply-To: <1465928228-1184-3-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=windows-1252 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 , qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Jeff Cody , mreitz@redhat.com, jjherne@linux.vnet.ibm.com On 14/06/2016 20:17, Stefan Hajnoczi wrote: > Block jobs are coroutines that usually perform I/O but sometimes also > sleep or yield. Currently only sleeping or yielded block jobs can be > paused. This means jobs that do not sleep or yield (using > block_job_yield()) are unaffected by block_job_pause(). > > Add block_job_pause_point() so that block jobs can mark quiescent points > that are suitable for pausing. This solves the problem that it can take > a block job a long time to pause if it is performing a long series of > I/O operations. > > Transitioning to paused state involves a .pause()/.resume() callback. > These callbacks are used to ensure that I/O and event loop activity has > ceased while the job is at a pause point. > > Note that this patch introduces a stricter pause state than previously. > The job->busy flag was incorrectly documented as a quiescent state > without I/O pending. This is violated by any job that has I/O pending > across sleep or block_job_yield(), like the mirror block job. Right, we should document job->busy as a quiescent state where no one will re-enter the coroutine. Paolo