From owner-freebsd-fs@freebsd.org Sat Aug 8 18:32:43 2015 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 324D29B5EF3 for ; Sat, 8 Aug 2015 18:32:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 15287F90 for ; Sat, 8 Aug 2015 18:32:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 141AC9B5EF2; Sat, 8 Aug 2015 18:32:43 +0000 (UTC) Delivered-To: fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13B059B5EF1 for ; Sat, 8 Aug 2015 18:32:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 804ECF8F for ; Sat, 8 Aug 2015 18:32:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t78IWYaX045990 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 8 Aug 2015 21:32:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua t78IWYaX045990 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t78IWYBI045989; Sat, 8 Aug 2015 21:32:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 8 Aug 2015 21:32:34 +0300 From: Konstantin Belousov To: Warren Block Cc: Willem Jan Withagen , fs@freebsd.org Subject: Re: Using SSDs as swap Message-ID: <20150808183234.GG2072@kib.kiev.ua> References: <55C5D48E.6010605@digiware.nl> <20150808102900.GA2072@kib.kiev.ua> <55C5E34B.9010905@digiware.nl> <20150808113750.GC2072@kib.kiev.ua> <55C60441.7040906@digiware.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Aug 2015 18:32:43 -0000 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.