From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: kvm userspace: ksm support Date: Wed, 29 Jul 2009 10:51:02 +0200 Message-ID: <4A700D76.50401@siemens.com> References: <20090728193959.49cc28b6@woof.woof> <4A6F2A38.30500@codemonkey.ws> <4A6F2C59.8020306@redhat.com> <4A6FA576.6020806@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Izik Eidus , kvm@vger.kernel.org, "Justin M. Forbes" , Mark McLoughlin To: Anthony Liguori Return-path: Received: from thoth.sbs.de ([192.35.17.2]:17154 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750912AbZG2Ivn (ORCPT ); Wed, 29 Jul 2009 04:51:43 -0400 In-Reply-To: <4A6FA576.6020806@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: Anthony Liguori wrote: > Izik Eidus wrote: >> >> You mean: when we later call for other madvise calls, if it will >> remove the MADV_MERGEABLE from that memory? >> if yes, the answer is no, it should be still l left in the >> vma->vm_flags... > > Excellent. > >>> >>> I'd suggest doing the following in osdep.h too: >>> >>> #if !defined(MADV_MERGABLE) >>> #define MADV_MERGABLE MADV_NORMAL >>> #endif >>> >>> To avoid #ifdefs in .c files. >> >> I tried to follow the way DONTFORK madvise is working... >> >> So you say, just to throw this thing into osdep.h instead of that c file? > > Yes. > > I think the DONTFORK thing is a bit odd. Of course we have > MADV_DONTFORK if we're running KVM. I'm not sure why that is there. > > I also think that we could get away with getting rid of any checks for > !sync_mmu() since that was introduced in 2.6.27. The problem is that your host kernel also must have CONFIG_MMU_NOTIFIER enabled - and that's not always the case. > > Otherwise, you should technically avoid doing madvise() unless we have > sync_mmu(). > > Regards, > > Anthony Liguori Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux