From owner-freebsd-net@freebsd.org Wed Oct 9 14:57:40 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A20114E473 for ; Wed, 9 Oct 2019 14:57:40 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46pHPv6PvPz4Xc3; Wed, 9 Oct 2019 14:57:39 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (mh0.gentlemail.de [IPv6:2a00:e10:2800::a135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id x99EvUrw004421; Wed, 9 Oct 2019 16:57:30 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id B743C3C3; Wed, 9 Oct 2019 16:57:30 +0200 (CEST) Subject: Re: panic: sleeping in an epoch section To: Mark Johnston , Hans Petter Selasky Cc: freebsd-net References: <86cc5d82-50d0-93eb-5900-54e8b0032a08@yuripv.net> <050ba95e-d0d5-dd1a-db6f-9a5c07142efe@selasky.org> <20191009135616.GC66126@raichu> <20191009144704.GD66126@raichu> From: Harry Schmalzbauer Organization: OmniLAN Message-ID: Date: Wed, 9 Oct 2019 16:57:30 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20191009144704.GD66126@raichu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]); Wed, 09 Oct 2019 16:57:31 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: ; Sender-helo: mh0.gentlemail.de; ) X-Rspamd-Queue-Id: 46pHPv6PvPz4Xc3 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Oct 2019 14:57:40 -0000 Am 09.10.2019 um 16:47 schrieb Mark Johnston: > On Wed, Oct 09, 2019 at 04:18:34PM +0200, Hans Petter Selasky wrote: >> On 2019-10-09 15:56, Mark Johnston wrote: >>> On Wed, Oct 09, 2019 at 10:40:04AM +0200, Hans Petter Selasky wrote: >>>> On 2019-10-09 06:36, Yuri Pankov wrote: >>>>> Tried updating from r353072 to r353334 and getting the following panic >>>>> reproducibly on boot (starting dhclient?): >>>>> >>>>> panic: sleeping in an epoch section >>>>> cpuid = 5 >>>>> time = 1570591558 >>>>> KDB: stack backtrace: >>>>> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >>>>> 0xfffffe00af780140 >>>>> vpanic() at vpanic+0x19d/frame 0xfffffe00af780190 >>>>> panic() at panic+0x43/frame 0xfffffe00af7801f0 >>>>> _sleep() at _sleep+0x463/frame 0xfffffe00af780290 >>>>> pause_sbt() at pause_sbt+0x10f/frame 0xfffffe00af7802d0 >>>>> e1000_write_phy_reg_mdic() at e1000_write_phy_reg_mdic+0xee/frame >>>>> 0xfffffe00af780310 >>>>> e1000_enable_phy_wakeup_reg_access_bm() at >>>>> e1000_enable_phy_wakeup_reg_access_bm+0x2b/frame 0xfffffe00af780330 >>>>> e1000_update_mc_addr_list_pch2lan() at >>>>> e1000_update_mc_addr_list_pch2lan+0x3a/frame 0xfffffe00af780370 >>>>> em_if_multi_set() at em_if_multi_set+0x1d4/frame 0xfffffe00af7803c0 >>>>> iflib_if_ioctl() at iflib_if_ioctl+0x100/frame 0xfffffe00af780430 >>>>> if_addmulti() at if_addmulti+0x2af/frame 0xfffffe00af7804d0 >>>>> in_joingroup_locked() at in_joingroup_locked+0x235/frame 0xfffffe00af780570 >>>>> in_joingroup() at in_joingroup+0x5c/frame 0xfffffe00af7805d0 >>>>> in_control() at in_control+0xadf/frame 0xfffffe00af780680 >>>>> ifioctl() at ifioctl+0x40f/frame 0xfffffe00af780750 >>>>> kern_ioctl() at kern_ioctl+0x295/frame 0xfffffe00af7807b0 >>>>> sys_ioctl() at sys_ioctl+0x15d/frame 0xfffffe00af780880 >>>>> amd64_syscall() at amd64_syscall+0x2b9/frame 0xfffffe00af7809b0 >>>>> fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe00af7809b0 >>>>> --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x80048051a, rsp = >>>>> 0x7fffffffe3e8, rbp = 0x7fffffffe430 --- >>>> The SIOCADDMULTI if_ioctl() is not allowed to sleep, because it can be >>>> called from the fast-path, so this is a bug in e1000 driver. Does the >>>> attached patch workaround the issue? >>> What fast path are you referring to? The locking protocol used by the >>> multicast code was changed specifically to allow for sleeps in driver >>> ioctl handlers. >> I recall a long time ago seeing that input packet processing may end up >> calling if_ioctl's . Things may have changed since then though. > That may be true in general, but I can't see any instances of that > for SIOCADDMULTI or SIOCDELMULTI. I think we should always permit ioctl > handlers to sleep. In particular, the panic reported above is a bug in > r353292. Hope you don't ming hijacking your attention to something problably related, but definitely not to r353292: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240609 Thanks, -harry