summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2007-02-14 07:05:55 +0000
committeralc <alc@FreeBSD.org>2007-02-14 07:05:55 +0000
commit0250171bf668489d4871b8ba5ae64ffe2e38566b (patch)
treea71c6018929c413c1c36b928e1b67509824e746c /sys
parent93537b1ceadb4b9a19ca2156ea1dd4a4f461d94b (diff)
downloadFreeBSD-src-0250171bf668489d4871b8ba5ae64ffe2e38566b.zip
FreeBSD-src-0250171bf668489d4871b8ba5ae64ffe2e38566b.tar.gz
Avoid the unnecessary acquisition of the free page queues lock when a page
is actually being added to the hold queue, not the free queue. At the same time, avoid unnecessary tests to wake up threads waiting for free memory and the idle thread that zeroes free pages. (These tests will be performed later when the page finally moves from the hold queue to the free queue.)
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/vm_page.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index a73d76d..08c13e1 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -1146,11 +1146,12 @@ vm_page_free_toq(vm_page_t m)
}
if (m->hold_count != 0) {
m->flags &= ~PG_ZERO;
- VM_PAGE_SETQUEUE2(m, PQ_HOLD);
- } else
- VM_PAGE_SETQUEUE1(m, PQ_FREE);
- pq = &vm_page_queues[VM_PAGE_GETQUEUE(m)];
+ vm_pageq_enqueue(PQ_HOLD, m);
+ return;
+ }
+ VM_PAGE_SETQUEUE1(m, PQ_FREE);
mtx_lock(&vm_page_queue_free_mtx);
+ pq = &vm_page_queues[VM_PAGE_GETQUEUE(m)];
pq->lcnt++;
++(*pq->cnt);
OpenPOWER on IntegriCloud