From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBjkD-0007A7-Fl for qemu-devel@nongnu.org; Wed, 12 Sep 2012 06:00:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBjk3-0003Jl-6S for qemu-devel@nongnu.org; Wed, 12 Sep 2012 06:00:29 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:57539) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBjk2-0003H2-Vn for qemu-devel@nongnu.org; Wed, 12 Sep 2012 06:00:19 -0400 Received: by pbbrp12 with SMTP id rp12so2178859pbb.4 for ; Wed, 12 Sep 2012 03:00:17 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <50505D29.7020003@redhat.com> Date: Wed, 12 Sep 2012 12:00:09 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] qemu-nbd very slow, patch available List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tristan Wibberley Cc: qemu-devel@nongnu.org Il 12/09/2012 10:25, Tristan Wibberley ha scritto: > The attached diff adds a commandline option "--cache=" with four modes > and makes no change to the default behaviour of qemu-nbd: > > --cache=writethrough [default, O_DSYNC, very slow, very resilient] > --cache=off [same as --nocache, O_DIRECT, slow, resilient] > --cache=none [O_DIRECT, O_DSYNC, very very slow, very very resilient] > --cache=writeback [fast, not resilient] A very similar patch is in QEMU 1.2.0, just released last week. :) --cache=writethrough [default, O_DSYNC] --cache=none [same as --nocache, O_DIRECT] --cache=directsync [O_DIRECT, O_DSYNC] --cache=writeback > I have not included Stephane's extra fsync operation on close because > that would make --cache=writeback very slow on disconnect. Users can > sync after disconnect via alternatives available on their platform. An fsync is already done by bdrv_close; however, this only syncs just before qemu-nbd exits, not after each and every disconnect. I think it's a good compromise. The best solution would be to add support for fsync in the NBD kernel driver, so that --cache=writeback would be just as good. Paolo