3 ms·
The kernel should really issue a large TRIM for most of the swap partition at swapon time.
by caf 15y ago
The kernel should really issue a large TRIM for most of the swap partition at swapon time.
- caf 15y ago...and in fact, it does so: http://lxr.linux.no/#linux+v3.0/mm/swapfile.c#L2117 http://lxr.linux.no/#linux+v3.0/mm/swapfile.c#L2117 (and has since kernel 2.6.29). Additionally, if you set the SWAP_FLAG_DISCARD flag to swapon(2), it'll issue TRIMs for swap space that is freed at runtime. You'll need a pretty recent /sbin/swapon to support that flag, though.