From owner-freebsd-current@FreeBSD.ORG Sat May 31 00:44:06 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA08F3DF for ; Sat, 31 May 2014 00:44:06 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 97B90209E for ; Sat, 31 May 2014 00:44:06 +0000 (UTC) Received: from u10-2-32-011.office.norse-data.com (unknown [50.204.88.51]) by elvis.mu.org (Postfix) with ESMTPSA id 3D2841A3D4A for ; Fri, 30 May 2014 17:44:00 -0700 (PDT) Message-ID: <538925D5.6020905@mu.org> Date: Fri, 30 May 2014 17:44:05 -0700 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: Re: ipmi patch for review References: <20130917102110.GK4574@glebius.int.ru> <201309191504.46986.jhb@freebsd.org> <20140530174457.GA92246@ambrisko.com> In-Reply-To: <20140530174457.GA92246@ambrisko.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 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: Sat, 31 May 2014 00:44:06 -0000 On 5/30/14, 10:44 AM, Doug Ambrisko wrote: > On Thu, Sep 19, 2013 at 03:04:46PM -0400, John Baldwin wrote: > | On Tuesday, September 17, 2013 6:21:10 am Gleb Smirnoff wrote: > | > Hi! > | > > | > When system is writing a kernel core dump, it issues watchdog > | > pat wdog_kern_pat(WD_LASTVAL). If ipmi is in action, it registers > | > ipmi_wd_event() as event for watchdog. Thus ipmi_wd_event() is > | > called in dumping context. > | > > | > The problem is that ipmi_wd_event() calls into ipmi_set_watchdog(), > | > that calls into ipmi_alloc_request(), which uses M_WAITOK and > | > thus sleeps. This is a smaller problem, since can be converted to > | > M_NOWAIT. But ipmi_set_watchdog() then calls into > | > ipmi_submit_driver_request(), which calls msleep() any time. > | > > | > The attached patch allows me to successfully write cores in > | > presence of IPMI. > | > | Of course, the watchdog might go off during your dump. :) > | > | The real fix is more complicated, which is that we should not use > | a worker thread for at least SMIC and KCS. > > I haven't looked at this patch but I have local code that switches > KCS into polling direct mode when the kernel goes into panic mode. > I use this to write Linux compatible back traces into the system > event logs. This could allow the watchdogd to continue to work. > This should be easily extended to SMIC mode. SMBUS would be > harder but at a prior company I made the SMBIO driver work in polled > mode. > > If someone wants to look at this I can post the changes for KCS and > the kernel backtrace to the system event log. We find this useful > when looking at customer machines. > > IPMI gets upset if things get intermixed/interrupted so there needs > to be serialization and cancellation if being interrupted. > These patches would be really nice to have in base. I noticed this problem too, you can't really touch watchdogs some of the time when in a panic(9) situation and it leaves you in a bad state to stop them or reset them while you are dumping. Thank you for looking at this. -Alfred