summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2003-06-17 23:22:35 +0000
committerjake <jake@FreeBSD.org>2003-06-17 23:22:35 +0000
commitd54ed51ea92e745fb49138453ff3331e9304b943 (patch)
treeeb984cc778b5733d439db07051fd5c772bb71305 /sys/sparc64
parent2b56b8c4099fe06da7846f0db164b131bd854337 (diff)
downloadFreeBSD-src-d54ed51ea92e745fb49138453ff3331e9304b943.zip
FreeBSD-src-d54ed51ea92e745fb49138453ff3331e9304b943.tar.gz
Handle recursion on the vm_page_queue_mtx manually in pmap_qenter and
pmap_qremove, in order to avoid making the mutex recursable. Discussed with: alc
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/sparc64/pmap.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c
index 28e33fc..d8b813e 100644
--- a/sys/sparc64/sparc64/pmap.c
+++ b/sys/sparc64/sparc64/pmap.c
@@ -899,16 +899,19 @@ void
pmap_qenter(vm_offset_t sva, vm_page_t *m, int count)
{
vm_offset_t va;
+ int locked;
PMAP_STATS_INC(pmap_nqenter);
va = sva;
- vm_page_lock_queues();
+ if (!(locked = mtx_owned(&vm_page_queue_mtx)))
+ vm_page_lock_queues();
while (count-- > 0) {
pmap_kenter(va, *m);
va += PAGE_SIZE;
m++;
}
- vm_page_unlock_queues();
+ if (!locked)
+ vm_page_unlock_queues();
tlb_range_demap(kernel_pmap, sva, va);
}
@@ -920,15 +923,18 @@ void
pmap_qremove(vm_offset_t sva, int count)
{
vm_offset_t va;
+ int locked;
PMAP_STATS_INC(pmap_nqremove);
va = sva;
- vm_page_lock_queues();
+ if (!(locked = mtx_owned(&vm_page_queue_mtx)))
+ vm_page_lock_queues();
while (count-- > 0) {
pmap_kremove(va);
va += PAGE_SIZE;
}
- vm_page_unlock_queues();
+ if (!locked)
+ vm_page_unlock_queues();
tlb_range_demap(kernel_pmap, sva, va);
}
OpenPOWER on IntegriCloud