Author: markj
Date: Thu Nov 29 16:31:01 2018
New Revision: 341247
URL: https://svnweb.freebsd.org/changeset/base/341247

Log:
  Update the free page count when blacklisting pages.
  
  Otherwise the free page count will not accurately reflect the physical
  page allocator's state.  On 11 this can trigger panics in
  vm_page_alloc() since the allocator state and free page count are
  updated atomically and we expect them to stay in sync.  On 12 the
  bug would manifest as threads looping in vm_page_alloc().
  
  PR:           231296
  Reported by:  mav, wollman, Rainer Duffner, Josh Gitlin
  Reviewed by:  alc, kib, mav
  MFC after:    3 days
  Sponsored by: The FreeBSD Foundation
  Differential Revision:        https://reviews.freebsd.org/D18374

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c       Thu Nov 29 16:13:46 2018        (r341246)
+++ head/sys/vm/vm_page.c       Thu Nov 29 16:31:01 2018        (r341247)
@@ -355,7 +355,8 @@ vm_page_blacklist_add(vm_paddr_t pa, bool verbose)
        vm_domain_free_lock(vmd);
        ret = vm_phys_unfree_page(m);
        vm_domain_free_unlock(vmd);
-       if (ret) {
+       if (ret != 0) {
+               vm_domain_freecnt_inc(vmd, -1);
                TAILQ_INSERT_TAIL(&blacklist_head, m, listq);
                if (verbose)
                        printf("Skipping page with pa 0x%jx\n", (uintmax_t)pa);
_______________________________________________
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