diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2013-07-30 17:07:57 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2013-07-30 17:07:57 +0000 |
commit | 925cf8201e88da41fe6565b8ab024ab63a336828 (patch) | |
tree | d7982cf21766d65fbec1193d6340511fec2ab411 /sys/kern | |
parent | 3cf6f5f52738b142dc09e7306a8f2f52f9d0dd05 (diff) |
The previous change was made while chasing nfs performance issues
on Theo's servers - however this was in the context of the buffer flipper
changes and this is now suspect in a continues performance issue with NFS
so back it out for now
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_subr.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 80ed5b40172..2f2699424b1 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.204 2013/06/24 18:52:37 beck Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.205 2013/07/30 17:07:56 beck Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -1820,7 +1820,6 @@ vinvalbuf(struct vnode *vp, int flags, struct ucred *cred, struct proc *p, panic("vinvalbuf(): vp isn't locked"); #endif -loop: if (flags & V_SAVE) { s = splbio(); vwaitforio(vp, 0, "vinvalbuf", 0); @@ -1835,6 +1834,7 @@ loop: } splx(s); } +loop: s = splbio(); for (;;) { if ((blist = LIST_FIRST(&vp->v_cleanblkhd)) && @@ -1857,13 +1857,24 @@ loop: bp->b_flags |= B_WANTED; error = tsleep(bp, slpflag | (PRIBIO + 1), "vinvalbuf", slptimeo); - splx(s); if (error) { + splx(s); return (error); } - goto loop; + break; } bremfree(bp); + /* + * XXX Since there are no node locks for NFS, I believe + * there is a slight chance that a delayed write will + * occur while sleeping just above, so check for it. + */ + if ((bp->b_flags & B_DELWRI) && (flags & V_SAVE)) { + buf_acquire(bp); + splx(s); + (void) VOP_BWRITE(bp); + goto loop; + } buf_acquire_nomap(bp); bp->b_flags |= B_INVAL; brelse(bp); |