From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Wolf Subject: Re: [RFC v2 PATCH] kvm tools, qcow: Add the support for copy-on-write clusters Date: Mon, 21 Nov 2011 09:30:48 +0100 Message-ID: <4ECA0C38.1050501@redhat.com> References: <1321606038-29989-1-git-send-email-tianyu.lan@intel.com> <4EC62F14.6090505@redhat.com> <625BA99ED14B2D499DC4E29D8138F1506860C491FF@shsmsx502.ccr.corp.intel.com> <625BA99ED14B2D499DC4E29D8138F1506860C49247@shsmsx502.ccr.corp.intel.com> <1321719998.2974.9.camel@sasha> <625BA99ED14B2D499DC4E29D8138F150690D67CB02@shsmsx502.ccr.corp.intel.com> <1321770182.3525.2.camel@lappy> <1321786772.1428.116.camel@jaguar> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Sasha Levin , "Lan, Tianyu" , "kvm@vger.kernel.org" , "asias.hejun@gmail.com" , "prasadjoshi124@gmail.com" To: Pekka Enberg Return-path: Received: from mx1.redhat.com ([209.132.183.28]:41674 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752543Ab1KUI17 (ORCPT ); Mon, 21 Nov 2011 03:27:59 -0500 In-Reply-To: <1321786772.1428.116.camel@jaguar> Sender: kvm-owner@vger.kernel.org List-ID: Am 20.11.2011 11:59, schrieb Pekka Enberg: > On Sun, 2011-11-20 at 14:14 +0800, Lan, Tianyu wrote: >>> OK. Thx. >>> But fsync is too slow. I try to find a way to sync a range of file. >>> Are there any solutions to meet my purpose? > > On Sun, 2011-11-20 at 08:23 +0200, Sasha Levin wrote: >> fdatasync() is as good as it'll get. >> >> tbh, maybe we should just consider opening QCOW images with O_SYNC and >> just get it over with? > > No, lets not do that. It's easier to improve the performance of correct > code that doesn't use O_SYNC. Yes, O_SYNC gives you horrible performance. With explicit fsyncs cluster allocation is somewhat slow (you can try to speed it up by batching updates like qemu does), but at least rewrites will perform reasonably close to raw. Kevin