From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH, RFC] virtio_blk: add cache flush command Date: Mon, 11 May 2009 09:51:40 -0500 Message-ID: <4A083B7C.1000703@codemonkey.ws> References: <20090511083908.GB20082@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Rusty Russell , kvm@vger.kernel.org To: Christoph Hellwig Return-path: Received: from an-out-0708.google.com ([209.85.132.250]:40551 "EHLO an-out-0708.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753174AbZEKOvm (ORCPT ); Mon, 11 May 2009 10:51:42 -0400 Received: by an-out-0708.google.com with SMTP id d40so10057403and.1 for ; Mon, 11 May 2009 07:51:42 -0700 (PDT) In-Reply-To: <20090511083908.GB20082@lst.de> Sender: kvm-owner@vger.kernel.org List-ID: Christoph Hellwig wrote: > Currently virtio-blk does support barriers for ordering requests which > is enough to guarantee filesystem metadata integrity with write back > caches, but it does not support any way to flush that writeback cache, > to guarantee that data is stable on disk on a fsync. > > This patch implements a new VIRTIO_BLK_T_FLUSH command to flush the > cache and exposes the functionality to the block layer by implementing > a prepare_flush method. > What typically triggers a flush operation? I would assume an fsync would, but would a flush happen after every O_DIRECT write? If the backend implementation of T_FLUSH is fsync, I would think that this would result in rather poor performance for O_DIRECT operations in the guest. Regards, Anthony Liguori