From owner-freebsd-current@FreeBSD.ORG Tue Jan 18 18:08:44 2005 Return-Path: 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 9F1A916A4DD for ; Tue, 18 Jan 2005 18:08:44 +0000 (GMT) Received: from mail15.speakeasy.net (mail23.sea5.speakeasy.net [69.17.117.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 45A3843D58 for ; Tue, 18 Jan 2005 18:08:44 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 28230 invoked from network); 18 Jan 2005 18:08:44 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 18 Jan 2005 18:08:43 -0000 Received: from [10.50.40.202] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id j0II8W6K097728; Tue, 18 Jan 2005 13:08:39 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: freebsd-current@FreeBSD.org Date: Tue, 18 Jan 2005 11:24:19 -0500 User-Agent: KMail/1.6.2 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200501181124.19323.jhb@FreeBSD.org> X-Spam-Status: No, score=-102.8 required=4.2 tests=ALL_TRUSTED, USER_IN_WHITELIST autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx cc: "Bjoern A. Zeeb" cc: FreeBSD current mailing list Subject: Re: LOR: kern_descrip.c:2277,2278 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Tue, 18 Jan 2005 18:08:45 -0000 On Monday 17 January 2005 05:07 pm, Bjoern A. Zeeb wrote: > Hi, > > I have added the following as LOR #055 to "the LOR page"[1]. > > lock order reversal > 1st 0xffffffff80c3a9e8 sleep mtxpool (sleep mtxpool) @ > sys/kern/kern_descrip.c:2277 2nd 0xffffff00222d8a48 filedesc structure > (filedesc structure) @ sys/kern/kern_descrip.c:2278 KDB: stack backtrace: > witness_checkorder() at witness_checkorder+0x5f1 > _mtx_lock_flags() at _mtx_lock_flags+0x4a > dupfdopen() at dupfdopen+0x320 > kern_open() at kern_open+0x5de > syscall() at syscall+0x4ab > Xfast_syscall() at Xfast_syscall+0xa8 > --- syscall (5, FreeBSD ELF64, open), rip = 0x80077e7d0, rsp = > 0x7fffffffe6f8, rbp = 0x7fffffffec70 --- > > I can easily reproduce it every boot. It seems to be triggered by > Capi4BSD[2] framework which I incorporated in my private tree. > > Can someone please comment on this ? The problem is that FILEDESC_UNLOCK() actually includes an entirely separate lock of its own (it's like an sx lock sort of). One possible fix might be to change struct file to either use a dedicated mutex pool (instead of the more generic mtxpool_sleep one that is intended only for leaf-lock usage) or to have each struct file include its own mutex rather than using a pool lock. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org