Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Aug 2015 21:32:34 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Warren Block <wblock@wonkity.com>
Cc:        Willem Jan Withagen <wjw@digiware.nl>, fs@freebsd.org
Subject:   Re: Using SSDs as swap
Message-ID:  <20150808183234.GG2072@kib.kiev.ua>
In-Reply-To: <alpine.BSF.2.20.1508081222371.53526@wonkity.com>
References:  <55C5D48E.6010605@digiware.nl> <20150808102900.GA2072@kib.kiev.ua> <55C5E34B.9010905@digiware.nl> <20150808113750.GC2072@kib.kiev.ua> <55C60441.7040906@digiware.nl> <alpine.BSF.2.20.1508081222371.53526@wonkity.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Aug 08, 2015 at 12:26:38PM -0600, Warren Block wrote:
> On Sat, 8 Aug 2015, Willem Jan Withagen wrote:
> >
> > So perhaps the nicest thing to do for the SSDs is TRIM swap at
> > startup??? So the the SSD controller van do its garbage collection and
> > then keep the remainder of the stuff as it is.
> 
> This can be done now by using a swap file on a UFS partition with trim 
> enabled.  The catch is that the swap file has to be deleted and 
> recreated to trigger the trim.  The delete is quick, but the create 
> depends on the size of the file and the speed of the hardware.  (And no, 
> sparse files do not work as swap files.)
This could work, in the sense that swap would indeed work as a swap,
and not as a deadlock generator.  But it adds very significant (up to
100% in the CPU time, I think) overhead.

Note that you cannot swap to file directly, you must create md(4) over
the file and swap to it.

But doing such layer over layer to get the TRIM is somewhat silly.

> 
> Maybe rotate swap files like log files, so they could be created when 
> the system is idle.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150808183234.GG2072>