From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MiVuB-0002fg-50 for qemu-devel@nongnu.org; Tue, 01 Sep 2009 12:08:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MiVu6-0002ac-BG for qemu-devel@nongnu.org; Tue, 01 Sep 2009 12:08:22 -0400 Received: from [199.232.76.173] (port=38523 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MiVu6-0002aL-2Y for qemu-devel@nongnu.org; Tue, 01 Sep 2009 12:08:18 -0400 Received: from mail-px0-f179.google.com ([209.85.216.179]:62771) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MiVu5-0002pz-KE for qemu-devel@nongnu.org; Tue, 01 Sep 2009 12:08:17 -0400 Received: by pxi9 with SMTP id 9so100537pxi.14 for ; Tue, 01 Sep 2009 09:08:15 -0700 (PDT) Message-ID: <4A9D46EA.8090606@codemonkey.ws> Date: Tue, 01 Sep 2009 11:08:10 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 0/3] block: Handle multiple write requests at once References: <1251813112-17408-1-git-send-email-kwolf@redhat.com> <20090901155228.GA21781@lst.de> In-Reply-To: <20090901155228.GA21781@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: Kevin Wolf , qemu-devel@nongnu.org Christoph Hellwig wrote: > On Tue, Sep 01, 2009 at 03:51:49PM +0200, Kevin Wolf wrote: > >> virtio often issues multiple requests in a row, but each one independently. If >> the block drivers knew all of the requests, they could optimize the way they >> handle the requests. See the description of patch 3 for how qcow2 can use this >> to avoid unnecessary writes to the disk. >> > > I think this interface is extremly awkward and the layering is wrong. > Everyone benefits from having one large instead of multiple small > requests, so if we do get multiple sequential write requests we should > always merged it at a high level even before starting to issue AIO, > e.g. do it all in virtio-blk. > Or introduce a helper layer that coalesces requests that lives outside of the core block API. I don't like the interface either although I'm not sure if the alternative is better. A different way to do this would be to have a queuing API. A device would queue requests and then kick the queue. This is closer to how virtio-blk works. Regards, Anthony Liguori