From owner-freebsd-acpi@FreeBSD.ORG Tue May 18 19:16:06 2010 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 4D462106564A for ; Tue, 18 May 2010 19:16:06 +0000 (UTC) (envelope-from taku@tackymt.homeip.net) Received: from basalt.tackymt.homeip.net (unknown [IPv6:2001:3e0:577:0:20d:61ff:fecc:2253]) by mx1.freebsd.org (Postfix) with ESMTP id CF0498FC24 for ; Tue, 18 May 2010 19:16:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by basalt.tackymt.homeip.net (Postfix) with ESMTP id B7C5B1079D for ; Wed, 19 May 2010 04:16:04 +0900 (JST) X-Virus-Scanned: amavisd-new at tackymt.homeip.net Received: from localhost ([127.0.0.1]) by localhost (basalt.tackymt.homeip.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E0SU7OIvKAa4 for ; Wed, 19 May 2010 04:16:03 +0900 (JST) Received: from basalt.tackymt.homeip.net (basalt.tackymt.homeip.net [IPv6:2001:3e0:577:0:20d:61ff:fecc:2253]) by basalt.tackymt.homeip.net (Postfix) with ESMTP for ; Wed, 19 May 2010 04:16:03 +0900 (JST) Date: Wed, 19 May 2010 04:16:02 +0900 From: Taku YAMAMOTO To: freebsd-acpi@freebsd.org Message-Id: <20100519041602.2ccd714c.taku@tackymt.homeip.net> In-Reply-To: References: <4DEBDE2C-C0D2-469D-AC42-DD5027926424@FreeBSD.org> <1273257226.1671.3.camel@malikania.fr> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.16.6; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Subject: Re: Kernel panic when unpluggin AC adaptor 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: Tue, 18 May 2010 19:16:06 -0000 Is it faster to call sched_bind() temporarily in acpi_cpu_notify() than locking around many places? If we successfully sched_bind() to the subject CPU, I think we're guaranteed that the acpi_cpu_idle() is not running on that CPU. On Tue, 18 May 2010 16:04:07 +0200 Giovanni Trematerra wrote: > On Sat, May 15, 2010 at 9:12 PM, Brandon Gooch > wrote: > > On Thu, May 13, 2010 at 7:25 PM, Giovanni Trematerra > > wrote: > >> On Thu, May 13, 2010 at 1:09 AM, Brandon Gooch > >> wrote: > >>> On Wed, May 12, 2010 at 9:41 AM, Attilio Rao wrote: > >>>> 2010/5/12 David DEMELIER : > >>>>> I remove the patch, and built the kernel (I updated the src this > >>>>> morning) and it does not panic now. It's really odd. If it reappears > >>>>> soon I will tell you. > >>>> > >>>> I looked at the code with Giovanni and I have the feeling that the > >>>> race with the idle thread may still be fatal. > >>>> We need to fix that. > >>>> > >>>> Attilio > >>>> > >>> > >>> That seems to be the case, as my laptop shows about an 80-85 % chance > >>> of experiencing a panic if left idle for long-ish periods of time (2 > >>> to 4 hours). I usually rebuild world or big ports overnight, and more > >>> often than not I wake up to a panicked machine, same situation every > >>> time: > >>> > >>> ... > >>> rman_get_bushandle() at rman_get_bushandle+0x1 > >>> sched_idletd() at sched_idletd+0x123 > >>> fork_exit() at fork_exit+0x12a > >>> fork_trampoline() at fork_trampoline+0xe > >>> ... > >>> > >>> The kernel/userland is rebuilt, the ports are finished compiling -- > >>> it's in the time AFTER the completion of all tasks that the machine > >>> gets bored and tries to kill itself :) > >>> > >>> I have seen the AC adapter plug/unplug "hang" in the past on this > >>> laptop, but I never made the connection between the events, as > >>> nowadays my laptop usually stays plugged in :( > >>> > >>> Attilio, I hope you can track this one down, let me know if I can do > >>> anything to help or test... > >>> > >> > >> Attilio and I came up with this patch. It seems ready for stress > >> testing and review > >> Please test and report back. > >> > >> Thank you > >> > >> P.S: all the faults are only mine. > > > > I tried the patch, and my kernel panics I panic on boot. I have > > 8.5MB(!) of JPG images (6 of them) if anyone needs to see them. I'm > > looking for a place to post them, but if anyone wants, I can send via > > e-mail... > > Hi Brandon, > Could you please, try this new one? The panic at boot stage should be solved, > at least I tried on a 8-way machine and all went ok at boot. > Please, remove WITNESS_SKIPSPIN from your kernel config file. > This patch might be sub-optimal and contains style(9) error but if it > works we are > on the right way. > Let me know if it works for you. > > Thanks > > -- > Gianni > -- -|-__ 山本 拓 / YAMAMOTO, Taku | __ < - A chicken is an egg's way of producing more eggs. -