diff options
author | alc <alc@FreeBSD.org> | 2006-01-26 05:51:26 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2006-01-26 05:51:26 +0000 |
commit | e32ac719d6a89a007d0165aae080e437ddef75da (patch) | |
tree | dc099b5d5ce14e94250a09bcf898033e6b4f4837 | |
parent | e30fec287937151666b822fdbfaa9c93d5ac5f01 (diff) | |
download | FreeBSD-src-e32ac719d6a89a007d0165aae080e437ddef75da.zip FreeBSD-src-e32ac719d6a89a007d0165aae080e437ddef75da.tar.gz |
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
-rw-r--r-- | sys/vm/vm_contig.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c index ad98cf9..6208774 100644 --- a/sys/vm/vm_contig.c +++ b/sys/vm/vm_contig.c @@ -473,19 +473,14 @@ cleanup_freed: } } 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); |