From owner-freebsd-current@FreeBSD.ORG Mon Apr 3 21:04:09 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DEA7F16A400; Mon, 3 Apr 2006 21:04:08 +0000 (UTC) (envelope-from Tor.Egge@cvsup.no.freebsd.org) Received: from pil.idi.ntnu.no (pil.idi.ntnu.no [129.241.107.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id E570243D45; Mon, 3 Apr 2006 21:04:07 +0000 (GMT) (envelope-from Tor.Egge@cvsup.no.freebsd.org) Received: from cvsup.no.freebsd.org (c2h5oh.idi.ntnu.no [129.241.103.69]) by pil.idi.ntnu.no (8.13.6/8.13.1) with ESMTP id k33L44AH016483 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 3 Apr 2006 23:04:04 +0200 (MEST) Received: from localhost (localhost [127.0.0.1]) by cvsup.no.freebsd.org (8.13.4/8.13.4) with ESMTP id k33L433U008673; Mon, 3 Apr 2006 21:04:03 GMT (envelope-from Tor.Egge@cvsup.no.freebsd.org) Date: Mon, 03 Apr 2006 21:04:03 +0000 (UTC) Message-Id: <20060403.210403.74745739.Tor.Egge@cvsup.no.freebsd.org> To: peter@holm.cc From: Tor Egge In-Reply-To: <20060403192808.GA91475@peter.osted.lan> References: <20060402190910.GA12759@peter.osted.lan> <20060402.204851.78799557.Tor.Egge@cvsup.no.freebsd.org> <20060403192808.GA91475@peter.osted.lan> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned-By: mimedefang.idi.ntnu.no, using CLAMD X-SMTP-From: Sender=, Relay/Client=c2h5oh.idi.ntnu.no [129.241.103.69], EHLO=cvsup.no.freebsd.org X-Scanned-By: MIMEDefang 2.48 on 129.241.107.38 X-Scanned-By: mimedefang.idi.ntnu.no, using MIMEDefang 2.48 with local filter 16.42-idi X-Filter-Time: 1 seconds Cc: truckman@freebsd.org, current@freebsd.org Subject: Re: Livelock / softdep_flush "loop" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Apr 2006 21:04:09 -0000 > I ran the same test with your first patch for two hours and your > second patch for 7 hours, without seeing any livelocks. > > I added snapshots to the test and still did not get any livelocks, but > I'm not certain that this last test covers your change. On third thought, the second patch is probably not necessary. The calls to process_worklist_item() with LK_NOWAIT as flags has to be inside regions protected by vn_start_write()/vn_finished_write() or vn_start_secondary_write()/vn_finished_secondary_write() since the calling functions (ffs_alloc(), ffs_realloccg(), newdirrem(), softdep_setup_freeblocks(), softdep_setup_directory_add(), softdep_setup_directory_change(), softdep_change_linkcnt()) involve write operations. I did not take that into account when I had second thoughts about the first patch. vfs_write_suspend() sleeps until noone is inside regions protected by vn_start_write()/vn_finished_write() for that file system before calling VFS_SYNC(). softdep_check_suspend() sleeps until noone is inside regions protected by vn_start_secondary_write()/vn_finished_secondary_write() for that file system. Thus, with the first patch applied, ump->softdep_on_worklist_inprogress will always be zero when softdep_check_suspend() returns. - Tor Egge