From nobody Sat May 16 09:47:12 2026 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gHfNy24qqz6dHwC for ; Sat, 16 May 2026 09:47:14 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gHfNy0xhMz3y0t; Sat, 16 May 2026 09:47:14 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778924834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4hnl7PLsn3cuWoWfrvVcgFEONYjlWHW7GmxGnQJh4OA=; b=YLO3OnK+B9i8tpVrNn/6v+L+XJi2kprsMC45/UY+UXF5LSzWBoK1fiAFOwpXypqlmYRY50 XeJ+dUQx97FdkN56iwsJykb554lQDVHxEGOgPojcNztFcDjNNPpDvXppGWGZDnY5h1M8oG 8ify0e6ZoNPqCvtVO0339CnB1B+DbtRZ1rM5ZtJoXsxgT7e3xsJdfepsN/QiZjZebaQ7KM 4Xx46O4VcJtkqrlqW8I8NiDEoICZyZo8kBEnZcGvse4ChUn5vs1gYdC0N4zdE/q11B7hdE 7J8TJquC/8Sn1/HpoC3EZ7Bkc8OWsTfvjAcwcYAQzmBAjmZXq4rNDFrVwevhow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778924834; a=rsa-sha256; cv=none; b=U9FgJb549kQvegUxFbx1GidiF3Er9+T7MMkM/IA127+TKrjT5hyuDBcUOh3pUTDj9AkNaX tT7OVZKAR5SD5dylSF2JYi5tkRTUmietuzMcvaqXLrR8Ptd9DKuwfnvsiqdXcSAVkj7mgK 6PDWRRaz8aldNtqEf8CxY2VUkGML2+FWrBWoqsIFe/g8QSF4KHxAzTeY+eLryD7Nco2A6y CleKZbG1xkyJ2bV5Tr47fmj1I07WPjkw0zIy7+C1NeXwpQjFu0wJ1t1Afa76mdXRmgawx7 9+vqKQdSSzYNnFJrOBAevkG4/DjYKfU5VkgGmskeAwKlH5niZ2d9r/2TPLlXTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778924834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4hnl7PLsn3cuWoWfrvVcgFEONYjlWHW7GmxGnQJh4OA=; b=i3DmwvitqNA0i6g3TMM8zBWDfN9zYTq+uhnaYcB+4QDWbwZUkDkHKwDGQQBoOF2zfl5kCI P3qaOs+I7sdZ9/Mg2fuUQkqEBwnAsQbSFTZCQuqrn5c6BKZy4NjPq9udE3e9BSrobRR+HY 7c8U8qwG1zf9dEmiAGTL6Fsy4xZrtwsXpk33tqCRn1ChEPfzw03EyYXEKs72dGiZ3h9cMF /w4mhKAO0VHRsOiytShRZq3ZDQwqTIkvS0GehKQ/1ImCwXsjcVgPDHgHnoxtqsFOQcdgJG erMaEGH+lw/0IaYBq0YeELCdVjqTmONMNGGNhnTn0+hbxXDiUKgVhZ2jKIOiyw== Received: from ltc.des.dev (unknown [92.183.12.56]) (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) (Authenticated sender: des/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4gHfNx6lHSzxPs; Sat, 16 May 2026 09:47:13 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 8ECE1A9C69; Sat, 16 May 2026 11:47:12 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: current@freebsd.org Cc: kib@freebsd.org Subject: rms_rlock with non-sleepable locks held User-Agent: Gnus/5.13 (Gnus v5.13) Date: Sat, 16 May 2026 11:47:12 +0200 Message-ID: <86lddjelen.fsf@ltc.des.dev> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On recent main with a debugging kernel, I am unable to build anything as the system slows to a crawl while the console is inundated with stack traces: rms_rlock with the following non-sleepable locks held: exclusive sleep mutex kqueue (kqueue) r =3D 0 (0xfffff8013615cc00) lock= ed @ /usr/src/sys/kern/kern_event.c:2588 stack backtrace: #0 0xffffffff805d571c at witness_debugger+0x6c #1 0xffffffff805d7019 at witness_warn+0x4b9 #2 0xffffffff8055841f at rms_rlock+0x1f #3 0xffffffff81418f08 at zfs_freebsd_getattr+0xb8 #4 0xffffffff808c1ede at VOP_GETATTR_APV+0x4e #5 0xffffffff8065add0 at vn_getsize_locked+0x70 #6 0xffffffff806610c2 at filt_vfsread+0x82 #7 0xffffffff805018f4 at knote+0xc4 #8 0xffffffff80658f2e at vop_open_post+0x3e #9 0xffffffff808c1572 at VOP_OPEN_APV+0x92 #10 0xffffffff8066e67b at vn_open_vnode+0x19b #11 0xffffffff8066de18 at vn_open_cred+0x698 #12 0xffffffff8066364e at openatfp+0x2be #13 0xffffffff8066336d at sys_openat+0x3d #14 0xffffffff822153a2 at filemon_wrapper_openat+0x12 #15 0xffffffff808a05b8 at amd64_syscall+0x168 #16 0xffffffff8086f86b at fast_syscall_common+0xf8 They vary in how they get to knote() but they're all the same from frame 7 and up. BTW, filt_vfsread() is an excellent argument for VOP_GETSIZE, with vn_getsize() falling back to a full VOP_GETATTR() only when the vnode's vop table does not provide it, as the size of a ZFS vnode is very easy to get: size_t zfs_getsize(vnode_t *vp) { return (VTOZ(vp)->z_size); } while a full VOP_GETATTR() is several hundred lines of code. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org