diff options
author | alc <alc@FreeBSD.org> | 2007-02-25 06:14:58 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2007-02-25 06:14:58 +0000 |
commit | 573a964db6deb3f61961bfe0f4586caa6b8cbb9e (patch) | |
tree | 8f61202f24e3670c10df7262f4f001d14fbb32df /sys/vm/vm_page.c | |
parent | 7b83533659e4ccdf5e867d26a2d738717e00f2cc (diff) | |
download | FreeBSD-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_page.c')
-rw-r--r-- | sys/vm/vm_page.c | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 3badc5b..e97eca9 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -938,6 +938,8 @@ loop: if (req & VM_ALLOC_ZERO) flags = PG_ZERO; } + if (object != NULL && object->type == OBJT_PHYS) + flags |= PG_UNMANAGED; m->flags = flags; if (req & (VM_ALLOC_NOBUSY | VM_ALLOC_NOOBJ)) m->oflags = 0; @@ -1169,36 +1171,6 @@ vm_page_free_toq(vm_page_t m) } /* - * vm_page_unmanage: - * - * Prevent PV management from being done on the page. The page is - * removed from the paging queues as if it were wired, and as a - * consequence of no longer being managed the pageout daemon will not - * touch it (since there is no way to locate the pte mappings for the - * page). madvise() calls that mess with the pmap will also no longer - * operate on the page. - * - * Beyond that the page is still reasonably 'normal'. Freeing the page - * will clear the flag. - * - * This routine is used by OBJT_PHYS objects - objects using unswappable - * physical memory as backing store rather then swap-backed memory and - * will eventually be extended to support 4MB unmanaged physical - * mappings. - */ -void -vm_page_unmanage(vm_page_t m) -{ - - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - if ((m->flags & PG_UNMANAGED) == 0) { - if (m->wire_count == 0) - vm_pageq_remove(m); - } - vm_page_flag_set(m, PG_UNMANAGED); -} - -/* * vm_page_wire: * * Mark this page as wired down by yet |