summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ufs
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>1999-07-08 06:06:00 +0000
committermckusick <mckusick@FreeBSD.org>1999-07-08 06:06:00 +0000
commit52ea4270f31e0e98f9256262d955b9d8b54b4a00 (patch)
treedca69dbd5c0caa38ba5484660947559b9a6e6acc /sys/ufs/ufs
parent28a2932015592e29bc53e27e881a9987c0020796 (diff)
downloadFreeBSD-src-52ea4270f31e0e98f9256262d955b9d8b54b4a00.zip
FreeBSD-src-52ea4270f31e0e98f9256262d955b9d8b54b4a00.tar.gz
These changes appear to give us benefits with both small (32MB) and
large (1G) memory machine configurations. I was able to run 'dbench 32' on a 32MB system without bring the machine to a grinding halt. * buffer cache hash table now dynamically allocated. This will have no effect on memory consumption for smaller systems and will help scale the buffer cache for larger systems. * minor enhancement to pmap_clearbit(). I noticed that all the calls to it used constant arguments. Making it an inline allows the constants to propogate to deeper inlines and should produce better code. * removal of inherent vfs_ioopt support through the emplacement of appropriate #ifdef's, with John's permission. If we do not find a use for it by the end of the year we will remove it entirely. * removal of getnewbufloops* counters & sysctl's - no longer necessary for debugging, getnewbuf() is now optimal. * buffer hash table functions removed from sys/buf.h and localized to vfs_bio.c * VFS_BIO_NEED_DIRTYFLUSH flag and support code added ( bwillwrite() ), allowing processes to block when too many dirty buffers are present in the system. * removal of a softdep test in bdwrite() that is no longer necessary now that bdwrite() no longer attempts to flush dirty buffers. * slight optimization added to bqrelse() - there is no reason to test for available buffer space on B_DELWRI buffers. * addition of reverse-scanning code to vfs_bio_awrite(). vfs_bio_awrite() will attempt to locate clusterable areas in both the forward and reverse direction relative to the offset of the buffer passed to it. This will probably not make much of a difference now, but I believe we will start to rely on it heavily in the future if we decide to shift some of the burden of the clustering closer to the actual I/O initiation. * Removal of the newbufcnt and lastnewbuf counters that Kirk added. They do not fix any race conditions that haven't already been fixed by the gbincore() test done after the only call to getnewbuf(). getnewbuf() is a static, so there is no chance of it being misused by other modules. ( Unless Kirk can think of a specific thing that this code fixes. I went through it very carefully and didn't see anything ). * removal of VOP_ISLOCKED() check in flushbufqueues(). I do not think this check is necessary, the buffer should flush properly whether the vnode is locked or not. ( yes? ). * removal of extra arguments passed to getnewbuf() that are not necessary. * missed cluster_wbuild() that had to be a cluster_wbuild_wb() in vfs_cluster.c * vn_write() now calls bwillwrite() *PRIOR* to locking the vnode, which should greatly aid flushing operations in heavy load situations - both the pageout and update daemons will be able to operate more efficiently. * removal of b_usecount. We may add it back in later but for now it is useless. Prior implementations of the buffer cache never had enough buffers for it to be useful, and current implementations which make more buffers available might not benefit relative to the amount of sophistication required to implement a b_usecount. Straight LRU should work just as well, especially when most things are VMIO backed. I expect that (even though John will not like this assumption) directories will become VMIO backed some point soon. Submitted by: Matthew Dillon <dillon@backplane.com> Reviewed by: Kirk McKusick <mckusick@mckusick.com>
Diffstat (limited to 'sys/ufs/ufs')
-rw-r--r--sys/ufs/ufs/ufs_readwrite.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c
index d12a802..53f980a 100644
--- a/sys/ufs/ufs/ufs_readwrite.c
+++ b/sys/ufs/ufs/ufs_readwrite.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_readwrite.c 8.11 (Berkeley) 5/8/95
- * $Id: ufs_readwrite.c,v 1.57 1999/01/28 00:57:56 dillon Exp $
+ * $Id: ufs_readwrite.c,v 1.58 1999/04/05 19:38:30 julian Exp $
*/
#define BLKSIZE(a, b, c) blksize(a, b, c)
@@ -106,7 +106,8 @@ READ(ap)
if (object)
vm_object_reference(object);
-#if 1
+
+#ifdef ENABLE_VFS_IOOPT
/*
* If IO optimisation is turned on,
* and we are NOT a VM based IO request,
@@ -150,7 +151,7 @@ READ(ap)
for (error = 0, bp = NULL; uio->uio_resid > 0; bp = NULL) {
if ((bytesinfile = ip->i_size - uio->uio_offset) <= 0)
break;
-#if 1
+#ifdef ENABLE_VFS_IOOPT
if ((ioflag & IO_VMIO) == 0 && (vfs_ioopt > 1) && object) {
/*
* Obviously we didn't finish above, but we
@@ -276,6 +277,7 @@ READ(ap)
xfersize = size;
}
+#ifdef ENABLE_VFS_IOOPT
if (vfs_ioopt && object &&
(bp->b_flags & B_VMIO) &&
((blkoffset & PAGE_MASK) == 0) &&
@@ -289,7 +291,9 @@ READ(ap)
error =
uiomoveco((char *)bp->b_data + blkoffset,
(int)xfersize, uio, object);
- } else {
+ } else
+#endif
+ {
/*
* otherwise use the general form
*/
OpenPOWER on IntegriCloud