From 106fdfcb2b41f5994fcce7d63193060ddf3fd6ec Mon Sep 17 00:00:00 2001 From: alc Date: Sat, 24 Apr 2004 20:53:55 +0000 Subject: 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." --- sys/vm/vm_page.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/vm/vm_page.c') 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; } -- cgit v1.1