From owner-freebsd-acpi@FreeBSD.ORG Mon Sep 24 10:03:07 2007 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BE7D16A417 for ; Mon, 24 Sep 2007 10:03:07 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by mx1.freebsd.org (Postfix) with ESMTP id 9FAD413C447 for ; Mon, 24 Sep 2007 10:03:06 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so1130355nfb for ; Mon, 24 Sep 2007 03:03:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=Ylssh0EMARYeob2AjOQRB2XdhvYCVAkGN/UAV7nt3Ec=; b=X2adjFmVOXiAuqhvAWcA2z1pesh/jV5Un4dejXgmKXUqkMqMzWQD/EQsiq0z89zc6keNYox7Gq1Ky6al0Us6MLwKK8SI+s7EXoHbpvILFptByoXz/rVDXRuaZTM3ZouVqP/odgtKIyyXb1m/ECoX9Tfs4+OIspwPsrQf+ljVTZY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=poQbzY1ZJqt/LtGCchQ4D8z9xynYTL9zeP23bpvywYwsRkJBLE9WVofNW6htZR2czHFtOlKznuQfCpNoQraWYzQcGR+c/QbDctupAyXBe0vIDp2cfm+G3z7izp7lYlOlmi9akYgdq1ZisGU0u1RfiE4gvbY9CKVV2chL2Ztbunk= Received: by 10.78.165.16 with SMTP id n16mr1524628hue.1190626652049; Mon, 24 Sep 2007 02:37:32 -0700 (PDT) Received: by 10.78.97.18 with HTTP; Mon, 24 Sep 2007 02:37:31 -0700 (PDT) Message-ID: <3bbf2fe10709240237u790de351wddb81b0c511d7435@mail.gmail.com> Date: Mon, 24 Sep 2007 11:37:31 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Jung-uk Kim" In-Reply-To: <200709211827.29763.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200709181516.11207.jkim@FreeBSD.org> <200709211715.17940.jhb@freebsd.org> <200709211827.29763.jkim@FreeBSD.org> X-Google-Sender-Auth: 6126d98f5bb3ab44 Cc: freebsd-acpi@freebsd.org, freebsd-current@freebsd.org Subject: Re: [PATCH] OsdSynch.c modernization X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Sep 2007 10:03:07 -0000 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 UMA uses its own internal locking scheme which includes blocking mutexes so you cannot maintain a spinlock over its functions. You can however use a blocking mutex instead than a sx lock, that with the help of adaptive spinning emulates a lot better spinlocks behaviour. Attilio -- Peace can only be achieved by understanding - A. Einstein