Author: jeff
Date: Wed Mar  7 22:04:27 2018
New Revision: 330624
URL: https://svnweb.freebsd.org/changeset/base/330624

Log:
  Don't assert that the domain free lock is held until we're certain that
  there is a valid reservation.  This can trip erroneously when memory
  falls within a domain but doesn't have the reservation initialized because
  it does not meet size or alignment requirements.
  
  Reported by:  pho, mjg
  Sponsored by: Netflix, Dell/EMC Isilon

Modified:
  head/sys/vm/vm_reserv.c

Modified: head/sys/vm/vm_reserv.c
==============================================================================
--- head/sys/vm/vm_reserv.c     Wed Mar  7 20:50:28 2018        (r330623)
+++ head/sys/vm/vm_reserv.c     Wed Mar  7 22:04:27 2018        (r330624)
@@ -1044,9 +1044,9 @@ vm_reserv_free_page(vm_page_t m)
        vm_reserv_t rv;
 
        rv = vm_reserv_from_page(m);
-       vm_domain_free_assert_locked(VM_DOMAIN(rv->domain));
        if (rv->object == NULL)
                return (FALSE);
+       vm_domain_free_assert_locked(VM_DOMAIN(rv->domain));
        vm_reserv_depopulate(rv, m - rv->pages);
        return (TRUE);
 }
@@ -1093,9 +1093,9 @@ vm_reserv_is_page_free(vm_page_t m)
        vm_reserv_t rv;
 
        rv = vm_reserv_from_page(m);
-       vm_domain_free_assert_locked(VM_DOMAIN(rv->domain));
        if (rv->object == NULL)
                return (false);
+       vm_domain_free_assert_locked(VM_DOMAIN(rv->domain));
        return (popmap_is_clear(rv->popmap, m - rv->pages));
 }
 
_______________________________________________
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