Date: Tue, 23 Oct 2018 12:20:19 +0300 From: "Andrey V. Elsukov" <bu7cher@yandex.ru> To: Eric Joyner <erj@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339634 - in head/sys: kern net Message-ID: <6536ef10-5749-144d-dbd9-91addd2f38e4@yandex.ru> In-Reply-To: <201810230437.w9N4bTxf050789@repo.freebsd.org> References: <201810230437.w9N4bTxf050789@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fuupesl9eOG2kZuZpK35X7y4hoNR1UUVg Content-Type: multipart/mixed; boundary="PeJZkjwDB9ds7P29gjielr2Tyss0Br2vC"; protected-headers="v1" From: "Andrey V. Elsukov" <bu7cher@yandex.ru> To: Eric Joyner <erj@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <6536ef10-5749-144d-dbd9-91addd2f38e4@yandex.ru> Subject: Re: svn commit: r339634 - in head/sys: kern net References: <201810230437.w9N4bTxf050789@repo.freebsd.org> In-Reply-To: <201810230437.w9N4bTxf050789@repo.freebsd.org> --PeJZkjwDB9ds7P29gjielr2Tyss0Br2vC Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 23.10.2018 07:37, Eric Joyner wrote: > Author: erj > Date: Tue Oct 23 04:37:29 2018 > New Revision: 339634 > URL: https://svnweb.freebsd.org/changeset/base/339634 >=20 > Log: > iflib: drain enqueued tasks before detaching from taskqgroup > =20 > The taskqgroup_detach function does not check if task is already enqu= eued when > detaching it. This may lead to kernel panic if enqueued task starts a= fter > context state lock is destroyed. Ensure that the already enqueued adm= in tasks > are executed before detaching them. > =20 > The issue was discovered during validation of D16429. Unloading of if= _ixlv > followed by immediate removal of VFs with iovctl -D may lead to panic= on > NODEBUG kernel. > =20 > As well, check if iflib is in detach before enqueueing new admin or i= ov > tasks, to prevent new tasks from executing while the taskqgroup tasks= > are being drained. > =20 > Submitted by: Krzysztof Galazka <krzysztof.galazka@intel.com> > Reviewed by: shurd@, erj@ > Sponsored by: Intel Corporation > Differential Revision: https://reviews.freebsd.org/D17404 Hi, with this revision my system panics at boot. Reverting only this revision helps. % pciconf -l | grep ^em em0@pci0:0:25:0: class=3D0x020000 card=3D0x20088086 chip=3D0x15028086 rev= =3D0x04 hdr=3D0x00 <6>lo0: link state changed to UP panic: mtx_lock() by idle thread 0xfffff800035eb000 on sleep mutex em0 @ /home/devel/freebsd/base/head/sys/net/iflib.c:2084 cpuid =3D 2 time =3D 1540283649 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0077964610 vpanic() at vpanic+0x1a3/frame 0xfffffe0077964670 panic() at panic+0x43/frame 0xfffffe00779646d0 __mtx_lock_flags() at __mtx_lock_flags+0x15a/frame 0xfffffe0077964720 iflib_admin_intr_deferred() at iflib_admin_intr_deferred+0x2a/frame 0xfffffe0077964750 em_intr() at em_intr+0x72/frame 0xfffffe0077964780 iflib_fast_intr_ctx() at iflib_fast_intr_ctx+0x21/frame 0xfffffe00779647a= 0 intr_event_handle() at intr_event_handle+0xbb/frame 0xfffffe00779647f0 intr_execute_handlers() at intr_execute_handlers+0x58/frame 0xfffffe0077964820 lapic_handle_intr() at lapic_handle_intr+0x5f/frame 0xfffffe0077964840 Xapic_isr1() at Xapic_isr1+0xd9/frame 0xfffffe0077964840 --- interrupt, rip =3D 0xffffffff811dfab6, rsp =3D 0xfffffe0077964910, rb= p =3D 0xfffffe0077964910 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe0077964910 acpi_cpu_idle() at acpi_cpu_idle+0x23d/frame 0xfffffe0077964960 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe0077964980 cpu_idle() at cpu_idle+0xa7/frame 0xfffffe00779649a0 sched_idletd() at sched_idletd+0x517/frame 0xfffffe0077964a70 fork_exit() at fork_exit+0x84/frame 0xfffffe0077964ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0077964ab0 --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- KDB: enter: panic __curthread () at ./machine/pcpu.h:230 230 __asm("movq %%gs:%P1,%0" : "=3Dr" (td) : "n" (OFFSETOF_CURTHREAD)); (kgdb) #0 __curthread () at ./machine/pcpu.h:230 #1 doadump (textdump=3D1) at /home/devel/freebsd/base/head/sys/kern/kern_shutdown.c:366 #2 0xffffffff8046586c in db_fncall_generic (addr=3D<optimized out>, rv=3D<optimized out>, nargs=3D<optimized out>, args=3D<optimized out>= ) at /home/devel/freebsd/base/head/sys/ddb/db_command.c:609 #3 db_fncall (dummy1=3D<optimized out>, dummy2=3D<optimized out>, dummy3=3D<optimized out>, dummy4=3D<optimized out>) at /home/devel/freebsd/base/head/sys/ddb/db_command.c:657 #4 0xffffffff804653a9 in db_command (last_cmdp=3D<optimized out>, cmd_table=3D<optimized out>, dopager=3D<optimized out>) at /home/devel/freebsd/base/head/sys/ddb/db_command.c:481 #5 0xffffffff80465124 in db_command_loop () at /home/devel/freebsd/base/head/sys/ddb/db_command.c:534 #6 0xffffffff8046833f in db_trap (type=3D<optimized out>, code=3D<optimi= zed out>) at /home/devel/freebsd/base/head/sys/ddb/db_main.c:252 #7 0xffffffff80be69a7 in kdb_trap (type=3D3, code=3D0, tf=3D0xfffffe0077= 964540) at /home/devel/freebsd/base/head/sys/kern/subr_kdb.c:693 #8 0xffffffff81073be6 in trap (frame=3D0xfffffe0077964540) at /home/devel/freebsd/base/head/sys/amd64/amd64/trap.c:619 #9 <signal handler called> #10 kdb_enter (why=3D0xffffffff81309de7 "panic", msg=3D<optimized out>) at /home/devel/freebsd/base/head/sys/kern/subr_kdb.c:479 #11 0xffffffff80b9e670 in vpanic (fmt=3D<optimized out>, ap=3D0xfffffe00779646b0) at /home/devel/freebsd/base/head/sys/kern/kern_shutdown.c:861 #12 0xffffffff80b9e413 in panic ( fmt=3D0xffffffff81e8e1a8 <cnputs_mtx> "g\344,\201\377\377\377\377") at /home/devel/freebsd/base/head/sys/kern/kern_shutdown.c:799 #13 0xffffffff80b7d85a in __mtx_lock_flags (c=3D0xfffff800039cc598, opts=3D<optimized out>, file=3D0xffffffff8134fa4e "/home/devel/freebsd/base/head/sys/net/iflib.c", line=3D2084) at /home/devel/freebsd/base/head/sys/kern/kern_mutex.c:2= 40 #14 0xffffffff80cb968a in iflib_in_detach (ctx=3D0xfffff800039cc400) at /home/devel/freebsd/base/head/sys/net/iflib.c:2084 #15 iflib_admin_intr_deferred (ctx=3D0xfffff800039cc400) at /home/devel/freebsd/base/head/sys/net/iflib.c:5977 #16 0xffffffff805d7382 in em_intr (arg=3D0xfffffe0000665000) at /home/devel/freebsd/base/head/sys/dev/e1000/if_em.c:1361 #17 0xffffffff80cb8831 in iflib_fast_intr_ctx (arg=3D<optimized out>) at /home/devel/freebsd/base/head/sys/net/iflib.c:1549 #18 0xffffffff80b60f8b in intr_event_handle (ie=3D0xfffff80003980700, frame=3D0xfffffe0077964850) at /home/devel/freebsd/base/head/sys/kern/kern_intr.c:1225 #19 0xffffffff811e3208 in intr_execute_handlers (isrc=3D0xfffff8000396af0= 0, frame=3D0xfffffe0077964850) at /home/devel/freebsd/base/head/sys/x86/x86/intr_machdep.c:358 #20 0xffffffff811e929f in lapic_handle_intr (vector=3D<optimized out>, frame=3D0xfffffe0077964850) at /home/devel/freebsd/base/head/sys/x86/x86/local_apic.c:1293 #21 <signal handler called> #22 acpi_cpu_c1 () at /home/devel/freebsd/base/head/sys/x86/x86/cpu_machdep.c:140 #23 0xffffffff80489cad in acpi_cpu_idle (sbt=3D<optimized out>) at /home/devel/freebsd/base/head/sys/dev/acpica/acpi_cpu.c:1187 #24 0xffffffff811e00cf in cpu_idle_acpi (sbt=3D1792802261) at /home/devel/freebsd/base/head/sys/x86/x86/cpu_machdep.c:433 #25 0xffffffff811e0187 in cpu_idle (busy=3D0) at /home/devel/freebsd/base/head/sys/x86/x86/cpu_machdep.c:581 #26 0xffffffff80bce5c7 in sched_idletd (dummy=3D<optimized out>) at /home/devel/freebsd/base/head/sys/kern/sched_ule.c:2829 #27 0xffffffff80b5e574 in fork_exit ( callout=3D0xffffffff80bce0b0 <sched_idletd>, arg=3D0x0, frame=3D0xfffffe0077964ac0) at /home/devel/freebsd/base/head/sys/kern/kern_fork.c:1057 #28 <signal handler called> (kgdb) --=20 WBR, Andrey V. Elsukov --PeJZkjwDB9ds7P29gjielr2Tyss0Br2vC-- --fuupesl9eOG2kZuZpK35X7y4hoNR1UUVg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlvO59MACgkQAcXqBBDI oXoElggAhtfF6OfDdjTPM8XmpNqB/G+GknoBjbEDzJtIcS7y2zqw3wO4+VB6CELj jL1e6AAs53BD5qHn0emO0bjfFi92+fbgk7P7/txFfdNDlYWjnasOxbeSmX1ZStk3 6jMj53eK7HDnfJhZnuTM9JOBndvxXWK/QQl37u4P1cIkcvxIU1dZcgkhCMBHYxov SZhBckTrg+SLmU5X2hp+gi412yMYdOHoHaHzwLfDnpyOCtc7uj5AkFZpfOIV/icK Fu7pSWcLg11HwgvEKBq3/8IPzI2m9lUSSg+HzE39lNeWI0b+j1e5XzZoa0bMP2wd LESHY2A71E3D5+xedXaNWqiHZr5jxw== =e8jM -----END PGP SIGNATURE----- --fuupesl9eOG2kZuZpK35X7y4hoNR1UUVg--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6536ef10-5749-144d-dbd9-91addd2f38e4>