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
This commit is contained in:
Attilio Rao 2013-08-15 11:01:25 +00:00
parent 2c7cd47838
commit a834cbaec8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=254362

View file

@ -1611,6 +1611,10 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req)
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 @@ vm_page_alloc_contig(vm_object_t object, vm_pindex_t pindex, int req,
&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);