Author: attilio
Date: Thu Aug 15 11:01:25 2013
New Revision: 254362
URL: http://svnweb.freebsd.org/changeset/base/254362

Log:
  On the recovery path for vm_page_alloc(), if a page had been requested
  wired, unwind back the wiring bits otherwise we can end up freeing a
  page that is considered wired.
  
  Sponsored by: EMC / Isilon storage division
  Reported by:  alc

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c       Thu Aug 15 10:38:10 2013        (r254361)
+++ head/sys/vm/vm_page.c       Thu Aug 15 11:01:25 2013        (r254362)
@@ -1611,6 +1611,10 @@ vm_page_alloc(vm_object_t object, vm_pin
                        if (vp != NULL)
                                vdrop(vp);
                        pagedaemon_wakeup();
+                       if (req & VM_ALLOC_WIRED) {
+                               atomic_subtract_int(&cnt.v_wire_count, 1);
+                               m->wire_count = 0;
+                       }
                        m->object = NULL;
                        vm_page_free(m);
                        return (NULL);
@@ -1806,8 +1810,13 @@ retry:
                                    &deferred_vdrop_list);
                                if (vm_paging_needed())
                                        pagedaemon_wakeup();
+                               if ((req & VM_ALLOC_WIRED) != 0)
+                                       atomic_subtract_int(&cnt.v_wire_count,
+                                           npages);
                                for (m_tmp = m, m = m_ret;
                                    m < &m_ret[npages]; m++) {
+                                       if ((req & VM_ALLOC_WIRED) != 0)
+                                               m->wire_count = 0;
                                        if (m >= m_tmp)
                                                m->object = NULL;
                                        vm_page_free(m);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to