From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758563Ab1FVXmQ (ORCPT ); Wed, 22 Jun 2011 19:42:16 -0400 Received: from mail-vw0-f46.google.com ([209.85.212.46]:41831 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758222Ab1FVXmN convert rfc822-to-8bit (ORCPT ); Wed, 22 Jun 2011 19:42:13 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=E1KUzzgpwzXmzx8JO3sVJub8CEfA4uTY513ZGhgTZNH9psH7+ho5mPiDUGFzMER9Hh CoFG7PZm1JCPuXy7ROFqnhKvTJJD1P+GYOZ9HGxB0MtNmkRmj955CeVFcgbMR2WkNYcF TImzx+11M6R71Ss43c9A5L9FIztJPQrxricyY= MIME-Version: 1.0 In-Reply-To: <20110622150350.GX20843@redhat.com> References: <201106212055.25400.nai.xia@gmail.com> <201106212132.39311.nai.xia@gmail.com> <20110622150350.GX20843@redhat.com> Date: Thu, 23 Jun 2011 07:42:11 +0800 Message-ID: Subject: Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking From: Nai Xia To: Andrea Arcangeli Cc: Andrew Morton , Izik Eidus , Hugh Dickins , Chris Wright , Rik van Riel , linux-mm , Johannes Weiner , linux-kernel , kvm Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 22, 2011 at 11:03 PM, Andrea Arcangeli wrote: > On Tue, Jun 21, 2011 at 09:32:39PM +0800, Nai Xia wrote: >> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >> index d48ec60..b407a69 100644 >> --- a/arch/x86/kvm/vmx.c >> +++ b/arch/x86/kvm/vmx.c >> @@ -4674,6 +4674,7 @@ static int __init vmx_init(void) >>               kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull, >>                               VMX_EPT_EXECUTABLE_MASK); >>               kvm_enable_tdp(); >> +             kvm_dirty_update = 0; >>       } else >>               kvm_disable_tdp(); >> > > Why not return !shadow_dirty_mask instead of adding a new var? > >>  struct mmu_notifier_ops { >> +     int (*dirty_update)(struct mmu_notifier *mn, >> +                          struct mm_struct *mm); >> + > > Needs some docu. OK. I'll add it. > > I think dirty_update isn't self explanatory name. I think > "has_test_and_clear_dirty" would be better. Agreed. So it will be the name in the next version. :) Thanks, Nai > > If we don't flush the smp tlb don't we risk that we'll insert pages in > the unstable tree that are volatile just because the dirty bit didn't > get set again on the spte? > > The first patch I guess it's a sign of hugetlbfs going a little over > the edge in trying to mix with the core VM... Passing that parameter > &need_pte_unmap all over the place not so nice, maybe it'd be possible > to fix within hugetlbfs to use a different method to walk the hugetlb > vmas. I'd prefer that if possible. > > Thanks, > Andrea > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nai Xia Subject: Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking Date: Thu, 23 Jun 2011 07:42:11 +0800 Message-ID: References: <201106212055.25400.nai.xia@gmail.com> <201106212132.39311.nai.xia@gmail.com> <20110622150350.GX20843@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Andrew Morton , Izik Eidus , Hugh Dickins , Chris Wright , Rik van Riel , linux-mm , Johannes Weiner , linux-kernel , kvm To: Andrea Arcangeli Return-path: In-Reply-To: <20110622150350.GX20843@redhat.com> Sender: owner-linux-mm@kvack.org List-Id: kvm.vger.kernel.org On Wed, Jun 22, 2011 at 11:03 PM, Andrea Arcangeli wr= ote: > On Tue, Jun 21, 2011 at 09:32:39PM +0800, Nai Xia wrote: >> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >> index d48ec60..b407a69 100644 >> --- a/arch/x86/kvm/vmx.c >> +++ b/arch/x86/kvm/vmx.c >> @@ -4674,6 +4674,7 @@ static int __init vmx_init(void) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull= , >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 VMX_EPT_EXEC= UTABLE_MASK); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 kvm_enable_tdp(); >> + =A0 =A0 =A0 =A0 =A0 =A0 kvm_dirty_update =3D 0; >> =A0 =A0 =A0 } else >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 kvm_disable_tdp(); >> > > Why not return !shadow_dirty_mask instead of adding a new var? > >> =A0struct mmu_notifier_ops { >> + =A0 =A0 int (*dirty_update)(struct mmu_notifier *mn, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct mm_struct *m= m); >> + > > Needs some docu. OK. I'll add it. > > I think dirty_update isn't self explanatory name. I think > "has_test_and_clear_dirty" would be better. Agreed. So it will be the name in the next version. :) Thanks, Nai > > If we don't flush the smp tlb don't we risk that we'll insert pages in > the unstable tree that are volatile just because the dirty bit didn't > get set again on the spte? > > The first patch I guess it's a sign of hugetlbfs going a little over > the edge in trying to mix with the core VM... Passing that parameter > &need_pte_unmap all over the place not so nice, maybe it'd be possible > to fix within hugetlbfs to use a different method to walk the hugetlb > vmas. I'd prefer that if possible. > > Thanks, > Andrea > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org