All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch added to -mm tree
@ 2019-01-09 19:11 akpm
  0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2019-01-09 19:11 UTC (permalink / raw)
  To: mm-commits, stable, rppt, peterx, mike.kravetz, dgilbert, aarcange


The patch titled
     Subject: mm/hugetlb.c: teach follow_hugetlb_page() to handle FOLL_NOWAIT
has been added to the -mm tree.  Its filename is
     mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Andrea Arcangeli <aarcange@redhat.com>
Subject: mm/hugetlb.c: teach follow_hugetlb_page() to handle FOLL_NOWAIT

hugetlb needs the same fix as faultin_nopage (which was applied in
96312e61282ae ("mm/gup.c: teach get_user_pages_unlocked to handle
FOLL_NOWAIT")) or KVM hangs because it thinks the mmap_sem was already
released by hugetlb_fault() if it returned VM_FAULT_RETRY, but it wasn't
in the FOLL_NOWAIT case.

Link: http://lkml.kernel.org/r/20190109020203.26669-2-aarcange@redhat.com
Fixes: ce53053ce378 ("kvm: switch get_user_page_nowait() to get_user_pages_unlocked()")
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Tested-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/hugetlb.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/mm/hugetlb.c~mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait
+++ a/mm/hugetlb.c
@@ -4268,7 +4268,8 @@ long follow_hugetlb_page(struct mm_struc
 				break;
 			}
 			if (ret & VM_FAULT_RETRY) {
-				if (nonblocking)
+				if (nonblocking &&
+				    !(fault_flags & FAULT_FLAG_RETRY_NOWAIT))
 					*nonblocking = 0;
 				*nr_pages = 0;
 				/*
_

Patches currently in -mm which might be from aarcange@redhat.com are

mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch


^ permalink raw reply	[flat|nested] 2+ messages in thread

* + mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch added to -mm tree
@ 2019-01-09 19:11 akpm
  0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2019-01-09 19:11 UTC (permalink / raw)
  To: mm-commits, stable, rppt, peterx, mike.kravetz, dgilbert, aarcange


The patch titled
     Subject: mm/hugetlb.c: teach follow_hugetlb_page() to handle FOLL_NOWAIT
has been added to the -mm tree.  Its filename is
     mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Andrea Arcangeli <aarcange@redhat.com>
Subject: mm/hugetlb.c: teach follow_hugetlb_page() to handle FOLL_NOWAIT

hugetlb needs the same fix as faultin_nopage (which was applied in
96312e61282ae ("mm/gup.c: teach get_user_pages_unlocked to handle
FOLL_NOWAIT")) or KVM hangs because it thinks the mmap_sem was already
released by hugetlb_fault() if it returned VM_FAULT_RETRY, but it wasn't
in the FOLL_NOWAIT case.

Link: http://lkml.kernel.org/r/20190109020203.26669-2-aarcange@redhat.com
Fixes: ce53053ce378 ("kvm: switch get_user_page_nowait() to get_user_pages_unlocked()")
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Tested-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/hugetlb.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/mm/hugetlb.c~mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait
+++ a/mm/hugetlb.c
@@ -4268,7 +4268,8 @@ long follow_hugetlb_page(struct mm_struc
 				break;
 			}
 			if (ret & VM_FAULT_RETRY) {
-				if (nonblocking)
+				if (nonblocking &&
+				    !(fault_flags & FAULT_FLAG_RETRY_NOWAIT))
 					*nonblocking = 0;
 				*nr_pages = 0;
 				/*
_

Patches currently in -mm which might be from aarcange@redhat.com are

mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-09 19:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09 19:11 + mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch added to -mm tree akpm
2019-01-09 19:11 akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.