aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_export.c
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2000-01-05 05:11:37 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2000-01-05 05:11:37 +0000
commitc37c9620cd35778fe0ae556104be4386a40a3ca5 (patch)
tree160e45b1fb6af61fa12ac66be626c54e38bc32a2 /sys/kern/vfs_export.c
parent32900e82f3f93633034bcc455508008e9dd8b2c8 (diff)
downloadsrc-c37c9620cd35778fe0ae556104be4386a40a3ca5.tar.gz
src-c37c9620cd35778fe0ae556104be4386a40a3ca5.zip
Enhance reassignbuf(). When a buffer cannot be time-optimally inserted
into vnode dirtyblkhd we append it to the list instead of prepend it to the list in order to maintain a 'forward' locality of reference, which is arguably better then 'reverse'. The original algorithm did things this way to but at a huge time cost. Enhance the append interlock for NFS writes to handle intr/soft mounts better. Fix the hysteresis for NFS async daemon I/O requests to reduce the number of unnecessary context switches. Modify handling of NFS mount options. Any given user option that is too high now defaults to the kernel maximum for that option rather then the kernel default for that option. Reviewed by: Alfred Perlstein <bright@wintelcom.net>
Notes
Notes: svn path=/head/; revision=55431
Diffstat (limited to 'sys/kern/vfs_export.c')
-rw-r--r--sys/kern/vfs_export.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c
index 76bd5843c369..059ca2a4787a 100644
--- a/sys/kern/vfs_export.c
+++ b/sys/kern/vfs_export.c
@@ -1208,6 +1208,7 @@ reassignbuf(bp, newvp)
tbp = TAILQ_FIRST(listheadp);
if (tbp == NULL ||
bp->b_lblkno == 0 ||
+ (bp->b_lblkno > 0 && tbp->b_lblkno < 0) ||
(bp->b_lblkno > 0 && bp->b_lblkno < tbp->b_lblkno)) {
TAILQ_INSERT_HEAD(listheadp, bp, b_vnbufs);
++reassignbufsortgood;
@@ -1217,14 +1218,30 @@ reassignbuf(bp, newvp)
} else if (reassignbufmethod == 1) {
/*
* New sorting algorithm, only handle sequential case,
- * otherwise guess.
+ * otherwise append to end (but before metadata)
*/
if ((tbp = gbincore(newvp, bp->b_lblkno - 1)) != NULL &&
(tbp->b_xflags & BX_VNDIRTY)) {
+ /*
+ * Found the best place to insert the buffer
+ */
TAILQ_INSERT_AFTER(listheadp, tbp, bp, b_vnbufs);
++reassignbufsortgood;
} else {
- TAILQ_INSERT_HEAD(listheadp, bp, b_vnbufs);
+ /*
+ * Missed, append to end, but before meta-data.
+ * We know that the head buffer in the list is
+ * not meta-data due to prior conditionals.
+ *
+ * Indirect effects: NFS second stage write
+ * tends to wind up here, giving maximum
+ * distance between the unstable write and the
+ * commit rpc.
+ */
+ tbp = TAILQ_LAST(listheadp, buflists);
+ while (tbp && tbp->b_lblkno < 0)
+ tbp = TAILQ_PREV(tbp, buflists, b_vnbufs);
+ TAILQ_INSERT_AFTER(listheadp, tbp, bp, b_vnbufs);
++reassignbufsortbad;
}
} else {