Re: [PATCH -mm v8 5/7] mmu-notifier: add clear_young callback

2015-07-15 Thread Andres Lagar-Cavilla
= kvm_mmu_notifier_test_young, .change_pte = kvm_mmu_notifier_change_pte, .release= kvm_mmu_notifier_release, -- 2.1.4 -- Andres Lagar-Cavilla | Google Kernel Team | andre...@google.com -- To unsubscribe from this list: send the line unsubscribe kvm

Re: [PATCH v3] kvm: mmu: lazy collapse small sptes into large sptes

2015-04-14 Thread Andres Lagar-Cavilla
On Mon, Apr 13, 2015 at 10:25 PM, Wanpeng Li wanpeng...@linux.intel.com wrote: Hi Andres, On Fri, Apr 10, 2015 at 11:05:26AM -0700, Andres Lagar-Cavilla wrote: [...] + if (sp-role.direct + !kvm_is_reserved_pfn(pfn

Re: [PATCH 2/2] kvm: mmu: don't do overflow memslot check

2015-04-14 Thread Andres Lagar-Cavilla
) kvm_flush_remote_tlbs(kvm); -out: spin_unlock(kvm-mmu_lock); } -- 1.9.1 -- Andres Lagar-Cavilla | Google Kernel Team | andre...@google.com -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH v3] kvm: mmu: lazy collapse small sptes into large sptes

2015-04-13 Thread Andres Lagar-Cavilla
On Sun, Apr 12, 2015 at 6:45 PM, Xiao Guangrong guangrong.x...@linux.intel.com wrote: On 04/11/2015 02:05 AM, Andres Lagar-Cavilla wrote: On Fri, Apr 3, 2015 at 12:40 AM, Wanpeng Li wanpeng...@linux.intel.com wrote: There are two scenarios for the requirement of collapsing small sptes

Re: [PATCH 00/17] RFC: userfault v2

2014-10-30 Thread Andres Lagar-Cavilla
at http://vger.kernel.org/majordomo-info.html . -- Andres Lagar-Cavilla | Google Kernel Team | andre...@google.com -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo

Re: [PATCH 2/4] mm: gup: add get_user_pages_locked and get_user_pages_unlocked

2014-10-01 Thread Andres Lagar-Cavilla
Lagar-Cavilla andre...@google.com Otherwise, looks good! Peter -- Andres Lagar-Cavilla | Google Kernel Team | andre...@google.com -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: RFC: get_user_pages_locked|unlocked to leverage VM_FAULT_RETRY

2014-09-26 Thread Andres Lagar-Cavilla
On Fri, Sep 26, 2014 at 10:25 AM, Andrea Arcangeli aarca...@redhat.com wrote: On Thu, Sep 25, 2014 at 02:50:29PM -0700, Andres Lagar-Cavilla wrote: It's nearly impossible to name it right because 1) it indicates we can relinquish 2) it returns whether we still hold the mmap semaphore. I'd

Re: [PATCH v2] kvm: Faults which trigger IO release the mmap_sem

