From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: kvm userspace: ksm support Date: Tue, 28 Jul 2009 20:27:18 -0500 Message-ID: <4A6FA576.6020806@codemonkey.ws> References: <20090728193959.49cc28b6@woof.woof> <4A6F2A38.30500@codemonkey.ws> <4A6F2C59.8020306@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, "Justin M. Forbes" , Mark McLoughlin To: Izik Eidus Return-path: Received: from mail-yx0-f190.google.com ([209.85.210.190]:53942 "EHLO mail-yx0-f190.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752593AbZG2B1W (ORCPT ); Tue, 28 Jul 2009 21:27:22 -0400 Received: by yxe28 with SMTP id 28so762636yxe.33 for ; Tue, 28 Jul 2009 18:27:21 -0700 (PDT) In-Reply-To: <4A6F2C59.8020306@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. Otherwise, you should technically avoid doing madvise() unless we have sync_mmu(). Regards, Anthony Liguori