From owner-freebsd-questions@FreeBSD.ORG Mon May 27 01:17:57 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D8E197D2 for ; Mon, 27 May 2013 01:17:57 +0000 (UTC) (envelope-from amvandemore@gmail.com) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx1.freebsd.org (Postfix) with ESMTP id B6E8B867 for ; Mon, 27 May 2013 01:17:57 +0000 (UTC) Received: by mail-pa0-f47.google.com with SMTP id kl13so75989pab.20 for ; Sun, 26 May 2013 18:17:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=QxFbP9tnvbhimlW1Qyc9y5usjbB/DttmufU8cB0UU7w=; b=UnpAAHX1KsYoc3bkPuN9z+w7N7buotu1YAq8pzzgsW9SVV0CnpYsx23uLlg9qTxVQP B9oAFWb6n13QWrkNq4Af/k4xH9BxlBlfRD6j55waA10RfB7OcYKceydzX5uE6irZIPvM J/NbFoMTv4BHagYqXYE5JB/JBjH7VVax1xtTq2TyrmCfCBBkUZQYu/E43ii1xiBuZaL5 PD55xiP1Bed9hRaT0qsS+rLmUEVOt6qfLZyfrJsjHhb+gGi3HEC45pXgGxwZ5f+IjKWH cHL/m9f/81rbwx4UQQ22U+kWIoKGOQHRgOr1ZygymNa59tUhM71wfF0dZzWWa7z88EPb KmJQ== MIME-Version: 1.0 X-Received: by 10.68.228.195 with SMTP id sk3mr26933248pbc.103.1369617469985; Sun, 26 May 2013 18:17:49 -0700 (PDT) Received: by 10.70.31.195 with HTTP; Sun, 26 May 2013 18:17:49 -0700 (PDT) In-Reply-To: References: <1369558712.96152.YahooMailNeo@web165006.mail.bf1.yahoo.com> <20130526160906.4e379016@X220.ovitrap.com> <20130526113235.f5dbe768.freebsd@edvax.de> Date: Sun, 26 May 2013 20:17:49 -0500 Message-ID: Subject: Re: "swap" partition leads to instability? From: Adam Vande More To: Warren Block Content-Type: text/plain; charset=ISO-8859-1 Cc: Erich Dollansky , Polytropon , "freebsd-questions@freebsd.org" , "M. V." X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 01:17:57 -0000 On Sun, May 26, 2013 at 7:20 PM, Warren Block wrote: > Which part? This part: "Another problem with SSDs is that they can have difficulty with wear leveling." Do as I suggested and you'll get maximum life from the drive even with swap present. Even absent of best practices, SSD's in general do a great job in managing wear leveling. We're 5+ years out from crappy SSD's with dynamic wear leveling. Modern SSD's don't suffer nearly the write amplification effect of earlier drives. Also the write amplification effect only comes into play during random writes. A lot of common swap usage isn't random. All this is of course assuming we're dealing with a quality drive. If you're using a cheap Chinese knock off, all bets are off. > A FreeBSD swap partition has no way to use TRIM, so I suggest > using a swap file on top of UFS, which does support TRIM. > > Using TRIM should preserve performance better than leaving unused space and > letting the drive wear leveling algorithm move data around without the hint. Normal dynamic wear leveling on a modern SSD will be better than imposing an FS- backed swap for 4GB partion occupying a small fraction of total drive space. File backed paging imposes two sets of bottlenecks and TRIM only *helps* with one. Another part of the equation is how much is swap used. If rarely, this is a non-issue to begin with. If it's significant, any flash SSD probably isn't appropriate. Certain other SSD's are not subject to these guidelines at all. -- Adam Vande More