High IO-Wait and lags under Linux after wiping SSD

I was experiencing high IO-Wait after moving a PC from Windows to Linux.

According the buffered reads the SATA interface wasn’t the bottleneck.

# hdparm -tT /dev/sda

 Timing cached reads:   51936 MB in  2.00 seconds = 26022.54 MB/sec
 Timing buffered disk reads: 1318 MB in  3.00 seconds = 438.90 MB/sec

After thinking a while I remembered: the entire harddisk was encrypted and now fully rewritten. The SSD needed a trim to make it aware of all empty blocks!

# fstrim -av
/boot/efi: 505,7 MiB (530309120 Bytes) auf /dev/sda1 getrimmt
/boot: 0 B (0 Bytes) auf /dev/sda2 getrimmt
/: 65 GiB (69787246592 Bytes) auf /dev/mapper/vgkubuntu-root getrimmt

During the first run it trimmed 1.8TB away!

Usually trimming is done by a systemd service (fstrim.timer) which is being run once a week. But it makes sense running it after a re-installation manually.