From 82627e96a026e438a7251b0e5dc0a5322435693c Mon Sep 17 00:00:00 2001 From: dillon Date: Mon, 29 May 2000 22:40:54 +0000 Subject: This is a cleanup patch to Peter's new OBJT_PHYS VM object type and sysv shared memory support for it. It implements a new PG_UNMANAGED flag that has slightly different characteristics from PG_FICTICIOUS. A new sysctl, kern.ipc.shm_use_phys has been added to enable the use of physically-backed sysv shared memory rather then swap-backed. Physically backed shm segments are not tracked with PV entries, allowing programs which use a large shm segment as a rendezvous point to operate without eating an insane amount of KVM in the PV entry management. Read: Oracle. Peter's OBJT_PHYS object will also allow us to eventually implement page-table sharing and/or 4MB physical page support for such segments. We're half way there. --- sys/vm/phys_pager.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'sys/vm/phys_pager.c') diff --git a/sys/vm/phys_pager.c b/sys/vm/phys_pager.c index a48126c..586844f 100644 --- a/sys/vm/phys_pager.c +++ b/sys/vm/phys_pager.c @@ -104,7 +104,9 @@ phys_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, object = vm_object_allocate(OBJT_PHYS, OFF_TO_IDX(foff + size)); object->handle = handle; +#if 0 TAILQ_INIT(&object->un_pager.physp.physp_pglist); +#endif TAILQ_INSERT_TAIL(&phys_pager_object_list, object, pager_object_list); } else { @@ -131,20 +133,6 @@ phys_pager_dealloc(object) int s; TAILQ_REMOVE(&phys_pager_object_list, object, pager_object_list); - /* - * Free up our fake pages. - */ - s = splvm(); - while ((m = TAILQ_FIRST(&object->un_pager.physp.physp_pglist)) != 0) { - TAILQ_REMOVE(&object->un_pager.physp.physp_pglist, m, pageq); - /* return the page back to normal */ - m->flags &= ~PG_FICTITIOUS; - m->dirty = 0; - vm_page_unwire(m, 0); - vm_page_flag_clear(m, PG_ZERO); - vm_page_free(m); - } - splx(s); } static int @@ -165,8 +153,7 @@ phys_pager_getpages(object, m, count, reqpage) vm_page_zero_fill(m[i]); vm_page_flag_set(m[i], PG_ZERO); /* Switch off pv_entries */ - vm_page_wire(m[i]); - vm_page_flag_set(m[i], PG_FICTITIOUS); + vm_page_unmanage(m[i]); m[i]->valid = VM_PAGE_BITS_ALL; m[i]->dirty = 0; /* The requested page must remain busy, the others not. */ @@ -174,8 +161,6 @@ phys_pager_getpages(object, m, count, reqpage) vm_page_flag_clear(m[i], PG_BUSY); m[i]->busy = 0; } - TAILQ_INSERT_TAIL(&object->un_pager.physp.physp_pglist, m[i], - pageq); } splx(s); -- cgit v1.1