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

2014-09-25 Thread Andrea Arcangeli
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)? Alternatively we could patch gup to do: case -EHWPOISON: +

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 was

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?

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

2014-09-22 Thread Paolo Bonzini
Il 22/09/2014 22:49, 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? It's waiting for an Acked-by on the mm/ changes. Paolo -- To unsubscribe

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

2014-09-22 Thread Andrew Morton
On Mon, 22 Sep 2014 23:32:36 +0200 Paolo Bonzini pbonz...@redhat.com wrote: Il 22/09/2014 22:49, 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

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

2014-09-19 Thread Paolo Bonzini
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 -- 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

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

2014-09-18 Thread Gleb Natapov
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: [...] static inline int check_user_page_hwpoison(unsigned long addr) { int rc, flags = FOLL_TOUCH | FOLL_HWPOISON | FOLL_WRITE; @@ -1177,9

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

2014-09-18 Thread Gleb Natapov
On Wed, Sep 17, 2014 at 10:51:48AM -0700, Andres Lagar-Cavilla wrote: When KVM handles a tdp fault it uses FOLL_NOWAIT. If the guest memory has been swapped out or is behind a filemap, this will trigger async readahead and return immediately. The rationale is that KVM will kick back the guest

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

2014-09-18 Thread Wanpeng Li
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: [...] static inline int check_user_page_hwpoison(unsigned long addr) { int rc,

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: [...]

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

2014-09-17 Thread Andres Lagar-Cavilla
When KVM handles a tdp fault it uses FOLL_NOWAIT. If the guest memory has been swapped out or is behind a filemap, this will trigger async readahead and return immediately. The rationale is that KVM will kick back the guest with an async page fault and allow for some other guest process to take

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

2014-09-17 Thread Wanpeng Li
Hi Andres, On Wed, Sep 17, 2014 at 10:51:48AM -0700, Andres Lagar-Cavilla wrote: [...] static inline int check_user_page_hwpoison(unsigned long addr) { int rc, flags = FOLL_TOUCH | FOLL_HWPOISON | FOLL_WRITE; @@ -1177,9 +1214,15 @@ static int hva_to_pfn_slow(unsigned long addr, bool