From owner-freebsd-current@FreeBSD.ORG Wed Sep 28 07:26:41 2005 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 2881416A41F for ; Wed, 28 Sep 2005 07:26:41 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id B94B843D49 for ; Wed, 28 Sep 2005 07:26:40 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id j8S7QX2V000750 for ; Wed, 28 Sep 2005 00:26:37 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200509280726.j8S7QX2V000750@gw.catspoiler.org> Date: Wed, 28 Sep 2005 00:26:33 -0700 (PDT) From: Don Lewis To: current@FreeBSD.org In-Reply-To: <200509280609.j8S68vZ3000590@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: Subject: Re: analysis of snapshot-related system deadlock 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: Wed, 28 Sep 2005 07:26:41 -0000 On 27 Sep, Don Lewis wrote: > Probably the easiest fix would be to call runningbufwakeup() from > ffs_copyonwrite() before grabbing "snaplk", and increase runningbufspace > again before returning from ffs_copyonwrite(). The bufs waiting for > "snaplk" aren't yet async writes currently running, to borrow from the > comment on waitrunningbufspace(). Sleeping on "wdrain" is probably also undesirable if a thread holds "snaplk" because of the potential impact on the activity of other threads. A possible fix would be for bufwrite() to skip the call to waitrunningbufspace() if the thread holds "snaplk". This might cause problems with queuing an excessive amount of I/O, but I don't think so because the outer bufwrite() will still call waitrunningbufspace().