Date: Mon, 13 Dec 2021 11:56:35 -0800 From: John Baldwin <jhb@FreeBSD.org> To: Gleb Smirnoff <glebius@freebsd.org> Cc: "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>, x11@freebsd.org Subject: Re: smr inp breaks some jail use cases and panics with i915kms don't switch to the console anymore Message-ID: <836761df-6eea-462b-9ae7-5d0d00aad38f@FreeBSD.org> In-Reply-To: <YbeEbgxJ5Vpg/hYe@cell.glebi.us> References: <1db0942e-0e66-4337-ce2f-4e1005107435@FreeBSD.org> <YbeEbgxJ5Vpg/hYe@cell.glebi.us>
next in thread | previous in thread | raw e-mail | index | archive | help
On 12/13/21 9:35 AM, Gleb Smirnoff wrote: > Hi John, > > On Mon, Dec 13, 2021 at 07:45:07AM -0800, John Baldwin wrote: > J> So there are two things here. The root issue is that the devel/apr1 port > J> runs a configure test for TCP_NDELAY being inherited by accepted sockets. > J> This test panics because prison_check_ip4() tries to lock a prison mutex > J> to walk the IPs assigned to a jail, but the caller (in_pcblookup_hash()) has > J> done an smr_enter() which is a critical_enter(): > > The first one is known, and I got a patch to fix it: > > https://reviews.freebsd.org/D33340 > > However, a pre-requisite to this simple patch is more complex: > > https://reviews.freebsd.org/D33339 > > There is some discussion on how to improve that, and I decided to do that > rather than stick to original version. So I takes a few extra days. > > We could push D33340 into main, if the negative effects (raciness of > the prison check) is considered lesser evil then potentially contested > mtx_lock in smr section. I think raciness is probably better than always panicking as it does today. > J> However, it was a bit harder to see this originally as the 915kms driver > J> tries to do a malloc(M_WAITOK) from cn_grab() when entering DDB which > J> recursively panics (even a malloc(M_NOWAIT) from cn_grab() is probably a > J> bad idea). When it panicked in X the result was that the screen just froze > J> on whatever it had most recently drawn and the machine looked hung. (The > J> fact that that sysbeep is off so I couldn't tell if typing in commands was > J> doing anything vs emitting errors probably didn't improve trying to diagnose > J> the hang as "sitting in ddb" initially, though I don't know if DDB itself > J> emits a beep for invalid commands, etc.) > > Didn't know about this one. Is this isolated to actually entering DDB or > there is some path that in a normal inpcb lookup we would M_WAITOK? This is in the drm(4) driver, nothing to do with in_pcb, just made it harder to see the in_pcb issue. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?836761df-6eea-462b-9ae7-5d0d00aad38f>