From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8XRo-00026C-KZ for qemu-devel@nongnu.org; Thu, 02 Jun 2016 14:34:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8XRi-00068c-L0 for qemu-devel@nongnu.org; Thu, 02 Jun 2016 14:34:23 -0400 References: <1464883095-6285-1-git-send-email-den@openvz.org> From: "Denis V. Lunev" Message-ID: <57507C20.4060305@openvz.org> Date: Thu, 2 Jun 2016 21:34:08 +0300 MIME-Version: 1.0 In-Reply-To: <1464883095-6285-1-git-send-email-den@openvz.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/1] qcow2: avoid extra flushes in qcow2 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: Pavel Borzenkov , Kevin Wolf , Max Reitz On 06/02/2016 06:58 PM, Denis V. Lunev wrote: > The problem with excessive flushing was found by a couple of performance > tests: > - parallel directory tree creation (from 2 processes) > - 32 cached writes + fsync at the end in a loop > > For the first one results improved from 2.6 loops/sec to 3.5 loops/sec. > Each loop creates 10^3 directories with 10 files in each. > > For the second one results improved from ~600 fsync/sec to ~1100 > fsync/sec. Though, it was run on SSD so it probably won't show such > performance gain on rotational media. > > qcow2_cache_flush() calls bdrv_flush() unconditionally after writing > cache entries of a particular cache. This can lead to as many as > 2 additional fdatasyncs inside bdrv_flush. > > We can simply skip all fdatasync calls inside qcow2_co_flush_to_os > as bdrv_flush for sure will do the job. These flushes are necessary to > keep the right order of writes to the different caches. Though this is > not necessary in the current code base as this ordering is ensured through > the flush in qcow2_cache_flush_dependency(). > > Signed-off-by: Denis V. Lunev > CC: Pavel Borzenkov > CC: Kevin Wolf > CC: Max Reitz actually this is v2 version of the patchset, missed version number in the subject