summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_page.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-04-25 06:35:05 +0000
committeralc <alc@FreeBSD.org>2003-04-25 06:35:05 +0000
commit93ce6848ad98869103b28348c0f50d0d0a3d4381 (patch)
treee44549f199655e9c514f0a7c5c67bb3fa29f404c /sys/vm/vm_page.c
parentb614456b1c7f3df9688c37cb125c5f4a5522a5ea (diff)
downloadFreeBSD-src-93ce6848ad98869103b28348c0f50d0d0a3d4381.zip
FreeBSD-src-93ce6848ad98869103b28348c0f50d0d0a3d4381.tar.gz
- Relax the Giant required in vm_page_remove().
- Remove the Giant required from vm_page_free_toq(). (Any locking errors will be caught by vm_page_remove().) This remedies a panic that occurred when kmem_malloc(NOWAIT) performed without Giant failed to allocate the necessary pages. Reported by: phk
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r--sys/vm/vm_page.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index d5b8a5c..8abde96 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -599,11 +599,11 @@ vm_page_remove(vm_page_t m)
vm_object_t object;
vm_page_t root;
- GIANT_REQUIRED;
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
if (m->object == NULL)
return;
-
+ if (!VM_OBJECT_LOCKED(m->object))
+ GIANT_REQUIRED;
if ((m->flags & PG_BUSY) == 0) {
panic("vm_page_remove: page not busy");
}
@@ -1030,7 +1030,6 @@ vm_page_free_toq(vm_page_t m)
struct vpgqueues *pq;
vm_object_t object = m->object;
- GIANT_REQUIRED;
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
s = splvm();
cnt.v_tfree++;
OpenPOWER on IntegriCloud