2014-09-25 Thread Andres Lagar-Cavilla
On Thu, Sep 25, 2014 at 2:16 PM, Andrea Arcangeli aarca...@redhat.com wrote: Hi Andres, On Wed, Sep 17, 2014 at 10:51:48AM -0700, Andres Lagar-Cavilla wrote: + if (!locked) { + VM_BUG_ON(npages != -EBUSY); + Shouldn't this be VM_BUG_ON(npages)? Oh shoot you're right. I

[PATCH] kvm: Fix kvm_get_page_retry_io __gup retval check

2014-09-25 Thread Andres Lagar-Cavilla
Confusion around -EBUSY and zero (inside a BUG_ON no less). Reported-by: AndreA Arcangeli aarca...@redhat.com Signed-off-by: Andres Lagar-Cavilla andre...@google.com --- virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm

Re: [PATCH v4] kvm: Fix page ageing bugs

2014-09-24 Thread Andres Lagar-Cavilla
would make sense if you included the accessed bit for each spte, instead of just the young variable. FWIW the new arrangement in kvm.git/queue LGTM Thanks Andres Paolo -- Andres Lagar-Cavilla | Google Kernel Team | andre...@google.com -- To unsubscribe from this list: send the line

Re: [PATCH v4] kvm: Fix page ageing bugs

2014-09-23 Thread Andres Lagar-Cavilla
On Tue, Sep 23, 2014 at 12:49 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 22/09/2014 23:54, Andres Lagar-Cavilla ha scritto: @@ -1406,32 +1406,24 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, struct rmap_iterator uninitialized_var(iter); int young = 0

[PATCH 1/2] kvm: Fix powerpc compile slippage.

2014-09-23 Thread Andres Lagar-Cavilla
After kvm: Fix page ageing bugs Signed-off-by: Andres Lagar-Cavilla andre...@google.com --- arch/powerpc/include/asm/kvm_ppc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h index fb86a22..d4a92d7

Re: [PATCH 1/2] kvm: Fix powerpc compile slippage.

2014-09-23 Thread Andres Lagar-Cavilla
On Tue, Sep 23, 2014 at 10:58 AM, Andres Lagar-Cavilla andre...@google.com wrote: After kvm: Fix page ageing bugs Signed-off-by: Andres Lagar-Cavilla andre...@google.com I can resend without the 1/2 (git n00b growing pains). Otherwise that should fix the kbuild error. Apologies

[PATCH] kvm/x86/mmu: Pass gfn and level to rmapp callback.

2014-09-23 Thread Andres Lagar-Cavilla
Callbacks don't have to do extra computation to learn what the caller (lvm_handle_hva_range()) knows very well. Useful for debugging/tracing/printk/future. Signed-off-by: Andres Lagar-Cavilla andre...@google.com --- arch/x86/kvm/mmu.c | 38 ++ include

[PATCH] kvm: Fix page ageing bugs

2014-09-22 Thread Andres Lagar-Cavilla
), we emulate the access bit by blowing the spte. This requires proper synchronizing with MMU notifier consumers, like every other removal of spte's does. Signed-off-by: Andres Lagar-Cavilla andre...@gooogle.com --- arch/arm/include/asm/kvm_host.h | 3 ++- arch/arm64/include/asm/kvm_host.h

[PATCH] kvm: Fix page ageing bugs

2014-09-22 Thread Andres Lagar-Cavilla
* Func prototypes fixed --- Signed-off-by: Andres Lagar-Cavilla andre...@gooogle.com --- arch/arm/include/asm/kvm_host.h | 3 ++- arch/arm64/include/asm/kvm_host.h | 3 ++- arch/powerpc/include/asm/kvm_host.h | 2 +- arch/powerpc/kvm/book3s.c | 4 ++-- arch/powerpc/kvm

[PATCH v2] kvm: Fix page ageing bugs

2014-09-22 Thread Andres Lagar-Cavilla
* Func prototypes fixed --- Signed-off-by: Andres Lagar-Cavilla andre...@gooogle.com --- arch/arm/include/asm/kvm_host.h | 3 ++- arch/arm64/include/asm/kvm_host.h | 3 ++- arch/powerpc/include/asm/kvm_host.h | 2 +- arch/powerpc/kvm/book3s.c | 4 ++-- arch/powerpc/kvm

[PATCH v3] kvm: Fix page ageing bugs

2014-09-22 Thread Andres Lagar-Cavilla
* Func prototypes fixed v2 - v3 * Added Acked-by * Fix compilation in PowerPC --- Signed-off-by: Andres Lagar-Cavilla andre...@gooogle.com Acked-by: Rik van Riel r...@redhat.com --- arch/arm/include/asm/kvm_host.h | 3 ++- arch/arm64/include/asm/kvm_host.h | 3 ++- arch

Re: [PATCH v2] kvm: Faults which trigger IO release the mmap_sem

2014-09-22 Thread Andres Lagar-Cavilla
On Thu, Sep 18, 2014 at 11:08 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 19/09/2014 05:58, Andres Lagar-Cavilla ha scritto: Paolo, should I recut including the recent Reviewed-by's? No, I'll add them myself. Paolo, is this patch waiting for something? Is Gleb's Reviewed-by enough

[PATCH v4] kvm: Fix page ageing bugs

2014-09-22 Thread Andres Lagar-Cavilla
* Func prototypes fixed v2 - v3 * Added Acked-by * Fix compilation in PowerPC v3 - v4 * Fix page shift direction in trace routine * Clarified comment in rmap.c --- Signed-off-by: Andres Lagar-Cavilla andre...@gooogle.com Acked-by: Rik van Riel r...@redhat.com --- arch

Re: [PATCH v3] kvm: Fix page ageing bugs

