diff options
author | dfr <dfr@FreeBSD.org> | 1998-09-04 08:06:57 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1998-09-04 08:06:57 +0000 |
commit | e2df972eb1b251e9321868d79ea5c26d4b32b6e4 (patch) | |
tree | 011702a89ef99411c684cf6ed0c61fefe352afa6 /sys/vm | |
parent | 4b6b0ee13a6e4197844609d59260d369def5c4a2 (diff) | |
download | FreeBSD-src-e2df972eb1b251e9321868d79ea5c26d4b32b6e4.zip FreeBSD-src-e2df972eb1b251e9321868d79ea5c26d4b32b6e4.tar.gz |
Cosmetic changes to the PAGE_XXX macros to make them consistent with
the other objects in vm.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/swap_pager.c | 10 | ||||
-rw-r--r-- | sys/vm/vm_fault.c | 24 | ||||
-rw-r--r-- | sys/vm/vm_kern.c | 10 | ||||
-rw-r--r-- | sys/vm/vm_map.c | 14 | ||||
-rw-r--r-- | sys/vm/vm_mmap.c | 4 | ||||
-rw-r--r-- | sys/vm/vm_object.c | 50 | ||||
-rw-r--r-- | sys/vm/vm_page.c | 22 | ||||
-rw-r--r-- | sys/vm/vm_page.h | 68 | ||||
-rw-r--r-- | sys/vm/vm_pageout.c | 22 | ||||
-rw-r--r-- | sys/vm/vnode_pager.c | 10 |
10 files changed, 130 insertions, 104 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 5cdbef4..e193eca 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -39,7 +39,7 @@ * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ * * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94 - * $Id: swap_pager.c,v 1.99 1998/08/13 08:05:13 dfr Exp $ + * $Id: swap_pager.c,v 1.100 1998/08/24 08:39:37 dfr Exp $ */ /* @@ -1104,7 +1104,7 @@ swap_pager_getpages(object, m, count, reqpage) if (rv == VM_PAGER_OK) { for (i = 0; i < count; i++) { m[i]->dirty = 0; - PAGE_CLEAR_FLAG(m[i], PG_ZERO); + vm_page_flag_clear(m[i], PG_ZERO); if (i != reqpage) { /* * whether or not to leave the page @@ -1123,7 +1123,7 @@ swap_pager_getpages(object, m, count, reqpage) * is ok to use */ m[i]->valid = VM_PAGE_BITS_ALL; - PAGE_WAKEUP(m[i]); + vm_page_wakeup(m[i]); } } @@ -1587,7 +1587,7 @@ swap_pager_finish(spc) printf("swap_pager_finish: I/O error, clean of page %lx failed\n", (u_long) VM_PAGE_TO_PHYS(ma[i])); ma[i]->dirty = VM_PAGE_BITS_ALL; - PAGE_BWAKEUP(ma[i]); + vm_page_io_finish(ma[i]); } vm_object_pip_subtract(object, spc->spc_count); @@ -1658,7 +1658,7 @@ swap_pager_iodone(bp) /* * we wakeup any processes that are waiting on these pages. */ - PAGE_BWAKEUP(ma[i]); + vm_page_io_finish(ma[i]); } } diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 8233f11..898ba8c 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -66,7 +66,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_fault.c,v 1.86 1998/08/06 08:33:19 dfr Exp $ + * $Id: vm_fault.c,v 1.87 1998/08/24 08:39:37 dfr Exp $ */ /* @@ -117,7 +117,7 @@ struct faultstate { static void release_page(struct faultstate *fs) { - PAGE_WAKEUP(fs->m); + vm_page_wakeup(fs->m); vm_page_deactivate(fs->m); fs->m = NULL; } @@ -291,7 +291,7 @@ RetryFault:; if ((fs.m->flags & PG_BUSY) || (fs.m->busy && (fs.m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL)) { - PAGE_SET_FLAG(fs.m, PG_WANTED | PG_REFERENCED); + vm_page_flag_set(fs.m, PG_WANTED | PG_REFERENCED); cnt.v_intrans++; tsleep(fs.m, PSWP, "vmpfw", 0); } @@ -314,7 +314,7 @@ RetryFault:; goto RetryFault; } - PAGE_SET_FLAG(fs.m, PG_BUSY); + vm_page_busy(fs.m); if (((fs.m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL) && fs.m->object != kernel_object && fs.m->object != kmem_object) { goto readrest; @@ -607,7 +607,7 @@ readrest: vm_page_rename(fs.m, fs.first_object, fs.first_pindex); fs.first_m = fs.m; fs.first_m->dirty = VM_PAGE_BITS_ALL; - PAGE_SET_FLAG(fs.first_m, PG_BUSY); + vm_page_busy(fs.first_m); fs.m = NULL; cnt.v_cow_optim++; } else { @@ -705,7 +705,7 @@ readrest: */ if (prot & VM_PROT_WRITE) { - PAGE_SET_FLAG(fs.m, PG_WRITEABLE); + vm_page_flag_set(fs.m, PG_WRITEABLE); vm_object_set_flag(fs.m->object, OBJ_WRITEABLE|OBJ_MIGHTBEDIRTY); /* @@ -720,14 +720,14 @@ readrest: unlock_things(&fs); fs.m->valid = VM_PAGE_BITS_ALL; - PAGE_CLEAR_FLAG(fs.m, PG_ZERO); + vm_page_flag_clear(fs.m, PG_ZERO); pmap_enter(fs.map->pmap, vaddr, VM_PAGE_TO_PHYS(fs.m), prot, wired); if (((fault_flags & VM_FAULT_WIRE_MASK) == 0) && (wired == 0)) { pmap_prefault(fs.map->pmap, vaddr, fs.entry); } - PAGE_SET_FLAG(fs.m, PG_MAPPED|PG_REFERENCED); + vm_page_flag_set(fs.m, PG_MAPPED|PG_REFERENCED); if (fault_flags & VM_FAULT_HOLD) vm_page_hold(fs.m); @@ -756,7 +756,7 @@ readrest: * Unlock everything, and return */ - PAGE_WAKEUP(fs.m); + vm_page_wakeup(fs.m); vm_object_deallocate(fs.first_object); return (KERN_SUCCESS); @@ -967,16 +967,16 @@ vm_fault_copy_entry(dst_map, src_map, dst_entry, src_entry) * Enter it in the pmap... */ - PAGE_CLEAR_FLAG(dst_m, PG_ZERO); + vm_page_flag_clear(dst_m, PG_ZERO); pmap_enter(dst_map->pmap, vaddr, VM_PAGE_TO_PHYS(dst_m), prot, FALSE); - PAGE_SET_FLAG(dst_m, PG_WRITEABLE|PG_MAPPED); + vm_page_flag_set(dst_m, PG_WRITEABLE|PG_MAPPED); /* * Mark it no longer busy, and put it on the active list. */ vm_page_activate(dst_m); - PAGE_WAKEUP(dst_m); + vm_page_wakeup(dst_m); } } diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 6097257..ea7f45b 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_kern.c,v 1.48 1998/06/21 14:53:41 bde Exp $ + * $Id: vm_kern.c,v 1.49 1998/08/24 08:39:37 dfr Exp $ */ /* @@ -181,7 +181,7 @@ kmem_alloc(map, size) VM_ALLOC_ZERO | VM_ALLOC_RETRY); if ((mem->flags & PG_ZERO) == 0) vm_page_zero_fill(mem); - PAGE_CLEAR_FLAG(mem, (PG_BUSY | PG_ZERO)); + vm_page_flag_clear(mem, (PG_BUSY | PG_ZERO)); mem->valid = VM_PAGE_BITS_ALL; } @@ -332,7 +332,7 @@ retry: vm_map_unlock(map); return (0); } - PAGE_CLEAR_FLAG(m, PG_ZERO); + vm_page_flag_clear(m, PG_ZERO); m->valid = VM_PAGE_BITS_ALL; } @@ -358,10 +358,10 @@ retry: for (i = 0; i < size; i += PAGE_SIZE) { m = vm_page_lookup(kmem_object, OFF_TO_IDX(offset + i)); vm_page_wire(m); - PAGE_WAKEUP(m); + vm_page_wakeup(m); pmap_enter(kernel_pmap, addr + i, VM_PAGE_TO_PHYS(m), VM_PROT_ALL, 1); - PAGE_SET_FLAG(m, PG_MAPPED | PG_WRITEABLE | PG_REFERENCED); + vm_page_flag_set(m, PG_MAPPED | PG_WRITEABLE | PG_REFERENCED); } vm_map_unlock(map); diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 9205540..73c2d56 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_map.c,v 1.133 1998/08/06 08:33:19 dfr Exp $ + * $Id: vm_map.c,v 1.134 1998/08/24 08:39:37 dfr Exp $ */ /* @@ -1990,16 +1990,16 @@ vm_map_split(entry) if (m == NULL) continue; if (m->flags & PG_BUSY) { - PAGE_SET_FLAG(m, PG_WANTED); + vm_page_flag_set(m, PG_WANTED); tsleep(m, PVM, "spltwt", 0); goto retry; } - PAGE_SET_FLAG(m, PG_BUSY); + vm_page_busy(m); vm_page_protect(m, VM_PROT_NONE); vm_page_rename(m, new_object, idx); m->dirty = VM_PAGE_BITS_ALL; - PAGE_SET_FLAG(m, PG_BUSY); + vm_page_busy(m); } if (orig_object->type == OBJT_SWAP) { @@ -2018,7 +2018,7 @@ vm_map_split(entry) for (idx = 0; idx < size; idx++) { m = vm_page_lookup(new_object, idx); if (m) { - PAGE_WAKEUP(m); + vm_page_wakeup(m); } } @@ -2808,9 +2808,9 @@ m_inretry: vm_page_activate(m_out); - PAGE_WAKEUP(m_in); + vm_page_wakeup(m_in); } - PAGE_WAKEUP(m_out); + vm_page_wakeup(m_out); } object->shadow_count--; diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index b33fac6..3e488d1 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -38,7 +38,7 @@ * from: Utah $Hdr: vm_mmap.c 1.6 91/10/21$ * * @(#)vm_mmap.c 8.4 (Berkeley) 1/12/94 - * $Id: vm_mmap.c,v 1.81 1998/07/15 02:32:35 bde Exp $ + * $Id: vm_mmap.c,v 1.82 1998/08/24 08:39:37 dfr Exp $ */ /* @@ -747,7 +747,7 @@ mincore(p, uap) mincoreinfo |= MINCORE_MODIFIED_OTHER; if ((m->flags & PG_REFERENCED) || pmap_ts_referenced(VM_PAGE_TO_PHYS(m))) { - PAGE_SET_FLAG(m, PG_REFERENCED); + vm_page_flag_set(m, PG_REFERENCED); mincoreinfo |= MINCORE_REFERENCED_OTHER; } } diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index dc7421f..2f6c2c5 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_object.c,v 1.126 1998/08/06 08:33:19 dfr Exp $ + * $Id: vm_object.c,v 1.127 1998/08/24 08:39:37 dfr Exp $ */ /* @@ -461,7 +461,7 @@ vm_object_terminate(object) if (p->busy || (p->flags & PG_BUSY)) printf("vm_object_terminate: freeing busy page\n"); #endif - PAGE_SET_FLAG(p, PG_BUSY); + vm_page_busy(p); vm_page_free(p); cnt.v_pfree++; } @@ -550,7 +550,7 @@ vm_object_page_clean(object, start, end, flags) } for(p = TAILQ_FIRST(&object->memq); p; p = TAILQ_NEXT(p, listq)) { - PAGE_SET_FLAG(p, PG_CLEANCHK); + vm_page_flag_set(p, PG_CLEANCHK); vm_page_protect(p, VM_PROT_READ); } @@ -569,19 +569,19 @@ rescan: (pi < tstart) || (pi >= tend) || (p->valid == 0) || ((p->queue - p->pc) == PQ_CACHE)) { - PAGE_CLEAR_FLAG(p, PG_CLEANCHK); + vm_page_flag_clear(p, PG_CLEANCHK); continue; } vm_page_test_dirty(p); if ((p->dirty & p->valid) == 0) { - PAGE_CLEAR_FLAG(p, PG_CLEANCHK); + vm_page_flag_clear(p, PG_CLEANCHK); continue; } s = splvm(); while ((p->flags & PG_BUSY) || p->busy) { - PAGE_SET_FLAG(p, PG_WANTED | PG_REFERENCED); + vm_page_flag_set(p, PG_WANTED | PG_REFERENCED); tsleep(p, PVM, "vpcwai", 0); if (object->generation != curgeneration) { splx(s); @@ -597,12 +597,12 @@ rescan: (tp->busy != 0)) break; if((tp->queue - tp->pc) == PQ_CACHE) { - PAGE_CLEAR_FLAG(tp, PG_CLEANCHK); + vm_page_flag_clear(tp, PG_CLEANCHK); break; } vm_page_test_dirty(tp); if ((tp->dirty & tp->valid) == 0) { - PAGE_CLEAR_FLAG(tp, PG_CLEANCHK); + vm_page_flag_clear(tp, PG_CLEANCHK); break; } maf[ i - 1 ] = tp; @@ -622,12 +622,12 @@ rescan: (tp->busy != 0)) break; if((tp->queue - tp->pc) == PQ_CACHE) { - PAGE_CLEAR_FLAG(tp, PG_CLEANCHK); + vm_page_flag_clear(tp, PG_CLEANCHK); break; } vm_page_test_dirty(tp); if ((tp->dirty & tp->valid) == 0) { - PAGE_CLEAR_FLAG(tp, PG_CLEANCHK); + vm_page_flag_clear(tp, PG_CLEANCHK); break; } mab[ i - 1 ] = tp; @@ -641,14 +641,14 @@ rescan: for(i=0;i<maxb;i++) { int index = (maxb - i) - 1; ma[index] = mab[i]; - PAGE_CLEAR_FLAG(ma[index], PG_CLEANCHK); + vm_page_flag_clear(ma[index], PG_CLEANCHK); } - PAGE_CLEAR_FLAG(p, PG_CLEANCHK); + vm_page_flag_clear(p, PG_CLEANCHK); ma[maxb] = p; for(i=0;i<maxf;i++) { int index = (maxb + i) + 1; ma[index] = maf[i]; - PAGE_CLEAR_FLAG(ma[index], PG_CLEANCHK); + vm_page_flag_clear(ma[index], PG_CLEANCHK); } runlen = maxb + maxf + 1; @@ -657,7 +657,7 @@ rescan: for (i = 0; i<runlen; i++) { if (ma[i]->valid & ma[i]->dirty) { vm_page_protect(ma[i], VM_PROT_READ); - PAGE_SET_FLAG(ma[i], PG_CLEANCHK); + vm_page_flag_set(ma[i], PG_CLEANCHK); } } if (object->generation != curgeneration) @@ -941,7 +941,7 @@ vm_object_qcollapse(object) p = next; continue; } - PAGE_SET_FLAG(p, PG_BUSY); + vm_page_busy(p); new_pindex = p->pindex - backing_offset_index; if (p->pindex < backing_offset_index || @@ -1066,7 +1066,7 @@ vm_object_collapse(object) while ((p = TAILQ_FIRST(&backing_object->memq)) != 0) { new_pindex = p->pindex - backing_offset_index; - PAGE_SET_FLAG(p, PG_BUSY); + vm_page_busy(p); /* * If the parent has a page here, or if this @@ -1216,7 +1216,7 @@ vm_object_collapse(object) p = TAILQ_NEXT(p, listq)) { new_pindex = p->pindex - backing_offset_index; - PAGE_SET_FLAG(p, PG_BUSY); + vm_page_busy(p); /* * If the parent has a page here, or if this @@ -1232,24 +1232,24 @@ vm_object_collapse(object) pp = vm_page_lookup(object, new_pindex); if ((pp == NULL) || (pp->flags & PG_BUSY) || pp->busy) { - PAGE_WAKEUP(p); + vm_page_wakeup(p); return; } - PAGE_SET_FLAG(pp, PG_BUSY); + vm_page_busy(pp); if ((pp->valid == 0) && !vm_pager_has_page(object, OFF_TO_IDX(object->paging_offset) + new_pindex, NULL, NULL)) { /* * Page still needed. Can't go any * further. */ - PAGE_WAKEUP(pp); - PAGE_WAKEUP(p); + vm_page_wakeup(pp); + vm_page_wakeup(p); return; } - PAGE_WAKEUP(pp); + vm_page_wakeup(pp); } - PAGE_WAKEUP(p); + vm_page_wakeup(p); } /* @@ -1341,7 +1341,7 @@ again: continue; } - PAGE_SET_FLAG(p, PG_BUSY); + vm_page_busy(p); vm_page_protect(p, VM_PROT_NONE); vm_page_free(p); } @@ -1374,7 +1374,7 @@ again: } } - PAGE_SET_FLAG(p, PG_BUSY); + vm_page_busy(p); vm_page_protect(p, VM_PROT_NONE); vm_page_free(p); } diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 03abeec..46f1923 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91 - * $Id: vm_page.c,v 1.105 1998/07/26 18:15:20 dfr Exp $ + * $Id: vm_page.c,v 1.106 1998/08/24 08:39:38 dfr Exp $ */ /* @@ -403,7 +403,7 @@ vm_page_insert(m, object, pindex) */ TAILQ_INSERT_TAIL(&object->memq, m, listq); - PAGE_SET_FLAG(m, PG_TABLED); + vm_page_flag_set(m, PG_TABLED); m->object->page_hint = m; m->object->generation++; @@ -446,9 +446,9 @@ vm_page_remove(m) } #endif - PAGE_CLEAR_FLAG(m, PG_BUSY); + vm_page_flag_clear(m, PG_BUSY); if (m->flags & PG_WANTED) { - PAGE_CLEAR_FLAG(m, PG_WANTED); + vm_page_flag_clear(m, PG_WANTED); wakeup(m); } @@ -484,7 +484,7 @@ vm_page_remove(m) object->generation++; m->object = NULL; - PAGE_CLEAR_FLAG(m, PG_TABLED); + vm_page_flag_clear(m, PG_TABLED); } /* @@ -940,7 +940,7 @@ vm_page_alloc(object, pindex, page_req) m->flags = PG_ZERO | PG_BUSY; } else if (qtype == PQ_CACHE) { oldobject = m->object; - PAGE_SET_FLAG(m, PG_BUSY); + vm_page_busy(m); vm_page_remove(m); m->flags = PG_BUSY; } else { @@ -1011,7 +1011,7 @@ vm_page_sleep(vm_page_t m, char *msg, char *busy) { int s; s = splvm(); if ((busy && *busy) || (m->flags & PG_BUSY)) { - PAGE_SET_FLAG(m, PG_WANTED); + vm_page_flag_set(m, PG_WANTED); tsleep(m, PVM, msg, 0); slept = 1; } @@ -1247,7 +1247,7 @@ vm_page_wire(m) } (*vm_page_queues[PQ_NONE].lcnt)++; m->wire_count++; - PAGE_SET_FLAG(m, PG_MAPPED); + vm_page_flag_set(m, PG_MAPPED); } /* @@ -1384,7 +1384,7 @@ retrylookup: s = splvm(); while ((object->generation == generation) && (m->busy || (m->flags & PG_BUSY))) { - PAGE_SET_FLAG(m, PG_WANTED | PG_REFERENCED); + vm_page_flag_set(m, PG_WANTED | PG_REFERENCED); tsleep(m, PVM, "pgrbwt", 0); if ((allocflags & VM_ALLOC_RETRY) == 0) { splx(s); @@ -1394,7 +1394,7 @@ retrylookup: splx(s); goto retrylookup; } else { - PAGE_SET_FLAG(m, PG_BUSY); + vm_page_busy(m); return m; } } @@ -1633,7 +1633,7 @@ again1: pqtype = m->queue - m->pc; if (pqtype == PQ_CACHE) { - PAGE_SET_FLAG(m, PG_BUSY); + vm_page_busy(m); vm_page_free(m); } diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index bf79064..32c8341 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_page.h,v 1.44 1998/08/24 08:39:38 dfr Exp $ + * $Id: vm_page.h,v 1.45 1998/09/01 17:12:19 wollman Exp $ */ /* @@ -281,31 +281,57 @@ extern vm_offset_t last_phys_addr; /* physical address for last_page */ * Functions implemented as macros */ -#define PAGE_SET_FLAG(m, bits) atomic_set_short(&(m)->flags, bits) +static __inline void +vm_page_flag_set(vm_page_t m, unsigned int bits) +{ + atomic_set_short(&(m)->flags, bits); +} -#define PAGE_CLEAR_FLAG(m, bits) atomic_clear_short(&(m)->flags, bits) +static __inline void +vm_page_flag_clear(vm_page_t m, unsigned int bits) +{ + atomic_clear_short(&(m)->flags, bits); +} + +#if 0 +static __inline void +vm_page_assert_wait(vm_page_t m, int interruptible) +{ + vm_page_flag_set(m, PG_WANTED); + assert_wait((int) m, interruptible); +} +#endif -#define PAGE_ASSERT_WAIT(m, interruptible) { \ - PAGE_SET_FLAG(m, PG_WANTED); \ - assert_wait((int) (m), (interruptible)); \ +static __inline void +vm_page_busy(vm_page_t m) +{ + vm_page_flag_set(m, PG_BUSY); } -#define PAGE_WAKEUP(m) { \ - PAGE_CLEAR_FLAG(m, PG_BUSY); \ - if ((m)->flags & PG_WANTED) { \ - PAGE_CLEAR_FLAG(m, PG_WANTED); \ - wakeup((m)); \ - } \ +static __inline void +vm_page_wakeup(vm_page_t m) +{ + vm_page_flag_clear(m, PG_BUSY); + if (m->flags & PG_WANTED) { + vm_page_flag_clear(m, PG_WANTED); + wakeup(m); + } } -#define PAGE_BUSY(m) atomic_add_char(&(m)->busy, 1) +static __inline void +vm_page_io_start(vm_page_t m) +{ + atomic_add_char(&(m)->busy, 1); +} -#define PAGE_BWAKEUP(m) { \ - atomic_subtract_char(&(m)->busy, 1); \ - if (((m)->flags & PG_WANTED) && (m)->busy == 0) { \ - PAGE_CLEAR_FLAG(m, PG_WANTED); \ - wakeup((m)); \ - } \ +static __inline void +vm_page_io_finish(vm_page_t m) +{ + atomic_subtract_char(&m->busy, 1); + if ((m->flags & PG_WANTED) && m->busy == 0) { + vm_page_flag_clear(m, PG_WANTED); + wakeup(m); + } } @@ -380,11 +406,11 @@ vm_page_protect(vm_page_t mem, int prot) if (prot == VM_PROT_NONE) { if (mem->flags & (PG_WRITEABLE|PG_MAPPED)) { pmap_page_protect(VM_PAGE_TO_PHYS(mem), VM_PROT_NONE); - PAGE_CLEAR_FLAG(mem, PG_WRITEABLE|PG_MAPPED); + vm_page_flag_clear(mem, PG_WRITEABLE|PG_MAPPED); } } else if ((prot == VM_PROT_READ) && (mem->flags & PG_WRITEABLE)) { pmap_page_protect(VM_PAGE_TO_PHYS(mem), VM_PROT_READ); - PAGE_CLEAR_FLAG(mem, PG_WRITEABLE); + vm_page_flag_clear(mem, PG_WRITEABLE); } } diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 2175622..441a436 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -65,7 +65,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_pageout.c,v 1.124 1998/08/06 08:33:19 dfr Exp $ + * $Id: vm_pageout.c,v 1.125 1998/08/24 08:39:38 dfr Exp $ */ /* @@ -362,7 +362,7 @@ vm_pageout_flush(mc, count, flags) int i; for (i = 0; i < count; i++) { - PAGE_BUSY(mc[i]); + vm_page_io_start(mc[i]); vm_page_protect(mc[i], VM_PROT_READ); } @@ -413,7 +413,7 @@ vm_pageout_flush(mc, count, flags) */ if (pageout_status[i] != VM_PAGER_PEND) { vm_object_pip_wakeup(object); - PAGE_BWAKEUP(mt); + vm_page_io_finish(mt); } } return numpagedout; @@ -476,7 +476,7 @@ vm_pageout_object_deactivate_pages(map, object, desired, map_remove_only) actcount = pmap_ts_referenced(VM_PAGE_TO_PHYS(p)); if (actcount) { - PAGE_SET_FLAG(p, PG_REFERENCED); + vm_page_flag_set(p, PG_REFERENCED); } else if (p->flags & PG_REFERENCED) { actcount = 1; } @@ -485,7 +485,7 @@ vm_pageout_object_deactivate_pages(map, object, desired, map_remove_only) (p->flags & PG_REFERENCED)) { vm_page_activate(p); p->act_count += actcount; - PAGE_CLEAR_FLAG(p, PG_REFERENCED); + vm_page_flag_clear(p, PG_REFERENCED); } else if (p->queue == PQ_ACTIVE) { if ((p->flags & PG_REFERENCED) == 0) { p->act_count -= min(p->act_count, ACT_DECLINE); @@ -500,7 +500,7 @@ vm_pageout_object_deactivate_pages(map, object, desired, map_remove_only) } } else { vm_page_activate(p); - PAGE_CLEAR_FLAG(p, PG_REFERENCED); + vm_page_flag_clear(p, PG_REFERENCED); if (p->act_count < (ACT_MAX - ACT_ADVANCE)) p->act_count += ACT_ADVANCE; s = splvm(); @@ -599,7 +599,7 @@ vm_pageout_page_free(vm_page_t m) { vbusy(vp); } - PAGE_SET_FLAG(m, PG_BUSY); + vm_page_busy(m); vm_page_protect(m, VM_PROT_NONE); vm_page_free(m); vm_object_deallocate(object); @@ -683,7 +683,7 @@ rescan0: * If the object is not being used, we ignore previous references. */ if (m->object->ref_count == 0) { - PAGE_CLEAR_FLAG(m, PG_REFERENCED); + vm_page_flag_clear(m, PG_REFERENCED); pmap_clear_reference(VM_PAGE_TO_PHYS(m)); /* @@ -708,7 +708,7 @@ rescan0: * inactive queue again. */ if ((m->flags & PG_REFERENCED) != 0) { - PAGE_CLEAR_FLAG(m, PG_REFERENCED); + vm_page_flag_clear(m, PG_REFERENCED); actcount = pmap_ts_referenced(VM_PAGE_TO_PHYS(m)); vm_page_activate(m); m->act_count += (actcount + ACT_ADVANCE + 1); @@ -906,7 +906,7 @@ rescan0: /* * Since we have "tested" this bit, we need to clear it now. */ - PAGE_CLEAR_FLAG(m, PG_REFERENCED); + vm_page_flag_clear(m, PG_REFERENCED); /* * Only if an object is currently being used, do we use the @@ -1095,7 +1095,7 @@ vm_pageout_page_stats() actcount = 0; if (m->flags & PG_REFERENCED) { - PAGE_CLEAR_FLAG(m, PG_REFERENCED); + vm_page_flag_clear(m, PG_REFERENCED); actcount += 1; } diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 90570c6..ec6f9a8 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -38,7 +38,7 @@ * SUCH DAMAGE. * * from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91 - * $Id: vnode_pager.c,v 1.95 1998/08/24 08:39:38 dfr Exp $ + * $Id: vnode_pager.c,v 1.96 1998/08/25 13:47:37 luoqi Exp $ */ /* @@ -440,7 +440,7 @@ vnode_pager_input_smlfs(object, m) } vm_pager_unmap_page(kva); pmap_clear_modify(VM_PAGE_TO_PHYS(m)); - PAGE_CLEAR_FLAG(m, PG_ZERO); + vm_page_flag_clear(m, PG_ZERO); if (error) { return VM_PAGER_ERROR; } @@ -504,7 +504,7 @@ vnode_pager_input_old(object, m) } pmap_clear_modify(VM_PAGE_TO_PHYS(m)); m->dirty = 0; - PAGE_CLEAR_FLAG(m, PG_ZERO); + vm_page_flag_clear(m, PG_ZERO); return error ? VM_PAGER_ERROR : VM_PAGER_OK; } @@ -771,7 +771,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) vm_page_set_validclean(mt, 0, nvalid); } - PAGE_CLEAR_FLAG(mt, PG_ZERO); + vm_page_flag_clear(mt, PG_ZERO); if (i != reqpage) { /* @@ -791,7 +791,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) vm_page_activate(mt); else vm_page_deactivate(mt); - PAGE_WAKEUP(mt); + vm_page_wakeup(mt); } else { vnode_pager_freepage(mt); } |