panic: sleeping in an epoch section

Gleb Smirnoff glebius at freebsd.org
Wed Oct 9 15:08:02 UTC 2019


On Wed, Oct 09, 2019 at 10:47:04AM -0400, Mark Johnston wrote:
M> On Wed, Oct 09, 2019 at 04:18:34PM +0200, Hans Petter Selasky wrote:
M> > On 2019-10-09 15:56, Mark Johnston wrote:
M> > > On Wed, Oct 09, 2019 at 10:40:04AM +0200, Hans Petter Selasky wrote:
M> > >> On 2019-10-09 06:36, Yuri Pankov wrote:
M> > >>> Tried updating from r353072 to r353334 and getting the following panic
M> > >>> reproducibly on boot (starting dhclient?):
M> > >>>
M> > >>> panic: sleeping in an epoch section
M> > >>> cpuid = 5
M> > >>> time = 1570591558
M> > >>> KDB: stack backtrace:
M> > >>> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame
M> > >>> 0xfffffe00af780140
M> > >>> vpanic() at vpanic+0x19d/frame 0xfffffe00af780190
M> > >>> panic() at panic+0x43/frame 0xfffffe00af7801f0
M> > >>> _sleep() at _sleep+0x463/frame 0xfffffe00af780290
M> > >>> pause_sbt() at pause_sbt+0x10f/frame 0xfffffe00af7802d0
M> > >>> e1000_write_phy_reg_mdic() at e1000_write_phy_reg_mdic+0xee/frame
M> > >>> 0xfffffe00af780310
M> > >>> e1000_enable_phy_wakeup_reg_access_bm() at
M> > >>> e1000_enable_phy_wakeup_reg_access_bm+0x2b/frame 0xfffffe00af780330
M> > >>> e1000_update_mc_addr_list_pch2lan() at
M> > >>> e1000_update_mc_addr_list_pch2lan+0x3a/frame 0xfffffe00af780370
M> > >>> em_if_multi_set() at em_if_multi_set+0x1d4/frame 0xfffffe00af7803c0
M> > >>> iflib_if_ioctl() at iflib_if_ioctl+0x100/frame 0xfffffe00af780430
M> > >>> if_addmulti() at if_addmulti+0x2af/frame 0xfffffe00af7804d0
M> > >>> in_joingroup_locked() at in_joingroup_locked+0x235/frame 0xfffffe00af780570
M> > >>> in_joingroup() at in_joingroup+0x5c/frame 0xfffffe00af7805d0
M> > >>> in_control() at in_control+0xadf/frame 0xfffffe00af780680
M> > >>> ifioctl() at ifioctl+0x40f/frame 0xfffffe00af780750
M> > >>> kern_ioctl() at kern_ioctl+0x295/frame 0xfffffe00af7807b0
M> > >>> sys_ioctl() at sys_ioctl+0x15d/frame 0xfffffe00af780880
M> > >>> amd64_syscall() at amd64_syscall+0x2b9/frame 0xfffffe00af7809b0
M> > >>> fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe00af7809b0
M> > >>> --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x80048051a, rsp =
M> > >>> 0x7fffffffe3e8, rbp = 0x7fffffffe430 ---
M> > >>
M> > >> The SIOCADDMULTI if_ioctl() is not allowed to sleep, because it can be
M> > >> called from the fast-path, so this is a bug in e1000 driver. Does the
M> > >> attached patch workaround the issue?
M> > > 
M> > > What fast path are you referring to?  The locking protocol used by the
M> > > multicast code was changed specifically to allow for sleeps in driver
M> > > ioctl handlers.
M> > 
M> > I recall a long time ago seeing that input packet processing may end up 
M> > calling if_ioctl's . Things may have changed since then though.
M> 
M> That may be true in general, but I can't see any instances of that
M> for SIOCADDMULTI or SIOCDELMULTI.  I think we should always permit ioctl
M> handlers to sleep.  In particular, the panic reported above is a bug in
M> r353292.

Yes, I we should allow sleep in ifioctl handlers. So this is my fault, I'll
handle it today.

-- 
Gleb Smirnoff


More information about the freebsd-net mailing list