swap_pager_swapoff() does trylock for pagein, which means that either io to md(4) over swap, or intensive page faults can prevent swapoff() from any progress. Then the retry < 100 check fails and machine panics.
If trylock fails, acquire the object lock in the blockable way and restart the hash bucket walk. I kept retries logic for now.
Another improvement there would be to check the ENOMEM conditions inside swap_pager_swapoff() before each page-in attempt. similar to the ENOMEM check in swapoff_one(), but this is non-trivial because swapoff_one() fills sw_blist, which must be undone on failure.