2014-09-22 Thread Andres Lagar-Cavilla
On Mon, Sep 22, 2014 at 2:48 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 22/09/2014 22:26, Andres Lagar-Cavilla ha scritto: + __entry-gfn= gfn; + __entry-hva= ((gfn - slot-base_gfn) This must be . Correct, thanks

Re: [PATCH v2] kvm: Faults which trigger IO release the mmap_sem

2014-09-18 Thread Andres Lagar-Cavilla
On Thu, Sep 18, 2014 at 5:32 PM, Wanpeng Li wanpeng...@linux.intel.com wrote: On Thu, Sep 18, 2014 at 09:13:26AM +0300, Gleb Natapov wrote: On Thu, Sep 18, 2014 at 08:29:17AM +0800, Wanpeng Li wrote: Hi Andres, On Wed, Sep 17, 2014 at 10:51:48AM -0700, Andres Lagar-Cavilla wrote

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-17 Thread Andres Lagar-Cavilla
On Wed, Sep 17, 2014 at 12:43 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 16/09/2014 20:42, Andres Lagar-Cavilla ha scritto: On Tue, Sep 16, 2014 at 11:29 AM, Paolo Bonzini pbonz...@redhat.com wrote: I think a first patch should introduce kvm_get_user_page_retry (Retry a fault

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-17 Thread Andres Lagar-Cavilla
definitely should, given that we are likely looking at swap/filemap. Andres -- Gleb. -- Andres Lagar-Cavilla | Google Kernel Team | andre...@google.com -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-17 Thread Andres Lagar-Cavilla
On Wed, Sep 17, 2014 at 10:08 AM, Gleb Natapov g...@kernel.org wrote: On Wed, Sep 17, 2014 at 10:00:32AM -0700, Andres Lagar-Cavilla wrote: On Wed, Sep 17, 2014 at 4:42 AM, Gleb Natapov g...@kernel.org wrote: On Wed, Sep 17, 2014 at 01:27:14PM +0200, Radim Krčmář wrote: 2014-09-17 13:26+0300

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-17 Thread Andres Lagar-Cavilla
On Wed, Sep 17, 2014 at 10:21 AM, Gleb Natapov g...@kernel.org wrote: On Wed, Sep 17, 2014 at 10:13:45AM -0700, Andres Lagar-Cavilla wrote: On Wed, Sep 17, 2014 at 10:08 AM, Gleb Natapov g...@kernel.org wrote: On Wed, Sep 17, 2014 at 10:00:32AM -0700, Andres Lagar-Cavilla wrote: On Wed, Sep

[PATCH v2] kvm: Faults which trigger IO release the mmap_sem

2014-09-17 Thread Andres Lagar-Cavilla
as a function of swap or filemap latency. This patch ensures both the regular and async PF path re-enter the fault allowing for the mmap semaphore to be relinquished in the case of IO wait. Reviewed-by: Radim Krčmář rkrc...@redhat.com Signed-off-by: Andres Lagar-Cavilla andre...@google.com --- v1 - v2

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-16 Thread Andres Lagar-Cavilla
On Tue, Sep 16, 2014 at 9:52 AM, Andres Lagar-Cavilla andre...@google.com wrote: Apologies to all. Resend as lists rejected my gmail-formatted version. Now on plain text. Won't happen again. On Tue, Sep 16, 2014 at 6:51 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 15/09/2014 22:11, Andres

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-16 Thread Andres Lagar-Cavilla
On Tue, Sep 16, 2014 at 11:29 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 16/09/2014 18:52, Andres Lagar-Cavilla ha scritto: Was this: down_read(mm-mmap_sem); npages = get_user_pages(NULL, mm, addr, 1, 1, 0, NULL, NULL); up_read(mm-mmap_sem); the intention

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-16 Thread Andres Lagar-Cavilla
On Tue, Sep 16, 2014 at 1:51 PM, Radim Krčmář rkrc...@redhat.com wrote: 2014-09-15 13:11-0700, Andres Lagar-Cavilla: +int kvm_get_user_page_retry(struct task_struct *tsk, struct mm_struct *mm, The suffix '_retry' is not best suited for this. On first reading, I imagined we will be retrying

Re: [PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-16 Thread Andres Lagar-Cavilla
On Tue, Sep 16, 2014 at 3:34 PM, Radim Krčmář rkrc...@redhat.com wrote: [Emergency posting to fix the tag and couldn't find unmangled Cc list, so some recipients were dropped, sorry. (I guess you are glad though).] 2014-09-16 14:01-0700, Andres Lagar-Cavilla: On Tue, Sep 16, 2014 at 1:51 PM

[PATCH] kvm: Faults which trigger IO release the mmap_sem

2014-09-15 Thread Andres Lagar-Cavilla
or filemap latency. This patch ensures both the regular and async PF path re-enter the fault allowing for the mmap semaphore to be relinquished in the case of IO wait. Signed-off-by: Andres Lagar-Cavilla andre...@google.com --- include/linux/kvm_host.h | 9 + include/linux/mm.h | 1