Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Nov 2001 09:21:18 +0100
From:      Mark Santcroos <marks@ripe.net>
To:        current@freebsd.org
Subject:   buf_daemon() lockup
Message-ID:  <20011101092118.A434@laptop.6bone.nl>

next in thread | raw e-mail | index | archive | help

--uQr8t48UFsdbeI+V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

I have an easy to reproduce case where my system goes into a blocking
sleep.

# mdconfig -a -t vnode -f largefile -u 0
# newfs /dev/md0c
# mount /dev/md0c /mnt
# cd /mnt
# cp -prv /boot .
[ runs for a while and then stops ]

While breaking into ddb I see that "cp", and "bufdaemon" are asleep with 
"wdrain".

To my understanding, bufdaemon is the thread that takes care of flushing
out the buffers. But as it is put to a blocking sleep, it will never get
out of this.

A quick (and dirty) fix of it is attached. It doesnt put bufdaemon to wait
for buffers to flush. But probably this needs to be done in a different
way. (Like not calling waitrunningbufspace() from buf_daemon())

If it can be pointed out in which direction this should be solved I can 
work it out further.

Thanks

Mark

-- 
Mark Santcroos				RIPE Network Coordination Centre
http://www.ripe.net/home/mark/		New Projects Group/TTM

--uQr8t48UFsdbeI+V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="vfs_bio.patch"

--- vfs_bio.c.orig	Thu Nov  1 08:31:30 2001
+++ vfs_bio.c	Thu Nov  1 08:30:36 2001
@@ -270,7 +270,10 @@
 {
 	while (runningbufspace > hirunningspace) {
 		++runningbufreq;
+		if(curthread->td_proc->p_pid!=5)
 			tsleep(&runningbufreq, PVM, "wdrain", 0);
+		else
+			break;
 	}
 }
 

--uQr8t48UFsdbeI+V--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011101092118.A434>