summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2010-05-03 16:55:50 +0000
committeralc <alc@FreeBSD.org>2010-05-03 16:55:50 +0000
commit77a3b0ef9e6b06d4ee34650022fbf4cf4af410c9 (patch)
tree31b452854f2fbe0020b796224be71948da6d10ba /sys/dev
parent1923b6ded3da335e5752c75a0ad1b1219e63521b (diff)
downloadFreeBSD-src-77a3b0ef9e6b06d4ee34650022fbf4cf4af410c9.zip
FreeBSD-src-77a3b0ef9e6b06d4ee34650022fbf4cf4af410c9.tar.gz
Acquire the page lock around vm_page_unwire(). For consistency, extend the
scope of the object lock in agp_i810.c. (In this specific case, the scope of the object lock shouldn't matter, but I don't want to create a bad example that might be copied to a case where it did matter.) Reviewed by: kib
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/agp/agp.c4
-rw-r--r--sys/dev/agp/agp_i810.c4
-rw-r--r--sys/dev/drm/via_dmablit.c2
3 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c
index c992c93..89b68b0 100644
--- a/sys/dev/agp/agp.c
+++ b/sys/dev/agp/agp.c
@@ -623,9 +623,11 @@ bad:
m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(k));
if (k >= i)
vm_page_wakeup(m);
+ vm_page_lock(m);
vm_page_lock_queues();
vm_page_unwire(m, 0);
vm_page_unlock_queues();
+ vm_page_unlock(m);
}
VM_OBJECT_UNLOCK(mem->am_obj);
@@ -657,9 +659,11 @@ agp_generic_unbind_memory(device_t dev, struct agp_memory *mem)
VM_OBJECT_LOCK(mem->am_obj);
for (i = 0; i < mem->am_size; i += PAGE_SIZE) {
m = vm_page_lookup(mem->am_obj, atop(i));
+ vm_page_lock(m);
vm_page_lock_queues();
vm_page_unwire(m, 0);
vm_page_unlock_queues();
+ vm_page_unlock(m);
}
VM_OBJECT_UNLOCK(mem->am_obj);
diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c
index 95a9cc4..44eb50d 100644
--- a/sys/dev/agp/agp_i810.c
+++ b/sys/dev/agp/agp_i810.c
@@ -1010,10 +1010,12 @@ agp_i810_free_memory(device_t dev, struct agp_memory *mem)
VM_OBJECT_LOCK(mem->am_obj);
m = vm_page_lookup(mem->am_obj, 0);
- VM_OBJECT_UNLOCK(mem->am_obj);
+ vm_page_lock(m);
vm_page_lock_queues();
vm_page_unwire(m, 0);
vm_page_unlock_queues();
+ vm_page_unlock(m);
+ VM_OBJECT_UNLOCK(mem->am_obj);
} else {
contigfree(sc->argb_cursor, mem->am_size, M_AGP);
sc->argb_cursor = NULL;
diff --git a/sys/dev/drm/via_dmablit.c b/sys/dev/drm/via_dmablit.c
index 3a66b26..72d914e 100644
--- a/sys/dev/drm/via_dmablit.c
+++ b/sys/dev/drm/via_dmablit.c
@@ -178,9 +178,11 @@ via_free_sg_info(drm_via_sg_info_t *vsg)
case dr_via_pages_locked:
for (i=0; i < vsg->num_pages; ++i) {
if ( NULL != (page = vsg->pages[i])) {
+ vm_page_lock(page);
vm_page_lock_queues();
vm_page_unwire(page, 0);
vm_page_unlock_queues();
+ vm_page_unlock(page);
}
}
case dr_via_pages_alloc:
OpenPOWER on IntegriCloud