From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDBic-0002ll-3l for qemu-devel@nongnu.org; Thu, 09 Jul 2015 09:18:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDBiW-0007pY-Ck for qemu-devel@nongnu.org; Thu, 09 Jul 2015 09:18:26 -0400 Date: Thu, 9 Jul 2015 15:18:10 +0200 (CEST) From: Alexandre DERUMIER Message-ID: <93211748.9122206.1436447890139.JavaMail.zimbra@oxygem.tv> In-Reply-To: <20150709130208.GD11166@stefanha-thinkpad.redhat.com> References: <1436413678-7114-1-git-send-email-famz@redhat.com> <20150709130208.GD11166@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 0/3] mirror: Fix guest responsiveness during bitmap scan List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Fam Zheng , qemu-devel , qemu-block@nongnu.org >>The other block jobs (stream, backup, commit) are still using=20 >>a 0 ns delay and are therefore broken.=20 Also in mirror.c, they are block_job_sleep_ns with delay_ns, where delay_ns= can be 0. I have seen sometime,some server/qmp hangs, on a pretty old server/slow dis= ks. (no more in bitmap scan with theses last patches, but on the block mirror i= tself) if (!s->synced) { block_job_sleep_ns(&s->common, QEMU_CLOCK_REALTIME, delay_ns); if (block_job_is_cancelled(&s->common)) { break; } } else if (!should_complete) { delay_ns =3D (s->in_flight =3D=3D 0 && cnt =3D=3D 0 ? SLICE_TIM= E : 0); ----- Mail original ----- De: "Stefan Hajnoczi" =C3=80: "Fam Zheng" Cc: "Kevin Wolf" , "qemu-devel" , = qemu-block@nongnu.org Envoy=C3=A9: Jeudi 9 Juillet 2015 15:02:08 Objet: Re: [Qemu-devel] [Qemu-block] [PATCH 0/3] mirror: Fix guest responsi= veness during bitmap scan On Thu, Jul 09, 2015 at 11:47:55AM +0800, Fam Zheng wrote:=20 > This supersedes:=20 >=20 > http://patchwork.ozlabs.org/patch/491415/=20 >=20 > and [1] which is currently in Jeff's tree.=20 >=20 > Although [1] fixed the QMP responsiveness, Alexandre DERUMIER reported th= at=20 > guest responsiveness still suffers when we are busy in the initial dirty = bitmap=20 > scanning loop of mirror job. That is because 1) we issue too many lseeks;= 2) we=20 > only sleep for 0 ns which turns out quite ineffective in yielding BQL to = vcpu=20 > threads. Both are fixed.=20 >=20 > To reproduce: start a guest, attach a 10G raw image, then mirror it. Your= =20 > guest will immediately start to stutter (with patch [1] testing on a loca= l ext4=20 > raw image, and "while echo -n .; do sleep 0.05; done" in guest console).= =20 >=20 > This series adds block_job_relax_cpu as suggested by Stefan Hajnoczi and = uses=20 > it in mirror job; and lets bdrv_is_allocated_above return a larger p_num = as=20 > suggested by Paolo Bonzini (although it's done without changing the API).= =20 >=20 > [1]: http://patchwork.ozlabs.org/patch/471656/ "block/mirror: Sleep=20 > periodically during bitmap scanning"=20 >=20 > Fam Zheng (3):=20 > blockjob: Introduce block_job_relax_cpu=20 > mirror: Use block_job_relax_cpu during bitmap scanning=20 > mirror: Speed up bitmap initial scanning=20 >=20 > block/mirror.c | 17 +++++++----------=20 > include/block/blockjob.h | 16 ++++++++++++++++=20 > 2 files changed, 23 insertions(+), 10 deletions(-)=20 This patch only converts the mirror block job to use the new relax=20 function. The other block jobs (stream, backup, commit) are still using=20 a 0 ns delay and are therefore broken. They should probably be=20 converted in the same series.=20