DF-2879 / run.log
# RUN A (stock kernel, first boot) — registration + wedge
$ swapctl -a /dev/vn1
swapctl: adding /dev/vn1 as swap device
$ swapctl -l
Device: 512-blocks Used:
/dev/vbd0s1b 8388608 0
/dev/vn1 1024 0 <-- 1024 blocks registered
$ diskinfo /dev/vn1 | head -1
/dev/vn1 blksize=512 offset=0x000000000000 size=0x000000041000 260.00 KB
<-- real size = 0x41000 = 266240 B = 520 512-blocks
$ swapctl -d /dev/vbd0s1b # leave only vn1 as swap
$ sysctl vm.swap_size vm.swap_free
vm.swap_size: 64 <-- 64 pages advertised free on vn1 (1 real + 63 phantom)
vm.swap_free: 64
$ /tmp/hog 2800 # no pressure yet (RAM 5 GB)
$ dmesg | diff - : clean
$ /tmp/hog 5200 # exceed RAM
(within ~25 s the guest wedges; ssh command times out at 115 s,
final poll prints: dmesg: sysctl kern.msgbuf: Cannot allocate memory)
$ dfbsd-qemu/vm.sh status
down
$ grep -c "swap_pager: I/O error" boot.log
25712
serial console (repeating, same offsets):
swap_pager: I/O error - pageout failed; offset 1368064,size 24576, error 22
swap_pager: I/O error - pageout failed; offset 1368064,size 40960, error 22
swap_pager: I/O error - pageout failed; offset 1368064,size 4096, error 22
swap_pager: I/O error - pageout failed; offset 1368064,size 65536, error 22
...
(offset 1368064 >> 12 = block 334; 334/64 = seg 5; 5 % 4 = device index 1 (vn1);
5/4 = stripe 1 -> device page 1*64 + 334%64 = 78 -- beyond the 65-page device)
# RUN B (after vm.sh reset with-src, fresh clean-source guest) — same result
$ swapctl -l
/dev/vn1 1024 0
$ sysctl vm.swap_size
1048576 (1048512 primary + 64 vn1; only 1 vn1 page real)
$ swapctl -d /dev/vbd0s1b; /tmp/hog 5200
-> guest wedged again; vm.sh status: down
$ grep -c "swap_pager: I/O error" boot.log
18215
offsets seen: 1368064 (blk 334) and 1433600 (blk 350 -> device page 94)