From: Christian =?utf-8?q?Borntr=C3=A4ger?= Subject: Re: [PATCH v2] Driver for Inter-VM shared memory device for KVM supporting interrupts. Date: Wed, 20 May 2009 11:07:00 +0200 Message-ID: <200905201107.00930.borntraeger@de.ibm.com> References: <1241713567-17256-1-git-send-email-cam@cs.ualberta.ca> <200905200933.01736.borntraeger@de.ibm.com> <4A13C33E.3090705@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Rusty Russell , Cam Macdonell , kvm@vger.kernel.org, Christian Ehrhardt , Anthony Liguori To: Avi Kivity Return-path: Received: from mtagate4.de.ibm.com ([195.212.29.153]:37051 "EHLO mtagate4.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753760AbZETJHC convert rfc822-to-8bit (ORCPT ); Wed, 20 May 2009 05:07:02 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.14.3/8.13.8) with ESMTP id n4K972H5068382 for ; Wed, 20 May 2009 09:07:02 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4K972qN3055626 for ; Wed, 20 May 2009 11:07:02 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n4K971dR014881 for ; Wed, 20 May 2009 11:07:02 +0200 In-Reply-To: <4A13C33E.3090705@redhat.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Am Mittwoch 20 Mai 2009 10:45:50 schrieb Avi Kivity: > Christian Borntr=C3=A4ger wrote: > > o shared guest kernels: The CMS operating system is build as a boot= able > > DCSS (called named-saved-segments NSS). All guests have the same ho= st > > pages for the read-only parts of the CMS kernel. The local data is = stored > > in exclusive-write parts of the same NSS. Linux on System z is also > > capable of using this feature (CONFIG_SHARED_KERNEL). The kernel li= nkage > > is changed in a way to separate the read-only text segment from the= other > > parts with segment size alignment > > How does patching (smp, kprobes/jprobes, markers/ftrace) work with th= is? It does not. :-)=20 Because of that and since most distro kernels are fully modular and ker= nel=20 updates are another problem this feature is not used very often for Lin= ux. It=20 is used heavily in CMS, though. Actually, we could do COW in the host but then it is really not worth t= he=20 effort. > > o execute-in-place: This is a Linux feature to exploit the DCSS > > technology. The goal is to shared identical guest pages without the > > additional overhead of KSM etc. We have a block device driver for D= CSS. > > This block device driver supports the direct_access function and > > therefore allows to use the xip option of ext2. The idea is to put=20 > > binaries into an read-only ext2 filesystem. Whenever an mmap is mad= e on > > this file system, the page is not mapped into the page cache. The p= tes > > point into the DCSS memory instead. Since the DCSS is demand-paged = by the > > host no memory is wasted for unused parts of the binaries. In case = of COW > > the page is copied as usual. It turned out that installations with = many > > similar guests (lets say 400 guests) will profit in terms of memory > > saving and quicker application startups (not the first guest of cou= rse). > > There is a downside: this requires a skilled administrator to setup= =2E > > ksm might be easier to admin, at the cost of some cpu time. Yes, KSM is easier and it even finds duplicate data pages. On the other hand it does only provide memory saving. It does not speed= up=20 application startup like execute-in-place (major page faults become min= or page=20 faults for text pages if the page is already backed by the host) I am not claiming that KSM is useless. Depending on the scenario you mi= ght=20 want the one or the other or even both. For typical desktop use, KSM is= very=20 likely the better approach.