summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1996-01-19 04:00:31 +0000
committerdyson <dyson@FreeBSD.org>1996-01-19 04:00:31 +0000
commit8fc8a772af22f6e03233d248fa2dbd9b5c2bdd7d (patch)
tree3c31fd95ea745005a9cd6733db5a16f31bd828a6 /sys/ufs
parent6755beedbf0ddaa9e66e91c8e74f620ede6bfad5 (diff)
downloadFreeBSD-src-8fc8a772af22f6e03233d248fa2dbd9b5c2bdd7d.zip
FreeBSD-src-8fc8a772af22f6e03233d248fa2dbd9b5c2bdd7d.tar.gz
Eliminated many redundant vm_map_lookup operations for vm_mmap.
Speed up for vfs_bio -- addition of a routine bqrelse to greatly diminish overhead for merged cache. Efficiency improvement for vfs_cluster. It used to do alot of redundant calls to cluster_rbuild. Correct the ordering for vrele of .text and release of credentials. Use the selective tlb update for 486/586/P6. Numerous fixes to the size of objects allocated for files. Additionally, fixes in the various pagers. Fixes for proper positioning of vnode_pager_setsize in msdosfs and ext2fs. Fixes in the swap pager for exhausted resources. The pageout code will not as readily thrash. Change the page queue flags (PG_ACTIVE, PG_INACTIVE, PG_FREE, PG_CACHE) into page queue indices (PQ_ACTIVE, PQ_INACTIVE, PQ_FREE, PQ_CACHE), thereby improving efficiency of several routines. Eliminate even more unnecessary vm_page_protect operations. Significantly speed up process forks. Make vm_object_page_clean more efficient, thereby eliminating the pause that happens every 30seconds. Make sequential clustered writes B_ASYNC instead of B_DELWRI even in the case of filesystems mounted async. Fix a panic with busy pages when write clustering is done for non-VMIO buffers.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_balloc.c4
-rw-r--r--sys/ufs/ffs/ffs_inode.c6
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c6
-rw-r--r--sys/ufs/ufs/ufs_bmap.c6
-rw-r--r--sys/ufs/ufs/ufs_readwrite.c15
-rw-r--r--sys/ufs/ufs/ufs_vnops.c3
6 files changed, 22 insertions, 18 deletions
diff --git a/sys/ufs/ffs/ffs_balloc.c b/sys/ufs/ffs/ffs_balloc.c
index cbe9c60..005fea6 100644
--- a/sys/ufs/ffs/ffs_balloc.c
+++ b/sys/ufs/ffs/ffs_balloc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_balloc.c 8.4 (Berkeley) 9/23/93
- * $Id: ffs_balloc.c,v 1.8 1995/05/28 04:32:23 davidg Exp $
+ * $Id: ffs_balloc.c,v 1.9 1995/05/30 08:14:59 rgrimes Exp $
*/
#include <sys/param.h>
@@ -210,7 +210,7 @@ ffs_balloc(ip, bn, size, cred, bpp, flags)
break;
i += 1;
if (nb != 0) {
- brelse(bp);
+ bqrelse(bp);
continue;
}
if (pref == 0)
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index 8c99d2b..63186c6 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_inode.c 8.5 (Berkeley) 12/30/93
- * $Id: ffs_inode.c,v 1.18 1995/12/11 04:57:37 dyson Exp $
+ * $Id: ffs_inode.c,v 1.19 1996/01/05 18:31:48 wollman Exp $
*/
#include "opt_quota.h"
@@ -220,6 +220,7 @@ ffs_truncate(ap)
aflags = B_CLRBUF;
if (ap->a_flags & IO_SYNC)
aflags |= B_SYNC;
+ vnode_pager_setsize(ovp, length);
error = ffs_balloc(oip, lbn, offset + 1, ap->a_cred,
&bp, aflags);
if (error)
@@ -231,7 +232,6 @@ ffs_truncate(ap)
bdwrite(bp);
else
bawrite(bp);
- vnode_pager_setsize(ovp, length);
oip->i_flag |= IN_CHANGE | IN_UPDATE;
return (VOP_UPDATE(ovp, &tv, &tv, 1));
}
@@ -290,7 +290,7 @@ ffs_truncate(ap)
for (i = NDADDR - 1; i > lastblock; i--)
oip->i_db[i] = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- error = VOP_UPDATE(ovp, &tv, &tv, 0);
+ error = VOP_UPDATE(ovp, &tv, &tv, ((length > 0) ? 0 : 1));
if (error)
allerror = error;
/*
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index e310708..7fe9299 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94
- * $Id: ffs_vfsops.c,v 1.33 1996/01/05 18:31:49 wollman Exp $
+ * $Id: ffs_vfsops.c,v 1.34 1996/01/14 18:54:59 bde Exp $
*/
#include "opt_quota.h"
@@ -908,13 +908,13 @@ restart:
* still zero, it will be unlinked and returned to the free
* list by vput().
*/
- vput(vp);
brelse(bp);
+ vput(vp);
*vpp = NULL;
return (error);
}
ip->i_din = *((struct dinode *)bp->b_data + ino_to_fsbo(fs, ino));
- brelse(bp);
+ bqrelse(bp);
/*
* Initialize the vnode from the inode, check for aliases.
diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c
index c8b3cd4..2b2531d 100644
--- a/sys/ufs/ufs/ufs_bmap.c
+++ b/sys/ufs/ufs/ufs_bmap.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_bmap.c 8.6 (Berkeley) 1/21/94
- * $Id: ufs_bmap.c,v 1.9 1995/09/04 00:21:09 dyson Exp $
+ * $Id: ufs_bmap.c,v 1.10 1995/11/05 23:07:37 dyson Exp $
*/
#include <sys/param.h>
@@ -188,7 +188,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb)
* or we have a disk address for it, go fetch it.
*/
if (bp)
- brelse(bp);
+ bqrelse(bp);
xap->in_exists = 1;
bp = getblk(vp, metalbn, mp->mnt_stat.f_iosize, 0, 0);
@@ -226,7 +226,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb)
}
}
if (bp)
- brelse(bp);
+ bqrelse(bp);
daddr = blkptrtodb(ump, daddr);
*bnp = daddr == 0 ? -1 : daddr;
diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c
index 582595c..8edb6a4 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.7 (Berkeley) 1/21/94
- * $Id: ufs_readwrite.c,v 1.18 1996/01/06 12:49:53 phk Exp $
+ * $Id: ufs_readwrite.c,v 1.19 1996/01/07 09:42:36 phk Exp $
*/
#ifdef LFS_READWRITE
@@ -107,6 +107,7 @@ READ(ap)
nextlbn = lbn + 1;
size = BLKSIZE(fs, ip, lbn);
blkoffset = blkoff(fs, uio->uio_offset);
+
xfersize = fs->fs_bsize - blkoffset;
if (uio->uio_resid < xfersize)
xfersize = uio->uio_resid;
@@ -129,8 +130,11 @@ READ(ap)
} else
error = bread(vp, lbn, size, NOCRED, &bp);
#endif
- if (error)
+ if (error) {
+ brelse(bp);
+ bp = NULL;
break;
+ }
vp->v_lastr = lbn;
/*
@@ -155,10 +159,10 @@ READ(ap)
if (error)
break;
- brelse(bp);
+ bqrelse(bp);
}
if (bp != NULL)
- brelse(bp);
+ bqrelse(bp);
ip->i_flag |= IN_ACCESS;
return (error);
}
@@ -280,8 +284,7 @@ WRITE(ap)
if (ioflag & IO_SYNC) {
(void)bwrite(bp);
- } else if (xfersize + blkoffset == fs->fs_bsize &&
- (vp->v_mount->mnt_flag & MNT_ASYNC) == 0) {
+ } else if (xfersize + blkoffset == fs->fs_bsize) {
if (doclusterwrite) {
bp->b_flags |= B_CLUSTEROK;
cluster_write(bp, ip->i_size);
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 4ac9bbb..4b60aaa 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_vnops.c 8.10 (Berkeley) 4/1/94
- * $Id: ufs_vnops.c,v 1.35 1995/12/11 04:57:49 dyson Exp $
+ * $Id: ufs_vnops.c,v 1.36 1996/01/05 18:31:58 wollman Exp $
*/
#include "opt_quota.h"
@@ -2131,6 +2131,7 @@ ufs_makeinode(mode, dvp, vpp, cnp)
#endif /* EXT2FS */
if (error)
goto bad;
+
if ((cnp->cn_flags & SAVESTART) == 0)
FREE(cnp->cn_pnbuf, M_NAMEI);
vput(dvp);
OpenPOWER on IntegriCloud