diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 5820a4e97001..33f9a9e5be69 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.200 1998/05/19 00:06:35 tegge Exp $ + * $Id: pmap.c,v 1.201 1998/05/19 08:58:48 phk Exp $ */ /* @@ -2496,6 +2496,7 @@ retry: continue; } if (((p->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) && + (p->busy == 0) && (p->flags & (PG_BUSY | PG_FICTITIOUS)) == 0) { if ((p->queue - p->pc) == PQ_CACHE) vm_page_deactivate(p); @@ -2516,6 +2517,7 @@ retry: p = vm_page_lookup(object, tmpidx + pindex); if (p && ((p->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) && + (p->busy == 0) && (p->flags & (PG_BUSY | PG_FICTITIOUS)) == 0) { if ((p->queue - p->pc) == PQ_CACHE) vm_page_deactivate(p); @@ -2610,6 +2612,7 @@ pmap_prefault(pmap, addra, entry) break; if (((m->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) && + (m->busy == 0) && (m->flags & (PG_BUSY | PG_FICTITIOUS)) == 0) { if ((m->queue - m->pc) == PQ_CACHE) { diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index 82f001d49035..a168bc89db50 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)spec_vnops.c 8.14 (Berkeley) 5/21/95 - * $Id: spec_vnops.c,v 1.60 1998/03/08 09:57:36 julian Exp $ + * $Id: spec_vnops.c,v 1.61 1998/04/19 23:32:26 julian Exp $ */ #include @@ -551,7 +551,8 @@ spec_strategy(ap) struct buf *bp; bp = ap->a_bp; - if ((LIST_FIRST(&bp->b_dep)) != NULL && bioops.io_start) + if (((bp->b_flags & B_READ) == 0) && + (LIST_FIRST(&bp->b_dep)) != NULL && bioops.io_start) (*bioops.io_start)(bp); (*bdevsw[major(bp->b_dev)]->d_strategy)(bp); return (0); diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 5820a4e97001..33f9a9e5be69 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.200 1998/05/19 00:06:35 tegge Exp $ + * $Id: pmap.c,v 1.201 1998/05/19 08:58:48 phk Exp $ */ /* @@ -2496,6 +2496,7 @@ retry: continue; } if (((p->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) && + (p->busy == 0) && (p->flags & (PG_BUSY | PG_FICTITIOUS)) == 0) { if ((p->queue - p->pc) == PQ_CACHE) vm_page_deactivate(p); @@ -2516,6 +2517,7 @@ retry: p = vm_page_lookup(object, tmpidx + pindex); if (p && ((p->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) && + (p->busy == 0) && (p->flags & (PG_BUSY | PG_FICTITIOUS)) == 0) { if ((p->queue - p->pc) == PQ_CACHE) vm_page_deactivate(p); @@ -2610,6 +2612,7 @@ pmap_prefault(pmap, addra, entry) break; if (((m->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) && + (m->busy == 0) && (m->flags & (PG_BUSY | PG_FICTITIOUS)) == 0) { if ((m->queue - m->pc) == PQ_CACHE) { diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index 128940ca0790..079c4da7a1a8 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -33,7 +33,7 @@ * SUCH DAMAGE. * * @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94 - * $Id: vfs_cluster.c,v 1.60 1998/03/19 22:48:13 dyson Exp $ + * $Id: vfs_cluster.c,v 1.61 1998/05/01 16:29:27 bde Exp $ */ #include "opt_debug_cluster.h" @@ -243,19 +243,15 @@ single_block_read: * handle the synchronous read */ if (bp) { - if (bp->b_flags & (B_DONE | B_DELWRI)) { - panic("cluster_read: DONE bp"); - } else { #if defined(CLUSTERDEBUG) - if (rcluster) - printf("S(%d,%d,%d) ", - bp->b_lblkno, bp->b_bcount, seqcount); + if (rcluster) + printf("S(%d,%d,%d) ", + bp->b_lblkno, bp->b_bcount, seqcount); #endif - if ((bp->b_flags & B_CLUSTER) == 0) - vfs_busy_pages(bp, 0); - error = VOP_STRATEGY(bp); - curproc->p_stats->p_ru.ru_inblock++; - } + if ((bp->b_flags & B_CLUSTER) == 0) + vfs_busy_pages(bp, 0); + error = VOP_STRATEGY(bp); + curproc->p_stats->p_ru.ru_inblock++; } /* diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 82f001d49035..a168bc89db50 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)spec_vnops.c 8.14 (Berkeley) 5/21/95 - * $Id: spec_vnops.c,v 1.60 1998/03/08 09:57:36 julian Exp $ + * $Id: spec_vnops.c,v 1.61 1998/04/19 23:32:26 julian Exp $ */ #include @@ -551,7 +551,8 @@ spec_strategy(ap) struct buf *bp; bp = ap->a_bp; - if ((LIST_FIRST(&bp->b_dep)) != NULL && bioops.io_start) + if (((bp->b_flags & B_READ) == 0) && + (LIST_FIRST(&bp->b_dep)) != NULL && bioops.io_start) (*bioops.io_start)(bp); (*bdevsw[major(bp->b_dev)]->d_strategy)(bp); return (0); diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index d17f6ea42a48..24c028a86755 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.125 1998/05/04 17:12:52 dyson Exp $ + * $Id: vm_map.c,v 1.126 1998/05/16 23:03:20 dyson Exp $ */ /* @@ -76,6 +76,7 @@ #include #include #include +#include #include #include @@ -1631,6 +1632,8 @@ vm_map_clean(map, start, end, syncio, invalidate) } } + if (invalidate) + pmap_remove(vm_map_pmap(map), start, end); /* * Make a second pass, cleaning/uncaching pages from the indicated * objects as we go. @@ -1668,9 +1671,6 @@ vm_map_clean(map, start, end, syncio, invalidate) if (object->size < OFF_TO_IDX( offset + size)) size = IDX_TO_OFF(object->size) - offset; } - if (invalidate) - pmap_remove(vm_map_pmap(map), current->start, - current->start + size); if (object && (object->type == OBJT_VNODE)) { /* * Flush pages if writing is allowed. XXX should we continue @@ -1690,11 +1690,13 @@ vm_map_clean(map, start, end, syncio, invalidate) OFF_TO_IDX(offset), OFF_TO_IDX(offset + size + PAGE_MASK), flags); - if (invalidate) + if (invalidate) { + vm_object_pip_wait(object, "objmcl"); vm_object_page_remove(object, OFF_TO_IDX(offset), OFF_TO_IDX(offset + size + PAGE_MASK), FALSE); + } if (object->type == OBJT_VNODE) VOP_UNLOCK(object->handle, 0, curproc); } diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index f1abad0f95ae..df91aa0125b0 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.119 1998/03/16 01:55:52 dyson Exp $ + * $Id: vm_object.c,v 1.120 1998/04/29 04:28:09 dyson Exp $ */ /* @@ -74,6 +74,7 @@ #include #include #include +#include #include #include @@ -651,13 +652,20 @@ rescan: ma[index]->flags &= ~PG_CLEANCHK; } runlen = maxb + maxf + 1; + splx(s); vm_pageout_flush(ma, runlen, pagerflags); + for (i = 0; ivalid & ma[i]->dirty) { + vm_page_protect(ma[i], VM_PROT_READ); + ma[i]->flags |= PG_CLEANCHK; + } + } if (object->generation != curgeneration) goto rescan; } - VOP_FSYNC(vp, NULL, (pagerflags & VM_PAGER_PUT_SYNC)?1:0, curproc); + VOP_FSYNC(vp, NULL, (pagerflags & VM_PAGER_PUT_SYNC)?MNT_WAIT:0, curproc); object->flags &= ~OBJ_CLEANING; return;