From owner-freebsd-current@FreeBSD.ORG Mon Sep 24 16:44:47 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2C6416A419 for ; Mon, 24 Sep 2007 16:44:47 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id D89B513C45D for ; Mon, 24 Sep 2007 16:44:47 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 99086 invoked from network); 24 Sep 2007 16:18:07 -0000 Received: from ppp-71-139-1-224.dsl.snfc21.pacbell.net (HELO ?10.0.0.15?) (nate-mail@71.139.1.224) by root.org with ESMTPA; 24 Sep 2007 16:18:07 -0000 Message-ID: <46F7E19B.3010603@root.org> Date: Mon, 24 Sep 2007 09:11:07 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: John Baldwin References: <200709181516.11207.jkim@FreeBSD.org> <200709211827.29763.jkim@FreeBSD.org> <3bbf2fe10709240237u790de351wddb81b0c511d7435@mail.gmail.com> <200709241155.56926.jhb@freebsd.org> In-Reply-To: <200709241155.56926.jhb@freebsd.org> X-Enigmail-Version: 0.95.3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-acpi@freebsd.org, freebsd-current@freebsd.org, Jung-uk Kim Subject: Re: [PATCH] OsdSynch.c modernization 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, 24 Sep 2007 16:44:48 -0000 John Baldwin wrote: > 2007/9/22, Jung-uk Kim : >> I thought exactly the same when I started rewriting it (almost half >> year ago!). I have tried all of the above, spent numerous sleepless >> nights, and miserably failed. :-( >> >> Spin mutex is too restrictive (e.g., it cannot be used with other >> locks gracefully). critical_enter() causes: >> >> panic: blockable sleep lock (sleep mutex) 32 @ >> /usr/src/sys/vm/uma_core.c:1830 cpuid = 0 >> KDB: enter: panic >> [thread pid 21 tid 100013 ] >> Stopped at kdb_enter+0x32: leave > > However, disabling interrupts while you block on other locks is just as bad, > we just don't assert for it. Better would be to fix ACPI-CA to not try to > malloc() while holding a spin lock. You should be able to see where it is > doing that via the stack trace. If the malloc is using M_NOWAIT you will be > far better off using a plain mutex and just not disabling interrupts. For 7.0, we're going with what we have (sx locks) since it's well-tested and not wrong, maybe just less than optimal. Remember that acpi locks are acquired a few dozen times every 10 seconds or so, so this is not at risk of being a performance issue. I think it's a good idea to work with Bob Moore to improve things on their side as well. Then we can revisit this and clean it up. -- Nate