Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Aug 2020 08:44:05 +0700
From:      Eugene Grosbein <eugen@grosbein.net>
To:        Zaphod Beeblebrox <zbeeble@gmail.com>, freebsd-fs <freebsd-fs@freebsd.org>, FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Boot time TRIM ?
Message-ID:  <ad0035c8-ced6-23d4-936a-fba676f89bc8@grosbein.net>
In-Reply-To: <CACpH0Me7dj%2BguVJu_%2BAUAYF60ZKtf8aR31bXFEYsU%2B93SunSJg@mail.gmail.com>
References:  <CACpH0Me7dj%2BguVJu_%2BAUAYF60ZKtf8aR31bXFEYsU%2B93SunSJg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
26.08.2020 3:02, Zaphod Beeblebrox wrote:

> So, as I was looking at the performance of an NVME that I use for swap and
> ZFS cache, I realized after reboot, that since ZFS cache doesn't survive
> reboot and OBVIOUSLY swap doesn't, might it be best practice to issue a
> TRIM on boot?

If you use 12.1 or newer, there is "trimonce" option for a swap in fstab(5)
and there is "swapon -E" if you need it.

> Now... a trim on the whole device from userland before adding swap in RC...
> might work.  AFAIK, we still don't have any structure to swap before it's
> added.

You may have swap partition located at the beginning of MBR slice and BSD label in first 8KB of the slice.
Swap pager does not touch first 8KB of swap area and swapon/trimonce does not touch that part, too.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ad0035c8-ced6-23d4-936a-fba676f89bc8>