From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45542) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsWaf-00067c-9Z for qemu-devel@nongnu.org; Tue, 08 Jan 2013 05:39:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsWaa-0004gw-WA for qemu-devel@nongnu.org; Tue, 08 Jan 2013 05:39:29 -0500 Received: from mail-da0-f41.google.com ([209.85.210.41]:47243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsWaa-0004gm-PB for qemu-devel@nongnu.org; Tue, 08 Jan 2013 05:39:24 -0500 Received: by mail-da0-f41.google.com with SMTP id e20so134858dak.28 for ; Tue, 08 Jan 2013 02:39:23 -0800 (PST) Message-ID: <50EBF755.3050607@gmail.com> Date: Tue, 08 Jan 2013 18:39:17 +0800 From: Liu Yuan MIME-Version: 1.0 References: <1355941771-3418-1-git-send-email-namei.unix@gmail.com> <87k3s6shdv.wl%morita.kazutaka@lab.ntt.co.jp> <50D967C3.7020109@gmail.com> <50E58B19.2050701@gmail.com> <20130104163830.GF6310@stefanha-thinkpad.hitronhub.home> <50E7AEC4.5080309@gmail.com> <50E7BA41.3020307@gmail.com> <50E7DC9B.4080309@gmail.com> <50EACC61.2020603@redhat.com> <50EBB1CB.9030608@gmail.com> <20130108094025.GE2557@stefanha-thinkpad.redhat.com> <50EBEAD2.6070608@gmail.com> <50EBEE42.7010407@redhat.com> In-Reply-To: <50EBEE42.7010407@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] sheepdog: implement direct write semantics List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, MORITA Kazutaka , Paolo Bonzini On 01/08/2013 06:00 PM, Kevin Wolf wrote: > Am 08.01.2013 10:45, schrieb Liu Yuan: >> On 01/08/2013 05:40 PM, Stefan Hajnoczi wrote: >>> Otherwise use sheepdog writeback and let QEMU block.c decide when to >>> flush. Never use sheepdog writethrough because it's redundant here. >> >> I don't get it. What do you mean by 'redundant'? If we use virtio & >> sheepdog block driver, how can we specify writethrough mode for Sheepdog >> cache? Here 'writethrough' means use a pure read cache, which doesn't >> need flush at all. > > A writethrough cache is equivalent to a write-back cache where each > write is followed by a flush. qemu makes sure to send these flushes, so > there is no need use Sheepdog's writethrough mode. > Implement writethrough as writeback + flush will cause considerable overhead for network block device like Sheepdog: a single write request will be executed as two requests: write + flush. This also explains why I saw a regression about write performance: Old QEMU can issue multiple write requests in one go, but now the requests are sent one by one (even with cache=writeback set), which makes Sheepdog write performance drop a lot. Is it possible to issue multiple requests in one go as old QEMU does? It seems it is hard to restore into old semantics of cache flags due to new design of QEMU block layer. So will you accept that adding a 'flags' into BlockDriverState which carry the 'cache flags' from user to keep backward compatibility? Thanks, Yuan