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/dev/agp/agp.c | 2 -- sys/dev/agp/agp_i810.c | 2 -- 2 files changed, 4 deletions(-) (limited to 'sys/dev/agp') diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c index fc4fd1f..f507aa6 100644 --- a/sys/dev/agp/agp.c +++ b/sys/dev/agp/agp.c @@ -524,8 +524,6 @@ agp_generic_bind_memory(device_t dev, struct agp_memory *mem, m = vm_page_grab(mem->am_obj, OFF_TO_IDX(i), VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY); VM_OBJECT_UNLOCK(mem->am_obj); - if ((m->flags & PG_ZERO) == 0) - pmap_zero_page(m); AGP_DPF("found page pa=%#x\n", VM_PAGE_TO_PHYS(m)); /* diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c index 9210247..30aca50 100644 --- a/sys/dev/agp/agp_i810.c +++ b/sys/dev/agp/agp_i810.c @@ -612,8 +612,6 @@ agp_i810_alloc_memory(device_t dev, int type, vm_size_t size) m = vm_page_grab(mem->am_obj, 0, VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY); VM_OBJECT_UNLOCK(mem->am_obj); - if ((m->flags & PG_ZERO) == 0) - pmap_zero_page(m); vm_page_lock_queues(); mem->am_physical = VM_PAGE_TO_PHYS(m); vm_page_wakeup(m); -- cgit v1.1