From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jyrx1-0007bZ-6j for qemu-devel@nongnu.org; Wed, 21 May 2008 13:18:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jyrwy-0007aK-2X for qemu-devel@nongnu.org; Wed, 21 May 2008 13:18:04 -0400 Received: from [199.232.76.173] (port=55169 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jyrwx-0007aC-Fy for qemu-devel@nongnu.org; Wed, 21 May 2008 13:18:03 -0400 Received: from bzq-179-150-194.static.bezeqint.net ([212.179.150.194]:55541 helo=il.qumranet.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jyrwx-0007KU-8t for qemu-devel@nongnu.org; Wed, 21 May 2008 13:18:03 -0400 Message-ID: <48345949.4050903@qumranet.com> Date: Wed, 21 May 2008 20:18:01 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH][v2] Align file accesses with cache=off (O_DIRECT) References: <48341783.3060204@qumranet.com> <20080521134154.GA15210@shareable.org> <483429EB.7070705@codemonkey.ws> <48342F05.2090603@qumranet.com> <48343106.4070801@codemonkey.ws> <48343844.1050107@qumranet.com> <20080521153454.GB20527@shareable.org> <48344793.2020902@codemonkey.ws> <20080521162406.GA21501@shareable.org> <48345258.9040004@qumranet.com> <20080521170129.GF22488@duo.random> In-Reply-To: <20080521170129.GF22488@duo.random> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrea Arcangeli Cc: Blue Swirl , Laurent Vivier , qemu-devel@nongnu.org, Paul Brook Andrea Arcangeli wrote: > On Wed, May 21, 2008 at 07:48:24PM +0300, Avi Kivity wrote: > >> Hmm, if remap_file_pages() supports MAP_PRIVATE, that solves all the >> problems neatly. >> >> Andrea, do you know if that combination works? >> > > No, it only supports MAP_SHARED. Why would anyone want MAP_PRIVATE for > real I/O operations? MAP_PRIVATE is primarily for binaries and things > that are readonly on disk and that we may want to update (like for > dynamic linking w/o hardlinking). > > Or is that for -snapshot support, to keep the modifications in > anonymous ram? > > I imagine you want remap_file_pages for zerocopy I/O without using > O_DIRECT. If you use O_DIRECT you don't need mmap. However O_DIRECT > work best with kernel asyncio for small seeking blocks so all I/O can > be submitted at the same time. writev also works better than write for > O_DIRECT. > Yes, that's the reason. Here zerocopy is not the motivation; instead, we have host-cached pages that are used directly in the guest. So we get both reduced memory footprint, and host caching. O_DIRECT reduces the memory footprint but kills host caching. The scenario is desktop/laptop use. For server use O_DIRECT is clearly preferred due to much reduced overhead. -- error compiling committee.c: too many arguments to function