NetBSD Problem Report #60004
From www@netbsd.org Sat Feb 14 17:58:11 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.netbsd.org", Issuer "R13" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 31F5A1A923C
for <gnats-bugs@gnats.NetBSD.org>; Sat, 14 Feb 2026 17:58:11 +0000 (UTC)
Message-Id: <20260214175810.303751A923D@mollari.NetBSD.org>
Date: Sat, 14 Feb 2026 17:58:10 +0000 (UTC)
From: imuwoto@gmail.com
Reply-To: imuwoto@gmail.com
To: gnats-bugs@NetBSD.org
Subject: zfs pgdaemon deadlock on range lock
X-Send-Pr-Version: www-1.0
X-From4GNATS: "imuwoto@gmail.com via gnats" <gnats-admin@NetBSD.org>
>Number: 60004
>Category: kern
>Synopsis: zfs pgdaemon deadlock on range lock
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: needs-pullups
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Feb 14 18:00:01 +0000 2026
>Closed-Date:
>Last-Modified: Thu Jun 25 03:50:01 +0000 2026
>Originator: YAMAMOTO Takashi
>Release: NetBSD 10.1
>Organization:
>Environment:
amd64
>Description:
pgdaemon:
db{0}> tr/a ffff811ebf487b80
trace: pid 0 lid 289 at 0xffffc51261102d40
sleepq_block() at netbsd:sleepq_block+0x13a
cv_wait() at netbsd:cv_wait+0xb7
zfs_range_lock() at zfs:zfs_range_lock+0x13d
zfs_netbsd_putpages() at zfs:zfs_netbsd_putpages+0xc1
VOP_PUTPAGES() at netbsd:VOP_PUTPAGES+0x43
uvm_pageout() at netbsd:uvm_pageout+0x20c
db{0}>
some process:
db{0}> tr/a ffff811ecc0fc540
trace: pid 11847 lid 11847 at 0xffffc5126ec957a0
sleepq_block() at netbsd:sleepq_block+0x13a
mtsleep() at netbsd:mtsleep+0x146
uvmfault_promote() at netbsd:uvmfault_promote+0x235
uvm_fault_internal() at netbsd:uvm_fault_internal+0xce7
trap() at netbsd:trap+0x2f9
--- trap (number 6) ---
copyout() at netbsd:copyout+0x33
dmu_read_uio_dnode() at zfs:dmu_read_uio_dnode+0x83
dmu_read_uio_dbuf() at zfs:dmu_read_uio_dbuf+0x41
zfs_netbsd_read() at zfs:zfs_netbsd_read+0x37d
VOP_READ() at netbsd:VOP_READ+0x42
vn_read() at netbsd:vn_read+0x18e
dofileread() at netbsd:dofileread+0x79
sys_read() at netbsd:sys_read+0x49
syscall() at netbsd:syscall+0x1fc
--- syscall (number 3) ---
netbsd:syscall+0x1fc:
db{0}>
https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=58964
has a similar symptom. but it looks like a different deadlock.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
From: "YAMAMOTO Takashi" <yamt@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/60004 CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Date: Fri, 20 Feb 2026 08:13:30 +0000
Module Name: src
Committed By: yamt
Date: Fri Feb 20 08:13:30 UTC 2026
Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_rlock.c
src/external/cddl/osnet/dist/uts/common/fs/zfs/sys: zfs_rlock.h
Log Message:
zfs: add zfs_range_lock_try
i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)
note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.
https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=60004
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c
cvs rdiff -u -r1.3 -r1.4 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_rlock.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "YAMAMOTO Takashi" <yamt@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/60004 CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Date: Fri, 20 Feb 2026 08:15:15 +0000
Module Name: src
Committed By: yamt
Date: Fri Feb 20 08:15:15 UTC 2026
Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c
Log Message:
zfs_netbsd_putpages: do not make the pagedaemon block on the range lock
blocking here can end up with a deadlock because ordinary
vnops can wait for memory holding the range lock.
fixes PR/60004
https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=60004
To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Wed, 24 Jun 2026 19:52:29 +0000
State-Changed-Why:
Does this need pullup-11, pullup-10, pullup-9?
From: Takashi Yamamoto <imuwoto2@gmail.com>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, netbsd-bugs@netbsd.org, gnats-admin@netbsd.org,
riastradh@netbsd.org, imuwoto@gmail.com
Subject: Re: kern/60004 (zfs pgdaemon deadlock on range lock)
Date: Thu, 25 Jun 2026 12:47:28 +0900
> Does this need pullup-11, pullup-10, pullup-9?
it seems i forgot to update this PR.
pullup-11 was done. (ticket 244)
i have no plan to work on pullup-10.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.