From owner-freebsd-hackers@FreeBSD.ORG Sat Jul 5 08:36:17 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC4F2BEB for ; Sat, 5 Jul 2014 08:36:17 +0000 (UTC) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id B11962370 for ; Sat, 5 Jul 2014 08:36:17 +0000 (UTC) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id E7CE31578; Sat, 5 Jul 2014 08:36:08 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.9/8.14.9) with ESMTP id s658a7GI043223; Sat, 5 Jul 2014 08:36:08 GMT (envelope-from phk@phk.freebsd.dk) To: Jesse Gooch Subject: Re: geli+trim support In-reply-to: <53B750C1.8070706@gooch.io> From: "Poul-Henning Kamp" References: <7E2718485A3E405D89E5EAB331E9ED70@multiplay.co.uk> <53B6427D.1010403@gooch.io> <60445.1404461976@critter.freebsd.dk> <53B750C1.8070706@gooch.io> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <43221.1404549367.1@critter.freebsd.dk> Date: Sat, 05 Jul 2014 08:36:07 +0000 Message-ID: <43222.1404549367@critter.freebsd.dk> X-Mailman-Approved-At: Sat, 05 Jul 2014 11:27:55 +0000 Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jul 2014 08:36:18 -0000 In message <53B750C1.8070706@gooch.io>, Jesse Gooch writes: >> If you TRIM, your old sector is still unchanged somewhere in flash, but >> if you're lucky for slightly less time. > >Perhaps I misunderstand TRIM, isn't the point of TRIM that it zeroes out >the sector ahead of time so it doesn't have to re-do it again when it >stores more data in that sector later? Yes. But "ahead of time" does not mean "now." It's a fairly lenghty explanation, but the short version is that TRIM'ing a sector means that the FTL knows you don't care about the contents of the sector, so it need not be preserved during "washes". When the washes actually happen depends on how large the actual free-pool is and very strongly on if an eraseblock happens to be all TRIM'ed and finally on the wear-levelling algorithm and the characteristics of the flash that informs it. There is no way to characterize any of these things, without full acces to the FLT. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.