From owner-freebsd-current Sun Nov 4 14:59:33 2001 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id B746C37B417 for ; Sun, 4 Nov 2001 14:59:30 -0800 (PST) Received: (from dillon@localhost) by apollo.backplane.com (8.11.6/8.9.1) id fA4MxSc93566; Sun, 4 Nov 2001 14:59:28 -0800 (PST) (envelope-from dillon) Date: Sun, 4 Nov 2001 14:59:28 -0800 (PST) From: Matthew Dillon Message-Id: <200111042259.fA4MxSc93566@apollo.backplane.com> To: Mark Santcroos Cc: current@FreeBSD.ORG Subject: Re: buf_daemon() lockup References: <20011101092118.A434@laptop.6bone.nl> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hmm. Well, bufdaemon is doing the right thing by blocking in that loop. The problem appears to be related to the double-I/O that is occuring due to the way MD filesystems work. A vnode-backed MD takes a strategy call and turns around and issues a high-level filesystem write. This can deadlock the system in wdrain. I'll take a look at it. I think the easiest thing to do is to simply convert the async writes into synchronous writes when we hit the I/O pipe limit, rather then blocking. -Matt Matthew Dillon :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; : } : } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message