From owner-freebsd-current@FreeBSD.ORG Fri May 30 17:45:04 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C301DD1; Fri, 30 May 2014 17:45:04 +0000 (UTC) Received: from mail.ambrisko.com (mail.ambrisko.com [70.91.206.90]) by mx1.freebsd.org (Postfix) with ESMTP id 9CBC12F09; Fri, 30 May 2014 17:45:04 +0000 (UTC) X-Ambrisko-Me: Yes Received: from server2.ambrisko.com (HELO internal.ambrisko.com) ([192.168.1.2]) by ironport.ambrisko.com with ESMTP; 30 May 2014 10:49:56 -0700 Received: from ambrisko.com (localhost [127.0.0.1]) by internal.ambrisko.com (8.14.4/8.14.4) with ESMTP id s4UHiwVe098518; Fri, 30 May 2014 10:44:58 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.14.4/8.14.4/Submit) id s4UHiwSf098517; Fri, 30 May 2014 10:44:58 -0700 (PDT) (envelope-from ambrisko) Date: Fri, 30 May 2014 10:44:58 -0700 From: Doug Ambrisko To: John Baldwin Subject: Re: ipmi patch for review Message-ID: <20140530174457.GA92246@ambrisko.com> References: <20130917102110.GK4574@glebius.int.ru> <201309191504.46986.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201309191504.46986.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-current@freebsd.org, Gleb Smirnoff 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: Fri, 30 May 2014 17:45:04 -0000 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. Thanks, Doug A.