From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753445AbdC0PSV (ORCPT ); Mon, 27 Mar 2017 11:18:21 -0400 Received: from foss.arm.com ([217.140.101.70]:36556 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752536AbdC0PSS (ORCPT ); Mon, 27 Mar 2017 11:18:18 -0400 Subject: Re: [PATCH] kvm: arm/arm64: Rework gpa callback handlers To: Christoffer Dall References: <1490034402-28850-1-git-send-email-suzuki.poulose@arm.com> <20170324180002.GJ25903@cbox> Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, christoffer.dall@linaro.org, marc.zyngier@arm.com, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org From: Suzuki K Poulose Message-ID: Date: Mon, 27 Mar 2017 16:18:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170324180002.GJ25903@cbox> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/03/17 18:00, Christoffer Dall wrote: > On Mon, Mar 20, 2017 at 06:26:42PM +0000, Suzuki K Poulose wrote: >> In order to perform an operation on a gpa range, the hyp iterates > > the hyp ? To be precise "the host" ? > >> over each page in a user memory slot for the given range. This is >> inefficient while dealing with a big range (e.g, a VMA), especially >> while unmaping a range. At present, with stage2 unmap on a range with >> a hugepage backed region, we clear the PMD when we unmap the first >> page in the loop. The remaining iterations simply traverse the page table >> down to the PMD level only to see that nothing is in there. >> >> This patch reworks the code to invoke the callback handlers on the >> biggest range possible within the memory slot to avoid reduce the >> number of iterations. > > avoid reduce? > > did you mean "to reduce the number of times the handler is called" ? Yep, thanks for spotting. > >> >> Cc: Marc Zyngier >> Cc: Christoffer Dall >> Signed-off-by: Suzuki K Poulose >> --- >> arch/arm/kvm/mmu.c | 31 +++++++++++++------------------ >> 1 file changed, 13 insertions(+), 18 deletions(-) >> >> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c >> index 37e67f5..8357fed 100644 >> --- a/arch/arm/kvm/mmu.c >> +++ b/arch/arm/kvm/mmu.c ... >> > > Otherwise looks good: > > I can fix up the commit message when applying this. > > Reviewed-by: Christoffer Dall Thanks Suzuki From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suzuki K Poulose Subject: Re: [PATCH] kvm: arm/arm64: Rework gpa callback handlers Date: Mon, 27 Mar 2017 16:18:14 +0100 Message-ID: References: <1490034402-28850-1-git-send-email-suzuki.poulose@arm.com> <20170324180002.GJ25903@cbox> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, marc.zyngier@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu To: Christoffer Dall Return-path: In-Reply-To: <20170324180002.GJ25903@cbox> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu List-Id: kvm.vger.kernel.org On 24/03/17 18:00, Christoffer Dall wrote: > On Mon, Mar 20, 2017 at 06:26:42PM +0000, Suzuki K Poulose wrote: >> In order to perform an operation on a gpa range, the hyp iterates > > the hyp ? To be precise "the host" ? > >> over each page in a user memory slot for the given range. This is >> inefficient while dealing with a big range (e.g, a VMA), especially >> while unmaping a range. At present, with stage2 unmap on a range with >> a hugepage backed region, we clear the PMD when we unmap the first >> page in the loop. The remaining iterations simply traverse the page table >> down to the PMD level only to see that nothing is in there. >> >> This patch reworks the code to invoke the callback handlers on the >> biggest range possible within the memory slot to avoid reduce the >> number of iterations. > > avoid reduce? > > did you mean "to reduce the number of times the handler is called" ? Yep, thanks for spotting. > >> >> Cc: Marc Zyngier >> Cc: Christoffer Dall >> Signed-off-by: Suzuki K Poulose >> --- >> arch/arm/kvm/mmu.c | 31 +++++++++++++------------------ >> 1 file changed, 13 insertions(+), 18 deletions(-) >> >> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c >> index 37e67f5..8357fed 100644 >> --- a/arch/arm/kvm/mmu.c >> +++ b/arch/arm/kvm/mmu.c ... >> > > Otherwise looks good: > > I can fix up the commit message when applying this. > > Reviewed-by: Christoffer Dall Thanks Suzuki From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suzuki.Poulose@arm.com (Suzuki K Poulose) Date: Mon, 27 Mar 2017 16:18:14 +0100 Subject: [PATCH] kvm: arm/arm64: Rework gpa callback handlers In-Reply-To: <20170324180002.GJ25903@cbox> References: <1490034402-28850-1-git-send-email-suzuki.poulose@arm.com> <20170324180002.GJ25903@cbox> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 24/03/17 18:00, Christoffer Dall wrote: > On Mon, Mar 20, 2017 at 06:26:42PM +0000, Suzuki K Poulose wrote: >> In order to perform an operation on a gpa range, the hyp iterates > > the hyp ? To be precise "the host" ? > >> over each page in a user memory slot for the given range. This is >> inefficient while dealing with a big range (e.g, a VMA), especially >> while unmaping a range. At present, with stage2 unmap on a range with >> a hugepage backed region, we clear the PMD when we unmap the first >> page in the loop. The remaining iterations simply traverse the page table >> down to the PMD level only to see that nothing is in there. >> >> This patch reworks the code to invoke the callback handlers on the >> biggest range possible within the memory slot to avoid reduce the >> number of iterations. > > avoid reduce? > > did you mean "to reduce the number of times the handler is called" ? Yep, thanks for spotting. > >> >> Cc: Marc Zyngier >> Cc: Christoffer Dall >> Signed-off-by: Suzuki K Poulose >> --- >> arch/arm/kvm/mmu.c | 31 +++++++++++++------------------ >> 1 file changed, 13 insertions(+), 18 deletions(-) >> >> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c >> index 37e67f5..8357fed 100644 >> --- a/arch/arm/kvm/mmu.c >> +++ b/arch/arm/kvm/mmu.c ... >> > > Otherwise looks good: > > I can fix up the commit message when applying this. > > Reviewed-by: Christoffer Dall Thanks Suzuki