From 4d65036b4f95e33c41beba3e28eaeebf4f003015 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 3 Jun 2010 18:34:34 +0000 Subject: [PATCH] Do not leak vm page lock in vm_contig_launder(), vm_pageout_page_lock() always returns with the page locked. Submitted by: alc Pointy hat to: kib --- sys/vm/vm_contig.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c index 4d896a349a0..025031ec3cc 100644 --- a/sys/vm/vm_contig.c +++ b/sys/vm/vm_contig.c @@ -168,8 +168,10 @@ vm_contig_launder(int queue) if ((m->flags & PG_MARKER) != 0) continue; - if (!vm_pageout_page_lock(m, &next)) + if (!vm_pageout_page_lock(m, &next)) { + vm_page_unlock(m); continue; + } KASSERT(VM_PAGE_INQUEUE2(m, queue), ("vm_contig_launder: page %p's queue is not %d", m, queue)); error = vm_contig_launder_page(m, &next);