From owner-cvs-src@FreeBSD.ORG Wed Mar 10 12:41:09 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ABC0D16A4CE; Wed, 10 Mar 2004 12:41:09 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A5A2143D2D; Wed, 10 Mar 2004 12:41:09 -0800 (PST) (envelope-from phk@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i2AKf9Ge061663; Wed, 10 Mar 2004 12:41:09 -0800 (PST) (envelope-from phk@repoman.freebsd.org) Received: (from phk@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i2AKf90l061660; Wed, 10 Mar 2004 12:41:09 -0800 (PST) (envelope-from phk) Message-Id: <200403102041.i2AKf90l061660@repoman.freebsd.org> From: Poul-Henning Kamp Date: Wed, 10 Mar 2004 12:41:09 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/sys mdioctl.h src/sys/dev/md md.c src/sbin/mdconfig mdconfig.8 mdconfig.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Mar 2004 20:41:09 -0000 phk 2004/03/10 12:41:09 PST FreeBSD src repository Modified files: sys/sys mdioctl.h sys/dev/md md.c sbin/mdconfig mdconfig.8 mdconfig.c Log: Fix a long-standing deadlock issue with vnode backed md(4) devices: On vnode backed md(4) devices over a certain, currently undetermined size relative to the buffer cache our "lemming-syncer" can provoke a buffer starvation which puts the md thread to sleep on wdrain. This generally tends to grind the entire system to a stop because the event that is supposed to wake up the thread will not happen until a fair bit of the piled up I/O requests in the system finish, and since a lot of those are on a md(4) vnode backed device which is currently waiting on wdrain until a fair amount of the piled up ... you get the picture. The cure is to issue all VOP_WRITES on the vnode backing the device with IO_SYNC. In addition to more closely emulating a real disk device with a non-lying write-cache, this makes the writes exempt from rate-limited (there to avoid starving the buffer cache) and consequently prevents the deadlock. Unfortunately performance takes a hit. Add "async" option to give people who know what they are doing the old behaviour. Revision Changes Path 1.27 +3 -0 src/sbin/mdconfig/mdconfig.8 1.31 +5 -1 src/sbin/mdconfig/mdconfig.c 1.115 +5 -3 src/sys/dev/md/md.c 1.14 +1 -0 src/sys/sys/mdioctl.h