summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_phys.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2009-06-17 04:57:32 +0000
committeralc <alc@FreeBSD.org>2009-06-17 04:57:32 +0000
commitcb610fa25db7ab8b783a9efb6332ebbd3715fc0b (patch)
treed4456f2d3985c91f2ad8478d6d2353bb7b7f2bdf /sys/vm/vm_phys.c
parent66eb71f1a7022ae056b509763e4655a8f0d4711d (diff)
downloadFreeBSD-src-cb610fa25db7ab8b783a9efb6332ebbd3715fc0b.zip
FreeBSD-src-cb610fa25db7ab8b783a9efb6332ebbd3715fc0b.tar.gz
Make the maintenance of a page's valid bits by contigmalloc() more like
kmem_alloc() and kmem_malloc(). Specifically, defer the setting of the page's valid bits until contigmapping() when the mapping is known to be successful.
Diffstat (limited to 'sys/vm/vm_phys.c')
-rw-r--r--sys/vm/vm_phys.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c
index 3af40cf..9c140a5 100644
--- a/sys/vm/vm_phys.c
+++ b/sys/vm/vm_phys.c
@@ -691,14 +691,16 @@ done:
("vm_phys_alloc_contig: page %p has unexpected queue %d",
m, m->queue));
m_object = m->object;
- if ((m->flags & PG_CACHED) != 0)
+ if ((m->flags & PG_CACHED) != 0) {
+ m->valid = 0;
vm_page_cache_remove(m);
- else {
+ } else {
KASSERT(VM_PAGE_IS_FREE(m),
("vm_phys_alloc_contig: page %p is not free", m));
+ KASSERT(m->valid == 0,
+ ("vm_phys_alloc_contig: free page %p is valid", m));
cnt.v_free_count--;
}
- m->valid = VM_PAGE_BITS_ALL;
if (m->flags & PG_ZERO)
vm_page_zero_count--;
/* Don't clear the PG_ZERO flag; we'll need it later. */
OpenPOWER on IntegriCloud