diff options
author | Alan Cox <alc@FreeBSD.org> | 2003-01-12 23:32:46 +0000 |
---|---|---|
committer | Alan Cox <alc@FreeBSD.org> | 2003-01-12 23:32:46 +0000 |
commit | a15700fe32805ba16b50232a70037238a04fbb86 (patch) | |
tree | bb9a83f5f6b4b04a835cb3a1f0f956a715003e55 /sys | |
parent | 277b215162db84384dce32c3e37f2872cf57976b (diff) | |
download | src-a15700fe32805ba16b50232a70037238a04fbb86.tar.gz src-a15700fe32805ba16b50232a70037238a04fbb86.zip |
Make vm_page_alloc() return PG_ZERO only if VM_ALLOC_ZERO is specified.
The objective being to eliminate some cases of page queues locking.
(See, for example, vm/vm_fault.c revision 1.160.)
Reviewed by: tegge
(Also, pointed out by tegge that I changed vm_fault.c before changing
vm_page.c. Oops.)
Notes
Notes:
svn path=/head/; revision=109151
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vm/vm_page.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index a96b8ac93270..56abce4bc166 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -755,7 +755,7 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req) { vm_page_t m = NULL; vm_pindex_t color; - int page_req, s; + int flags, page_req, s; page_req = req & VM_ALLOC_CLASS_MASK; @@ -844,12 +844,13 @@ loop: /* * Initialize structure. Only the PG_ZERO flag is inherited. */ + flags = PG_BUSY; if (m->flags & PG_ZERO) { vm_page_zero_count--; - m->flags = PG_ZERO | PG_BUSY; - } else { - m->flags = PG_BUSY; + if (req & VM_ALLOC_ZERO) + flags = PG_ZERO | PG_BUSY; } + m->flags = flags; if (req & VM_ALLOC_WIRED) { atomic_add_int(&cnt.v_wire_count, 1); m->wire_count = 1; |