summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_page.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2004-04-24 20:53:55 +0000
committeralc <alc@FreeBSD.org>2004-04-24 20:53:55 +0000
commit106fdfcb2b41f5994fcce7d63193060ddf3fd6ec (patch)
treeb1edd1c09e5fbd01f822423350dbe7bf2ca92c4a /sys/vm/vm_page.c
parentabc6dc77728ccca216d89be00cb15898f75de565 (diff)
downloadFreeBSD-src-106fdfcb2b41f5994fcce7d63193060ddf3fd6ec.zip
FreeBSD-src-106fdfcb2b41f5994fcce7d63193060ddf3fd6ec.tar.gz
Push down the responsibility for zeroing a physical page from the
caller to vm_page_grab(). Although this gives VM_ALLOC_ZERO a different meaning for vm_page_grab() than for vm_page_alloc(), I feel such change is necessary to accomplish other goals. Specifically, I want to make the PG_ZERO flag immutable between the time it is allocated by vm_page_alloc() and freed by vm_page_free() or vm_page_free_zero() to avoid locking overheads. Once we gave up on the ability to automatically recognize a zeroed page upon entry to vm_page_free(), the ability to mutate the PG_ZERO flag became useless. Instead, I would like to say that "Once a page becomes valid, its PG_ZERO flag must be ignored."
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r--sys/vm/vm_page.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 789ad98..45e3fc9 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -1460,6 +1460,8 @@ retrylookup:
return NULL;
goto retrylookup;
}
+ if (allocflags & VM_ALLOC_ZERO && (m->flags & PG_ZERO) == 0)
+ pmap_zero_page(m);
return m;
}
OpenPOWER on IntegriCloud