From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Bareiro Subject: Re: KSM with Debian GNU/Linux Date: Thu, 12 Aug 2010 22:05:34 -0300 Message-ID: <20100813010534.GA24332@defiant.freesoftware> References: <20100809101635.GB1771@defiant.freesoftware> <4C5FD800.9000905@msgid.tls.msk.ru> <20100809142732.GC1771@defiant.freesoftware> <4C601E97.3080102@msgid.tls.msk.ru> Reply-To: dbareiro@gmx.net Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nFreZHaLTZJo0R7j" To: KVM General Return-path: Received: from mailout-de.gmx.net ([213.165.64.22]:43602 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1760562Ab0HMBFl (ORCPT ); Thu, 12 Aug 2010 21:05:41 -0400 Received: from defiant (defiant.freesoftware [10.1.0.65]) by hermes.freesoftware (Postfix) with ESMTP id 7C84D1EB for ; Thu, 12 Aug 2010 22:02:53 -0300 (ART) Content-Disposition: inline In-Reply-To: <4C601E97.3080102@msgid.tls.msk.ru> Sender: kvm-owner@vger.kernel.org List-ID: --nFreZHaLTZJo0R7j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, Michael. On Monday, 09 August 2010 19:28:23 +0400, Michael Tokarev wrote: >> I'm also using qemu-kvm 0.12.1.2 compiled by myself with the source >> code of SourceForge. > Note that this one has numerous bugs, some of which involves data > corruption. JFYI. Thanks for the observation. >> These are the checks that I was doing in the VMHost: >> >> # ll /sys/kernel/mm/ksm/ >> total 0 >> -r--r--r-- 1 root root 4096 ago 9 06:28 full_scans >> -rw-r--r-- 1 root root 4096 ago 9 06:28 max_kernel_pages >> -r--r--r-- 1 root root 4096 ago 9 06:28 pages_shared >> -r--r--r-- 1 root root 4096 ago 9 06:28 pages_sharing >> -rw-r--r-- 1 root root 4096 ago 9 06:28 pages_to_scan >> -r--r--r-- 1 root root 4096 ago 9 06:28 pages_unshared >> -r--r--r-- 1 root root 4096 ago 9 06:28 pages_volatile >> -rw-r--r-- 1 root root 4096 ago 9 06:27 run >> -rw-r--r-- 1 root root 4096 ago 9 06:28 sleep_millisecs >> >> >> # cat /sys/kernel/mm/ksm/max_kernel_pages >> 253500 >> >> But KSM seems not work: >> >> # cat /sys/kernel/mm/ksm/pages_sharing >> 0 > Did you actually enable it in the kernel? Did you read the ksm docs > shipped with the kernel? Yes, I forgot to mention that I had enabled it: # cat /sys/kernel/mm/ksm/run 1 >> Should I have some additional consideration when compiling qemu-kvm? > Please note what Nikola Ciprich said. If you don't have kernel headers > that defines MADV_MERGEABLE, you'll have to define it when compiling > kvm. > Note again that debian qemu-kvm package (you're asking about debian > after all) includes support for KSM. It also includes a small patch to > #define that symbol. Keeping the kernel I had compiled and installing the qemu-kvm package in Backports, now KSM is working: # cat /sys/kernel/mm/ksm/pages_sharing 181406 This indicates that this was a problem in compiling qemu-kvm since the kernel is still exactly the same. Now, according to what I was seeing, headers of my kernel defines MADV_MERGEABLE: # cat /usr/src/linux-2.6.32.3/debian/linux-headers-2.6.32.3-dgb/usr/src/lin= ux-headers-2.6.32.3-dgb/include/asm-generic/mman-common.h | grep MERGEABLE #define MADV_MERGEABLE 12 /* KSM may merge identical pages */ #define MADV_UNMERGEABLE 13 /* KSM may not merge identical page= s */ Would it be that perhaps in my compilation of qemu-kvm, ksm was not working because I would have to indicate the path /usr/src/linux-2.6.32.3/debian/...? Thanks for your reply. Regards, Daniel --=20 Fingerprint: BFB3 08D6 B4D1 31B2 72B9 29CE 6696 BF1B 14E6 1D37 Powered by Debian GNU/Linux Lenny - Linux user #188.598 --nFreZHaLTZJo0R7j Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkxkml4ACgkQZpa/GxTmHTc68gCfdMTzqEdmbFLr1S19jPJNTxs2 PxcAn1Qat1yn7I76zQiew9na3Zq+0fun =8R9J -----END PGP SIGNATURE----- --nFreZHaLTZJo0R7j--