From mboxrd@z Thu Jan 1 00:00:00 1970 From: Emmanuel Noobadmin Subject: Re: Re: Questions about duplicate memory work Date: Mon, 26 Sep 2011 16:15:37 +0800 Message-ID: References: <20110925044511.GI30419@stodi.digitalkingdom.org> <20110926071803.GE18099@stodi.digitalkingdom.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: kvm@vger.kernel.org To: Robin Lee Powell Return-path: Received: from mail-gx0-f174.google.com ([209.85.161.174]:46643 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750975Ab1IZIPi (ORCPT ); Mon, 26 Sep 2011 04:15:38 -0400 Received: by gxk6 with SMTP id 6so4092417gxk.19 for ; Mon, 26 Sep 2011 01:15:38 -0700 (PDT) In-Reply-To: <20110926071803.GE18099@stodi.digitalkingdom.org> Sender: kvm-owner@vger.kernel.org List-ID: On 9/26/11, Robin Lee Powell wrote: > On Mon, Sep 26, 2011 at 01:49:18PM +0800, Emmanuel Noobadmin wrote: >> On 9/25/11, Robin Lee Powell wrote: >> > >> > OK, so I've got a Linux host, and a bunch of Linux VMs. >> > >> > This means that the host *and* all tho VMs do their own disk >> > caches/buffers and do their own swap as well. >> >> If I'm not wrong, that's why the recommended and current default >> in libvirtd is to create storage devices with no caching to remove >> one layer of duplication. > > How do you do that? I have my VMs using LVs created on the host as > their disks, but I'm open to other methods if there are significant > advantages. It's unrelated to what you're actually using as the disks, whether file or block devices like LVs. I think it just makes KVM tell the host not to cache I/O done on the storage device. To do so just use the option cache=none when specify the storage. e.g. from http://www.linux-kvm.org/page/Tuning_KVM qemu -drive file=/dev/mapper/ImagesVolumeGroup-Guest1,cache=none,if=virtio or edit the cache attribute in the libvirt domain XML file if you're using that.