summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_kern.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2007-02-25 06:14:58 +0000
committeralc <alc@FreeBSD.org>2007-02-25 06:14:58 +0000
commit573a964db6deb3f61961bfe0f4586caa6b8cbb9e (patch)
tree8f61202f24e3670c10df7262f4f001d14fbb32df /sys/vm/vm_kern.c
parent7b83533659e4ccdf5e867d26a2d738717e00f2cc (diff)
downloadFreeBSD-src-573a964db6deb3f61961bfe0f4586caa6b8cbb9e.zip
FreeBSD-src-573a964db6deb3f61961bfe0f4586caa6b8cbb9e.tar.gz
Change the way that unmanaged pages are created. Specifically,
immediately flag any page that is allocated to a OBJT_PHYS object as unmanaged in vm_page_alloc() rather than waiting for a later call to vm_page_unmanage(). This allows for the elimination of some uses of the page queues lock. Change the type of the kernel and kmem objects from OBJT_DEFAULT to OBJT_PHYS. This allows us to take advantage of the above change to simplify the allocation of unmanaged pages in kmem_alloc() and kmem_malloc(). Remove vm_page_unmanage(). It is no longer used.
Diffstat (limited to 'sys/vm/vm_kern.c')
-rw-r--r--sys/vm/vm_kern.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c
index 6a78bb9..b6a4738 100644
--- a/sys/vm/vm_kern.c
+++ b/sys/vm/vm_kern.c
@@ -175,9 +175,8 @@ kmem_alloc(map, size)
mem = vm_page_grab(kernel_object, OFF_TO_IDX(offset + i),
VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_RETRY);
mem->valid = VM_PAGE_BITS_ALL;
- vm_page_lock_queues();
- vm_page_unmanage(mem);
- vm_page_unlock_queues();
+ KASSERT((mem->flags & PG_UNMANAGED) != 0,
+ ("kmem_alloc: page %p is managed", mem));
}
VM_OBJECT_UNLOCK(kernel_object);
@@ -364,9 +363,8 @@ retry:
if (flags & M_ZERO && (m->flags & PG_ZERO) == 0)
pmap_zero_page(m);
m->valid = VM_PAGE_BITS_ALL;
- vm_page_lock_queues();
- vm_page_unmanage(m);
- vm_page_unlock_queues();
+ KASSERT((m->flags & PG_UNMANAGED) != 0,
+ ("kmem_malloc: page %p is managed", m));
}
VM_OBJECT_UNLOCK(kmem_object);
OpenPOWER on IntegriCloud