From owner-freebsd-fs@freebsd.org Wed Sep 9 17:17:20 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 C3F6CA01DF3 for ; Wed, 9 Sep 2015 17:17:20 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A3EF12F7 for ; Wed, 9 Sep 2015 17:17:20 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id t89HHIV5088367 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 9 Sep 2015 11:17:18 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id t89HHIl5088362; Wed, 9 Sep 2015 11:17:18 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Wed, 9 Sep 2015 11:17:18 -0600 (MDT) From: Warren Block To: Jan Bramkamp cc: freebsd-fs@freebsd.org Subject: Re: TRIM support (same bug as linux?) In-Reply-To: <55F00CC4.7060600@rlwinm.de> Message-ID: References: <55F00CC4.7060600@rlwinm.de> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Wed, 09 Sep 2015 11:17:19 -0600 (MDT) 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: Wed, 09 Sep 2015 17:17:20 -0000 On Wed, 9 Sep 2015, Jan Bramkamp wrote: > On 09/09/15 01:15, FF wrote: >> I'm asking a pretty vague question and I apologize in advance, not trying >> to troll. >> >> The question has to do with whether FreeBSD is using TRIM the same way as >> recent Linux kernels. >> >> https://blog.algolia.com/when-solid-state-drives-are-not-that-solid/ seems >> to imply that there are instabilities that can occur. Trying to avoid >> duplicating effort if this has already been addressed or if its a complete >> dead alley because there isn't a commonality. > > At first the leading theory was that Linux triggered a firmware bug in the > SSDs or that a bug in the handling of queued TRIM operations is responsible. > The real culprit was a bug in the code for linear mdraid volumes causing the > wrong blocks to be unmapped with TRIM. They have test code to duplicate the bug here: https://github.com/algolia/trimtester The trim_periodic.sh script uses fstrim, a Linux command that "is used on a mounted filesystem to discard (or "trim") blocks which are not in use by the filesystem." In a batch. No idea how often that is used in real life.