From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bD6ZX-00061F-8n for qemu-devel@nongnu.org; Wed, 15 Jun 2016 04:53:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bD6ZW-0006Dp-6a for qemu-devel@nongnu.org; Wed, 15 Jun 2016 04:53:15 -0400 References: <1465917916-22348-1-git-send-email-den@openvz.org> <1465917916-22348-9-git-send-email-den@openvz.org> <5760D702.208@redhat.com> From: "Denis V. Lunev" Message-ID: <5761176B.9050900@openvz.org> Date: Wed, 15 Jun 2016 11:52:59 +0300 MIME-Version: 1.0 In-Reply-To: <5760D702.208@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 8/9] mirror: use synch scheme for drive mirror List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org, qemu-block@nongnu.org Cc: vsementsov@virtuozzo.com, Stefan Hajnoczi , Fam Zheng , Kevin Wolf , Max Reitz , Jeff Cody On 06/15/2016 07:18 AM, Eric Blake wrote: > On 06/14/2016 09:25 AM, Denis V. Lunev wrote: >> Block commit of the active image to the backing store on a slow disk >> could never end. For example with the guest with the following loop >> inside >> while true; do >> dd bs=1k count=1 if=/dev/zero of=x >> done >> running above slow storage could not complete the operation with a > s/with/within/ > >> resonable amount of time: > s/resonable/reasonable/ > >> virsh blockcommit rhel7 sda --active --shallow >> virsh qemu-monitor-event >> virsh qemu-monitor-command rhel7 \ >> '{"execute":"block-job-complete",\ >> "arguments":{"device":"drive-scsi0-0-0-0"} }' >> virsh qemu-monitor-event >> Completion event is never received. >> >> This problem could not be fixed easily with the current architecture. We >> should either prohibit guest writes (making dirty bitmap dirty) or switch >> to the sycnchronous scheme. > s/sycnchronous/synchronous/ > >> This patch implements the latter. It adds mirror_before_write_notify >> callback. In this case all data written from the guest is synchnonously > s/synchnonously/synchronously/ > >> written to the mirror target. Though the problem is solved partially. >> We should switch from bdrv_dirty_bitmap to simple hbitmap. This will be >> done in the next patch. >> > In other words, the mere act of mirroring a guest will now be > guest-visible in that the guest is auto-throttled while waiting for the > mirroring to be written out. It seems like you would want to be able to > opt in or out of this scheme. Is it something that can be toggled > mid-operation (try asynchronous, and switch to synchronous if a timeout > elapses)? > >> Signed-off-by: Denis V. Lunev >> Reviewed-by: Vladimir Sementsov-Ogievskiy >> CC: Stefan Hajnoczi >> CC: Fam Zheng >> CC: Kevin Wolf >> CC: Max Reitz >> CC: Jeff Cody >> CC: Eric Blake >> --- >> block/mirror.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 78 insertions(+) >> > I'll leave the actual idea to others to review, because there may be > some ramifications that I'm not thinking of. > I would like to start the discussion with this series. Yes, may be we need the policy and should switch to synch scheme after the first stage of mirroring (when 'complete' command is sent by the management layer. This could be done relatively easily on the base of this patches. Really. Though I want to obtain some general acceptance in advance. Den P.S. Thank you very much for looking at this ;)