Author: markj
Date: Thu Feb 13 23:18:35 2020
New Revision: 357893
URL: https://svnweb.freebsd.org/changeset/base/357893

Log:
  Fix handling of WAITFAIL in vm_page_grab() and vm_page_grab_pages().
  
  After sleeping through a memory shortage, we must return NULL rather
  than retry.
  
  Discussed with:       jeff
  Reported by:  pho
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c       Thu Feb 13 23:15:21 2020        (r357892)
+++ head/sys/vm/vm_page.c       Thu Feb 13 23:18:35 2020        (r357893)
@@ -4258,7 +4258,7 @@ retrylookup:
                return (NULL);
        m = vm_page_alloc(object, pindex, pflags);
        if (m == NULL) {
-               if ((allocflags & VM_ALLOC_NOWAIT) != 0)
+               if ((allocflags & (VM_ALLOC_NOWAIT | VM_ALLOC_WAITFAIL)) != 0)
                        return (NULL);
                goto retrylookup;
        }
@@ -4466,7 +4466,8 @@ retrylookup:
                        m = vm_page_alloc_after(object, pindex + i,
                            pflags | VM_ALLOC_COUNT(count - i), mpred);
                        if (m == NULL) {
-                               if ((allocflags & VM_ALLOC_NOWAIT) != 0)
+                               if ((allocflags & (VM_ALLOC_NOWAIT |
+                                   VM_ALLOC_WAITFAIL)) != 0)
                                        break;
                                goto retrylookup;
                        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to