From owner-freebsd-current Thu Nov 1 0:21:41 2001 Delivered-To: freebsd-current@freebsd.org Received: from birch.ripe.net (birch.ripe.net [193.0.1.96]) by hub.freebsd.org (Postfix) with ESMTP id 611FC37B621 for ; Thu, 1 Nov 2001 00:21:19 -0800 (PST) Received: from laptop.6bone.nl (penguin.ripe.net [193.0.1.232]) by birch.ripe.net (8.11.6/8.11.6) with SMTP id fA18LIq01224 for ; Thu, 1 Nov 2001 09:21:18 +0100 Received: (nullmailer pid 925 invoked by uid 1000); Thu, 01 Nov 2001 08:21:18 -0000 Date: Thu, 1 Nov 2001 09:21:18 +0100 From: Mark Santcroos To: current@freebsd.org Subject: buf_daemon() lockup Message-ID: <20011101092118.A434@laptop.6bone.nl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="uQr8t48UFsdbeI+V" Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Handles: MS6-6BONE, MS18417-RIPE 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 --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