NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/60820: LFS in-kernel cleaner can enter deadlock with build.sh



The following reply was made to PR kern/60820; it has been noted by GNATS.

From: Shinichi Doyashiki <clare%csel.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject:  Re: kern/60820: LFS in-kernel cleaner can enter deadlock with build.sh
Date: Sat, 31 Oct 2026 14:18:29 +0900

 After updating the kernel and running the test script, I observed a new deadlock.
 
 db{0}> ps
 PID     LID S CPU     FLAGS       STRUCT LWP *               NAME WAIT
 2599   2599 3   1   1000000   ffff91cff881f400             umount rwlock
 18209 18209 3   0         0   ffff91cffbd28800                 sh fstchg
 0     18260 3   3       240   ffff91cff881fc00         lfs_writer fstchg
 0     18580 3   1       200   ffff91cff8ca7400        lfs_reclaim fstchg
 0        12 3   2       200   ffff91d730aa9800             lfsswq lfsswq
 0        11 3   1       200   ffff91d730aa9400             lfscwq lfscwq
 
 db{0}> show proc /a ffff91cff881f400
 lwp_t ffff91cff881f400
 umount: pid 2599 proc ffff91cff8613740 vmspace/map ffff91d03fbf4580 flags 4000
   lwp 2599 ffff91cff881f400 pcb ffff94894719e000
     stat 3 flags 1000000 cpu 1 pri 63 ref 0
     wmesg rwlock wchan ffff91d01f6342b8
 
 db{0}>  bt /a ffff91cff881f400
 trace: pid 2599 lid 2599 at 0xffff9489471a2c30
 sleepq_block() at netbsd:sleepq_block+0xea
 turnstile_block() at netbsd:turnstile_block+0x2d0
 rw_enter() at netbsd:rw_enter+0x17c
 lfs_prelock() at netbsd:lfs_prelock+0xaa
 lfs_seglock() at netbsd:lfs_seglock+0x16
 lfs_segwrite() at netbsd:lfs_segwrite+0x7f
 lfs_sync() at netbsd:lfs_sync+0xc6
 VFS_SYNC() at netbsd:VFS_SYNC+0x22
 dounmount() at netbsd:dounmount+0x158
 sys_unmount() at netbsd:sys_unmount+0x157
 syscall() at netbsd:syscall+0xaf
 --- syscall (number 22) ---
 netbsd:syscall+0xaf:
 
 db{0}> show proc /a ffff91cff881fc00
 lwp_t ffff91cff881fc00
 system: pid 0 proc ffffffff81465040 vmspace/map ffffffff8155a2e0 flags 20002
   lwp 18260 [lfs_writer] ffff91cff881fc00 pcb ffff9489473f9000
     stat 3 flags 240 cpu 3 pri 123 ref 0
     wmesg fstchg wchan ffffffff815765b0
   lwp 18580 [lfs_reclaim] ffff91cff8ca7400 pcb ffff948947627000
     stat 3 flags 200 cpu 1 pri 123 ref 0
     wmesg fstchg wchan ffffffff815765b0
   lwp 11 [lfscwq] ffff91d730aa9400 pcb ffff948936377000
     stat 3 flags 200 cpu 1 pri 123 ref 0
     wmesg lfscwq wchan ffff91d733b34308
 
 db{0}> bt /a ffff91cff881fc00
 trace: pid 0 lid 18260 at 0xffff9489473fdf10
 sleepq_block() at netbsd:sleepq_block+0xea
 cv_wait() at netbsd:cv_wait+0xca
 fstrans_start() at netbsd:fstrans_start+0x14c
 _mountlist_iterator_next() at netbsd:_mountlist_iterator_next+0x110
 lfs_writerd() at netbsd:lfs_writerd+0x13f
 
 db{0}> bt /a ffff91cff8ca7400
 trace: pid 0 lid 18580 at 0xffff94894762bbf0
 sleepq_block() at netbsd:sleepq_block+0xea
 cv_wait() at netbsd:cv_wait+0xca
 fstrans_start() at netbsd:fstrans_start+0x14c
 vfs_busy() at netbsd:vfs_busy+0x1c
 vcache_get() at netbsd:vcache_get+0xfe
 lfs_vget() at netbsd:lfs_vget+0x23
 finfo_func_checkempty() at netbsd:finfo_func_checkempty+0xf4
 lfs_parse_pseg() at netbsd:lfs_parse_pseg+0x3f4
 lfs_checkempty() at netbsd:lfs_checkempty+0xfc
 lfs_markclean() at netbsd:lfs_markclean+0x51
 lfs_auto_segclean() at netbsd:lfs_auto_segclean+0x29e
 lfs_reclaimd() at netbsd:lfs_reclaimd+0x50
 
 db{0}> show all locks
 [Locks tracked through LWPs]
 
 ****** LWP 2599.2599 (umount) @ 0xffff91cff881f400, l_stat=3
 
 *** Locks held:
 
 * Lock 0 (initialized at netbsd:fstrans_init+0x1b)
 lock address : netbsd:vfs_suspend_lock
 type         : sleep/adaptive
 initialized  : netbsd:fstrans_init+0x1b
 shared holds :                  0 exclusive:                  1
 shares wanted:                  0 exclusive:                  0
 relevant cpu :                  1 last held:                  2
 relevant lwp : 0xffff91cff881f400 last held: 0xffff91cff881f400
 last locked* : netbsd:vfs_suspend+0xdb
 unlocked     : netbsd:vrevoke+0xc8
 owner field  : 0xffff91cff881f400 wait/spin:                0/0
 Turnstile: no active turnstile for this lock.
 
 * Lock 1 (initialized at netbsd:vfs_mountalloc+0x76)
 lock address : ffff91d4d4c1c1c0
 type         : sleep/adaptive
 initialized  : netbsd:vfs_mountalloc+0x76
 shared holds :                  0 exclusive:                  1
 shares wanted:                  0 exclusive:                  0
 relevant cpu :                  1 last held:                  2
 relevant lwp : 0xffff91cff881f400 last held: 0xffff91cff881f400
 last locked* : netbsd:dounmount+0x65
 unlocked     : netbsd:do_sys_sync+0x32
 owner field  : 0xffff91cff881f400 wait/spin:                0/0
 Turnstile: no active turnstile for this lock.
 
 *** Locks wanted:
 
 * Lock 0 (initialized at netbsd:config_init+0x3a)
 lock address : netbsd:config_misc_lock
 type         : sleep/adaptive
 initialized  : netbsd:config_init+0x3a
 shared holds :                  0 exclusive:                  0
 shares wanted:                  0 exclusive:                  0
 relevant cpu :                  1 last held:                  2
 relevant lwp : 0xffff91cff881f400 last held: 000000000000000000
 last locked  : netbsd:device_lookup_acquire+0x22
 unlocked*    : netbsd:device_lookup_acquire+0xe6
 owner field  : 000000000000000000 wait/spin:                0/0
 Turnstile: no active turnstile for this lock.
 
 *** Locks held:
 
 * Lock 0 (initialized at netbsd:lfs_mountfs+0x536)
 lock address : ffff91d01f6342b8
 type         : sleep/adaptive
 initialized  : netbsd:lfs_mountfs+0x536
 shared holds :                  0 exclusive:                  1
 shares wanted:                  0 exclusive:                  1
 relevant cpu :                  1 last held:                  1
 relevant lwp : 0xffff91cff8ca7400 last held: 0xffff91cff8ca7400
 last locked* : netbsd:lfs_reclaimd+0x48
 unlocked     : netbsd:lfs_preunlock+0x77
 owner/count  : 0xffff91cff8ca7400 flags    : 0x0000000000000007
 Turnstile:
 => 0 waiting readers:
 => 1 waiting writers: 0xffff91cff881f400
 
 *** Locks wanted: none
 
 db{0}> call fstrans_dump(0)
 Fstrans locks by lwp:
 [ 19612.1666798] Fstrans state by mount:
 [ 19612.1666798] /lfs             owner 0xffff91cff881f400 state suspended
 0
 db{0}> call fstrans_dump(1)
 Fstrans locks by lwp:
 [ 19612.1666798] 2599.259 @0xffff91d041837080 (/var/shm) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91d04094ea00 (/export) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91d040e86400 (/tmp) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91d03d0f2840 (/dev/pts) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91d4d3cd79c0 (/) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d2740 (/lfs) - 0 cow 0 alias 0
 [ 19612.1666798] 29277.29 @0xffff91d04094e880 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 3636.363 @0xffff91cff93d2200 (/) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cffb526940 (/dev/pts) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d23c0 (/tmp) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d2340 (/export) - 0 cow 0 alias 0
 [ 19612.1666798] 18833.18 @0xffff91cff93d2800 (/dev/pts) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff93d2580 (/tmp) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cffb526a40 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 18682.18 @0xffff91cff93d2480 (/) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff93d2080 (/dev/pts) - 0 cow 0 alias 0
 [ 19612.1666798] 18209.18 @0xffff91d044320340 (/lfs) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff93d2780 (/export) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cffb526840 (/dev/pts) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cffb526140 (/) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cffb526b40 (/tmp) - 0 cow 0 alias 0
 [ 19612.1666798] 18515.18 @0xffff91cff93d2400 (/dev/pts) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff93d2280 (/tmp) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff93d2180 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 17835.17 @0xffff91cffb526f40 (/) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cffb526cc0 (/dev/pts) - 0 cow 0 alias 0
 [ 19612.1666798] 19386.19 @0xffff91cffb526c40 (/dev/pts) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cffb526040 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 17822.17 @0xffff91cffb526d40 (/dev/pts) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cffb5266c0 (/) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d27c0 (/tmp) - 0 cow 0 alias 0
 [ 19612.1666798] 1956.195 @0xffff91cff93d2a80 (/lfs) gone - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cffb526ac0 (/tmp) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d24c0 (/dev/pts) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d22c0 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 845.845  @0xffff91cffb5269c0 (/) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cffb5260c0 (/dev/pts) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d2840 (/tmp) - 0 cow 0 alias 0
 [ 19612.1666798] 1981.198 @0xffff91cff86d2440 (/) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d2240 (/dev/pts) - 0 cow 0 alias 0
 [ 19612.1666798] 1992.199 @0xffff91cff86d2bc0 (/) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d2540 <dead> - 0 cow 0 alias 0
 [ 19612.1666798] 1196.119 @0xffff91cffb5262c0 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 811.811  @0xffff91cff93d2d00 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 912.912  @0xffff91cff86d2a40 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 1695.169 @0xffff91cffb526440 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 1208.120 @0xffff91cffb526740 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 553.553  @0xffff91cff86d2b40 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 552.552  @0xffff91cff93d2d80 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 1315.131 @0xffff91cff86d2c40 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 500.500  @0xffff91cffb526340 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 348.348  @0xffff91cff93d2e00 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 830.325  @0xffff91cffb5267c0 (/export) - 0 cow 0 alias 0
 [ 19612.1666798] 830.324  @0xffff91cffb526bc0 (/export) - 0 cow 0 alias 0
 [ 19612.1666798] 830.830  @0xffff91cffb5264c0 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 823.823  @0xffff91cff93d2f80 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 390.390  @0xffff91cff86d2cc0 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 934.1004 @0xffff91cff86d2ac0 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 934.1020 @0xffff91cff93d2880 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 934.1096 @0xffff91cff93d2e80 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 934.568  @0xffff91cff86d2640 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 934.934  @0xffff91cff93d2f00 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 702.702  @0xffff91cff93d2b80 (/) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d29c0 <dead> - 0 cow 0 alias 0
 [ 19612.1666798] 695.695  @0xffff91cff93d2600 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 699.699  @0xffff91cff93d2900 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 692.692  @0xffff91cff86d26c0 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 679.679  @0xffff91cff93d2700 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 1.1      @0xffff91d04094e180 (/lfs) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d2140 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 0.19847  @0xffff91d0443203c0 (/lfs) - 0 cow 0 alias 0
 [ 19612.1666798] 0.18260  @0xffff91cff93d2100 (/lfs) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d2f40 (/export) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d2ec0 (/var/shm) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d2e40 (/dev/pts) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d2dc0 (/tmp) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d2940 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 0.18580  @0xffff91cffb5261c0 (/lfs) - 0 cow 0 alias 0
 [ 19612.1666798] 0.169    @0xffff91cffb526240 (/lfs) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cffb5265c0 (/dev/pts) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cffb526540 (/tmp) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff93d2680 (/var/shm) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d2d40 (/export) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d25c0 <dead> - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d2040 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 0.168    @0xffff91cff93d2b00 (/export) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff93d2980 (/) - 0 cow 0 alias 0
 [ 19612.1666798] 0.0      @0xffff91cff86d21c0 (/) - 0 cow 0 alias 0
 [ 19612.1666798]          @0xffff91cff86d20c0 <dead> - 0 cow 0 alias 0
 [ 19612.1666798] Fstrans state by mount:
 [ 19612.1666798] /                owner 0x0 state normal
 [ 19612.1666798] /tmp             owner 0x0 state normal
 [ 19612.1666798] /dev/pts         owner 0x0 state normal
 [ 19612.1666798] /var/shm         owner 0x0 state normal
 [ 19612.1666798] /export          owner 0x0 state normal
 [ 19612.1666798] /lfs             owner 0xffff91cff881f400 state suspended
 0
 
 
 



Home | Main Index | Thread Index | Old Index