So I followed 12.12.3 of https://www.freebsd.org/doc/handbook/adding-swap-space.html and swap would work after doing mdconfig. However, it stops working after rebooting, even though the rc.conf file has the required line
Code:
swapfile="/usr/swap0"