Subject: Re: Processes Hanging in a Disk Wait
To: None <current-users@NetBSD.ORG, r.black@ic.ac.uk>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: current-users
Date: 06/11/1996 13:37:29
> Some time ago I know there was a problem with several ports with processes
> occassionally hanging in a disk-wait (in vflushbuf). Does anyone know whether
> this problem was ever resolved?
It wasn't, though I've found one possible cause of this last time it happened
on my sparc (yesterday :-)
Can you please try this patch (which isn't on the release tree yet) and
see what it does for you:
----snip----
Index: vfs_bio.c
===================================================================
RCS file: /a/cvsroot/src/sys/kern/vfs_bio.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -c -r1.43 -r1.44
*** vfs_bio.c 1996/04/22 01:38:59 1.43
--- vfs_bio.c 1996/06/11 11:15:36 1.44
***************
*** 1,4 ****
! /* $NetBSD: vfs_bio.c,v 1.43 1996/04/22 01:38:59 christos Exp $ */
/*-
* Copyright (c) 1994 Christopher G. Demetriou
--- 1,4 ----
! /* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */
/*-
* Copyright (c) 1994 Christopher G. Demetriou
***************
*** 275,281 ****
bwrite(bp)
struct buf *bp;
{
! int rv, sync, wasdelayed;
/*
* Remember buffer type, to switch on it later. If the write was
--- 275,281 ----
bwrite(bp)
struct buf *bp;
{
! int rv, sync, wasdelayed, s;
/*
* Remember buffer type, to switch on it later. If the write was
***************
*** 293,298 ****
--- 293,299 ----
wasdelayed = ISSET(bp->b_flags, B_DELWRI);
CLR(bp->b_flags, (B_READ | B_DONE | B_ERROR | B_DELWRI));
+ s = splbio();
if (!sync) {
/*
* If not synchronous, pay for the I/O operation and make
***************
*** 307,314 ****
}
/* Initiate disk write. Make sure the appropriate party is charged. */
- SET(bp->b_flags, B_WRITEINPROG);
bp->b_vp->v_numoutput++;
VOP_STRATEGY(bp);
if (sync) {
--- 308,316 ----
}
/* Initiate disk write. Make sure the appropriate party is charged. */
bp->b_vp->v_numoutput++;
+ splx(s);
+ SET(bp->b_flags, B_WRITEINPROG);
VOP_STRATEGY(bp);
if (sync) {
***************
*** 322,331 ****
--- 324,335 ----
* make sure it's on the correct vnode queue. (async operatings
* were payed for above.)
*/
+ s = splbio();
if (wasdelayed)
reassignbuf(bp, bp->b_vp);
else
curproc->p_stats->p_ru.ru_oublock++;
+ splx(s);
/* Release the buffer. */
brelse(bp);