1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-29 16:44:03 +00:00

Plug a leak in the newer contigmalloc() implementation. Specifically, if

a multipage allocation was aborted midway, the pages that were already
allocated were not always returned to the free list.

Submitted by: tegge
This commit is contained in:
Alan Cox 2006-01-26 05:51:26 +00:00
parent aed1a1f179
commit cfc26cd69c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154849

View File

@ -473,19 +473,14 @@ vm_page_alloc_contig(vm_pindex_t npages, vm_paddr_t low, vm_paddr_t high,
}
}
if (pqtype == PQ_CACHE) {
if (m->hold_count != 0) {
start = i - npages + 1;
goto retry;
}
if (m->hold_count != 0)
goto cleanup_freed;
object = m->object;
if (!VM_OBJECT_TRYLOCK(object)) {
start = i - npages + 1;
goto retry;
}
if (!VM_OBJECT_TRYLOCK(object))
goto cleanup_freed;
if ((m->flags & PG_BUSY) || m->busy != 0) {
VM_OBJECT_UNLOCK(object);
start = i - npages + 1;
goto retry;
goto cleanup_freed;
}
vm_page_free(m);
VM_OBJECT_UNLOCK(object);