From owner-freebsd-current@freebsd.org Wed Mar 10 12:37:49 2021 Return-Path: Delivered-To: freebsd-current@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 E9A925AF9DA for ; Wed, 10 Mar 2021 12:37:49 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4DwWnT4sFjz3Frs for ; Wed, 10 Mar 2021 12:37:49 +0000 (UTC) (envelope-from david@catwhisker.org) Received: by mailman.nyi.freebsd.org (Postfix) id A6BAF5AFA3C; Wed, 10 Mar 2021 12:37:49 +0000 (UTC) Delivered-To: current@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 A68235AF847 for ; Wed, 10 Mar 2021 12:37:49 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mx.catwhisker.org (mx.catwhisker.org [107.204.234.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DwWnT2dDgz3Ffb for ; Wed, 10 Mar 2021 12:37:49 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.16.1/8.15.2) with ESMTP id 12ACbesI083611; Wed, 10 Mar 2021 12:37:40 GMT (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.16.1/8.16.1/Submit) id 12ACbeM1083610; Wed, 10 Mar 2021 04:37:40 -0800 (PST) (envelope-from david) Date: Wed, 10 Mar 2021 04:37:40 -0800 From: David Wolfskill To: Warner Losh Cc: FreeBSD Current Subject: Re: "panic: malloc(M_WAITOK) with sleeping prohibited" at main-n245363-b3dac3913dc9 Message-ID: Mail-Followup-To: David Wolfskill , Warner Losh , FreeBSD Current References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lwHcNMrBwCAXLMBZ" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4DwWnT2dDgz3Ffb X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 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: Wed, 10 Mar 2021 12:37:50 -0000 --lwHcNMrBwCAXLMBZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 09, 2021 at 04:04:56PM -0700, Warner Losh wrote: > On Tue, Mar 9, 2021 at 2:46 PM David Wolfskill wro= te: > ... > > uma_zalloc_debug: zone "malloc-1024"umass0 on uhub2 > > with the following non-sleepable locks held: > > umass0: on usbus0 > > exclusive sleep mutex CAM device lockumass0: SCSI over Bulk-Only; quir= ks > > =3D 0x4000 > > (CAM device lock) r =3D 0 (0xfffff800122c9cd0) locked @ > > /usr/src/sys/cam/cam_xpt.c:2333 > > umass0:6:0: Attached to scbus6 > > stack backtrace: > > (probe0:umass-sim0:0:0:0): Down reving Protocol Version from 2 to 0? > > #0 0xffffffff80c7cce1 at witnesuhub3: 6 ports with 6 removable, self > > powered > > s_debugger+0x71 > > pass6 at umass-sim0 bus 0 scbus6 target 0 lun 0 > > #1 0xffffffff80pass6: uhub4: 8 ports with 8 removable, self powered > > c7ddfd at witness_warn+0x40d > > #2 Removable Direct Access SCSI device > > 0xffffffff80f42fe6 at uma_zallpass6: Serial Number 20100818841300000 > > oc_arg+0x46 > > #3 0xffffffff80be34pass6: 40.000MB/s transfers > > panic: malloc(M_WAITOK) with sleeping prohibited > > cpuid =3D 1 > > time =3D 22 > > KDB: stack backtrace: > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > > 0xfffffe00e157a2d0 > > vpanic() at vpanic+0x181/frame 0xfffffe00e157a320 > > panic() at panic+0x43/frame 0xfffffe00e157a380 > > malloc_dbg() at malloc_dbg+0xd4/frame 0xfffffe00e157a3a0 > > malloc() at malloc+0x34/frame 0xfffffe00e157a400 > > g_post_event_x() at g_post_event_x+0x5a/frame 0xfffffe00e157a450 > > g_post_event() at g_post_event+0x48/frame 0xfffffe00e157a4b0 > > disk_create() at disk_create+0x16f/frame 0xfffffe00e157a600 > > daregister() at daregister+0x70a/frame 0xfffffe00e157a880 > > cam_periph_alloc() at cam_periph_alloc+0x57b/frame 0xfffffe00e157a950 > > daasync() at daasync+0x2c2/frame 0xfffffe00e157a9c0 > > xpt_async_process_dev() at xpt_async_process_dev+0x152/frame > > 0xfffffe00e157aa10 > > xpt_async_process() at xpt_async_process+0x334/frame 0xfffffe00e157ab20 > > xpt_done_process() at xpt_done_process+0x3a3/frame 0xfffffe00e157ab60 > > xpt_done_td() at xpt_done_td+0xf5/frame 0xfffffe00e157abb0 > > fork_exit() at fork_exit+0x80/frame 0xfffffe00e157abf0 > > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00e157abf0 > > --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- > > KDB: enter: panic > > [ thread pid 17 tid 100095 ] > > Stopped at kdb_enter+0x37: movq $0,0x128b8ce(%rip) > > db> > > > I'm willing to "poke at it" a bit, given a hint or two... > > >=20 > OK. I know what's happening here. disk_create() posts an event and also > expects to sleep to get memory. I can fix that too, but then that's one > more 'no memory' hole. >=20 > I'm unsure if we should keep playing whack-a-mole, or just defer this > creation to the taskqueue we already have hanging around... >=20 > Warner > .... Same (build) machine had a similar panic after updating source to main-n245372-d1cbe7908986 & rebuilding. FWIW. Also (as yesterday), neither laptop exhibited a problem after the corresponding update. Peace, david --=20 David H. Wolfskill david@catwhisker.org It is supremely disingenuous to claim a lack of jurisdiction, then =20 proceed to participate in a decision on the same matter. See https://www.catwhisker.org/~david/publickey.gpg for my public key. --lwHcNMrBwCAXLMBZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE4owz2QxMJyaxAefyQLJg+bY2PckFAmBIvZRfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEUy OEMzM0Q5MEM0QzI3MjZCMTAxRTdGMjQwQjI2MEY5QjYzNjNEQzkACgkQQLJg+bY2 PcmSJwf+Pzx9Jg1ANJhLJxtVZAo0bGlrIRXiRKCcEq+5li8ge3K2tVahgwremHB/ UR7Y/FKNcnp3nQVGZtS5mnQ3tX050nVQyCN4JLnLQqLIvdJz7eGtG+dqJLOPAqgb 8OpAW2AlQEFk4VY0+AGbGrec6IvMJRBTaT0PXgfB23N/+N4HB6ruW4ZWzM+94i+r r0jVAGuIBjodLSr50oKpn+jXNXXKKliW9ZT7lbPO+Fwu3Ze7tOg0grCCELu044Pv BBxLNnXfYA925otvrVgW1br5sisWdYtr1Pd2vp/wPduDPAAzHS5YJLFNUhBjQ61w Y9de5+oLe7AqsapiOfoAPVUD7jBZnw== =Cgik -----END PGP SIGNATURE----- --lwHcNMrBwCAXLMBZ--