summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2004-05-06 05:03:23 +0000
committeralc <alc@FreeBSD.org>2004-05-06 05:03:23 +0000
commitb57e5e03fd70fac20a610e56ad7729e47f198a33 (patch)
tree14ae6e4ab50ff0759faf5365c3a928333e1b9c90 /sys/kern/vfs_bio.c
parented742a54c4d82222ed831fc8e7321cf7149ed8ed (diff)
downloadFreeBSD-src-b57e5e03fd70fac20a610e56ad7729e47f198a33.zip
FreeBSD-src-b57e5e03fd70fac20a610e56ad7729e47f198a33.tar.gz
Make vm_page's PG_ZERO flag immutable between the time of the page's
allocation and deallocation. This flag's principal use is shortly after allocation. For such cases, clearing the flag is pointless. The only unusual use of PG_ZERO is in vfs_bio_clrbuf(). However, allocbuf() never requests a prezeroed page. So, vfs_bio_clrbuf() never sees a prezeroed page. Reviewed by: tegge@
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r--sys/kern/vfs_bio.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 3b1f0d2..e4924c9 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1336,9 +1336,6 @@ brelse(struct buf * bp)
int had_bogus = 0;
m = bp->b_pages[i];
- vm_page_lock_queues();
- vm_page_flag_clear(m, PG_ZERO);
- vm_page_unlock_queues();
/*
* If we hit a bogus page, fixup *all* the bogus pages
@@ -1582,7 +1579,6 @@ vfs_vmio_release(bp)
continue;
if (m->wire_count == 0) {
- vm_page_flag_clear(m, PG_ZERO);
/*
* Might as well free the page if we can and it has
* no valid data. We also free the page if the
@@ -2326,10 +2322,8 @@ vfs_setdirty(struct buf *bp)
* test the pages to see if they have been modified directly
* by users through the VM system.
*/
- for (i = 0; i < bp->b_npages; i++) {
- vm_page_flag_clear(bp->b_pages[i], PG_ZERO);
+ for (i = 0; i < bp->b_npages; i++)
vm_page_test_dirty(bp->b_pages[i]);
- }
/*
* Calculate the encompassing dirty range, boffset and eoffset,
@@ -2919,7 +2913,6 @@ allocbuf(struct buf *bp, int size)
(cnt.v_free_min + cnt.v_cache_min))) {
pagedaemon_wakeup();
}
- vm_page_flag_clear(m, PG_ZERO);
vm_page_wire(m);
vm_page_unlock_queues();
bp->b_pages[bp->b_npages] = m;
@@ -3233,7 +3226,6 @@ bufdone(struct buf *bp)
if ((bp->b_iocmd == BIO_READ) && !bogusflag && resid > 0) {
vfs_page_set_valid(bp, foff, i, m);
}
- vm_page_flag_clear(m, PG_ZERO);
/*
* when debugging new filesystems or buffer I/O methods, this
@@ -3316,7 +3308,6 @@ vfs_unbusy_pages(struct buf * bp)
pmap_qenter(trunc_page((vm_offset_t)bp->b_data), bp->b_pages, bp->b_npages);
}
vm_object_pip_subtract(obj, 1);
- vm_page_flag_clear(m, PG_ZERO);
vm_page_io_finish(m);
}
vm_page_unlock_queues();
@@ -3402,7 +3393,6 @@ retry:
for (i = 0; i < bp->b_npages; i++) {
vm_page_t m = bp->b_pages[i];
- vm_page_flag_clear(m, PG_ZERO);
if ((bp->b_flags & B_CLUSTER) == 0) {
vm_object_pip_add(obj, 1);
vm_page_io_start(m);
@@ -3579,9 +3569,6 @@ vfs_bio_clrbuf(struct buf *bp)
}
}
bp->b_pages[i]->valid |= mask;
- vm_page_lock_queues();
- vm_page_flag_clear(bp->b_pages[i], PG_ZERO);
- vm_page_unlock_queues();
}
unlock:
VM_OBJECT_UNLOCK(bp->b_object);
OpenPOWER on IntegriCloud