vm_pageout_scan_active() reads PGA_SWAP_FREE without the object lock,
and once VM_OBJECT_TRYWLOCK() succeeds it calls
vm_pager_page_unswapped() without rereading the flag. In between,
another thread can move the page to the laundry -- as
madvise(MADV_DONTNEED) does for a dirty page -- where
swap_pager_putpages() clears PGA_SWAP_FREE and assigns a new swap block.
The scan then frees that block, perhaps while the write to it is still
in flight, and the page's contents are lost -- or, if the block is
reused, corrupted.
Recheck the flag with the object locked, and document the rule where the
flag is defined.
Found by: Claude Code (Opus 5.5)