1. Buffers were being immediately aged after read, greatly reducing
file system performance.
2. The file system buffer cache hash calculation resulted in hash
collision occuring 100% of the time.
3. File system buffers were allocated twice. They were also deallocated
twice, so there was not a memory leak, but freebufspace was incorrect
and too much memory was being used.
4. Unnecessary call to swapout_threads in the vm system.
AUTHOR: David Greenman (davidg@agora.uucp)
386BSD-Patchkit: patch00007
* SUCH DAMAGE.
*
* @(#)spec_vnops.c 7.37 (Berkeley) 5/30/91
* SUCH DAMAGE.
*
* @(#)spec_vnops.c 7.37 (Berkeley) 5/30/91
+ *
+ * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
+ * -------------------- ----- ----------------------
+ * CURRENT PATCH LEVEL: 1 00007
+ * -------------------- ----- ----------------------
+ *
+ * 20 Aug 92 David Greenman Fixed incorrect setting of B_AGE on
return (error);
}
error = uiomove(bp->b_un.b_addr + on, n, uio);
return (error);
}
error = uiomove(bp->b_un.b_addr + on, n, uio);
+#ifdef OMIT /* 20 Aug 92*/
if (n + on == bsize)
bp->b_flags |= B_AGE;
if (n + on == bsize)
bp->b_flags |= B_AGE;
brelse(bp);
} while (error == 0 && uio->uio_resid > 0 && n != 0);
return (error);
brelse(bp);
} while (error == 0 && uio->uio_resid > 0 && n != 0);
return (error);
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
+ * -------------------- ----- ----------------------
+ * CURRENT PATCH LEVEL: 1 00007
+ * -------------------- ----- ----------------------
+ *
+ * 20 Aug 92 David Greenman Fix getnewbuf() 2xAllocation
*/
static char rcsid[] = "$Header: /usr/bill/working/sys/kern/RCS/vfs__bio.c,v 1.2 92/01/21 21:30:08 william Exp $";
*/
static char rcsid[] = "$Header: /usr/bill/working/sys/kern/RCS/vfs__bio.c,v 1.2 92/01/21 21:30:08 william Exp $";
bp->b_flags = B_BUSY | B_INVAL;
bremfree(bp);
bp->b_un.b_addr = addr;
bp->b_flags = B_BUSY | B_INVAL;
bremfree(bp);
bp->b_un.b_addr = addr;
+ bp->b_bufsize = sz; /* 20 Aug 92*/
* SUCH DAMAGE.
*
* @(#)buf.h 7.11 (Berkeley) 5/9/90
* SUCH DAMAGE.
*
* @(#)buf.h 7.11 (Berkeley) 5/9/90
+ *
+ * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
+ * -------------------- ----- ----------------------
+ * CURRENT PATCH LEVEL: 1 00007
+ * -------------------- ----- ----------------------
+ *
+ * 20 Aug 92 David Greenman Fixed buffer cache hash index
+ * calculation
#ifdef KERNEL
#define BUFHSZ 512
#define RND (MAXBSIZE/DEV_BSIZE)
#ifdef KERNEL
#define BUFHSZ 512
#define RND (MAXBSIZE/DEV_BSIZE)
#if ((BUFHSZ&(BUFHSZ-1)) == 0)
#define BUFHASH(dvp, dblkno) \
#if ((BUFHSZ&(BUFHSZ-1)) == 0)
#define BUFHASH(dvp, dblkno) \
- ((struct buf *)&bufhash[((int)(dvp)+(((int)(dblkno))/RND))&(BUFHSZ-1)])
+ ((struct buf *)&bufhash[((int)(dvp)/sizeof(struct vnode)+(int)(dblkno))&(BUFHSZ-1)])
#else
#define BUFHASH(dvp, dblkno) \
#else
#define BUFHASH(dvp, dblkno) \
- ((struct buf *)&bufhash[((int)(dvp)+(((int)(dblkno))/RND)) % BUFHSZ])
+ ((struct buf *)&bufhash[((int)(dvp)/sizeof(struct vnode)+(int)(dblkno)) % BUFHSZ])
#endif
struct buf *buf; /* the buffer pool itself */
#endif
struct buf *buf; /* the buffer pool itself */
* SUCH DAMAGE.
*
* @(#)ufs_vnops.c 7.64 (Berkeley) 5/16/91
* SUCH DAMAGE.
*
* @(#)ufs_vnops.c 7.64 (Berkeley) 5/16/91
+ *
+ * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
+ * -------------------- ----- ----------------------
+ * CURRENT PATCH LEVEL: 1 00007
+ * -------------------- ----- ----------------------
+ *
+ * 20 Aug 92 David Greenman Fixed incorrect setting of B_AGE after
+ * each read to improve cache performance
return (error);
}
error = uiomove(bp->b_un.b_addr + on, (int)n, uio);
return (error);
}
error = uiomove(bp->b_un.b_addr + on, (int)n, uio);
if (n + on == fs->fs_bsize || uio->uio_offset == ip->i_size)
bp->b_flags |= B_AGE;
if (n + on == fs->fs_bsize || uio->uio_offset == ip->i_size)
bp->b_flags |= B_AGE;
brelse(bp);
} while (error == 0 && uio->uio_resid > 0 && n != 0);
return (error);
brelse(bp);
} while (error == 0 && uio->uio_resid > 0 && n != 0);
return (error);
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
+ *
+ * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
+ * -------------------- ----- ----------------------
+ * CURRENT PATCH LEVEL: 1 00007
+ * -------------------- ----- ----------------------
+ *
+ * 20 Aug 92 David Greenman Removed un-necessary call to
+ * swapout_thread
splx(s);
if (free < vm_page_free_target) {
splx(s);
if (free < vm_page_free_target) {
/*
* Be sure the pmap system is updated so
/*
* Be sure the pmap system is updated so