From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=57856 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvYPL-0005tQ-KL for qemu-devel@nongnu.org; Tue, 14 Sep 2010 12:31:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OvYPH-0003EQ-8u for qemu-devel@nongnu.org; Tue, 14 Sep 2010 12:30:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42913) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OvYPH-0003EK-1Q for qemu-devel@nongnu.org; Tue, 14 Sep 2010 12:30:55 -0400 Message-ID: <4C8FA339.7080000@redhat.com> Date: Tue, 14 Sep 2010 18:30:49 +0200 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] qcow2 performance plan References: <4C8F7394.8060802@redhat.com> <4C8F93E4.80008@codemonkey.ws> In-Reply-To: <4C8F93E4.80008@codemonkey.ws> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Kevin Wolf , qemu-devel On 09/14/2010 05:25 PM, Anthony Liguori wrote: > > The incremental version of this is hard for me to understand. > bdrv_read() may be implemented in terms of bdrv_aio_read() + > qemu_io_wait() which dispatches bottom halves. This is done through a > shared resource so if you allow bdrv_read() to be called in parallel, > there's a very real possibility that you'll get corruption of a shared > resource. > > You'd have to first instrument bdrv_read() to be re-entrant by > acquiring bs.mutex() in every bdrv_read() caller. You would then need > to modify the file protocol so that it could safely be called in > parallel. > > IOW, you've got to make the whole block layer thread safe before you > can begin to make qcow2 thread safe. > It does rely on CONFIG_IO_THREAD and qemu_mutex. However, we don't need to make the whole block layer safe, just the syncronous parts (drop qemu_mutex after I/O is issued, rely on the image's mutex for internal synchronization). -- error compiling committee.c: too many arguments to function