Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758281AbcCCRCw (ORCPT ); Thu, 3 Mar 2016 12:02:52 -0500 Received: from imap.thunk.org ([74.207.234.97]:56334 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932886AbcCCRCT (ORCPT ); Thu, 3 Mar 2016 12:02:19 -0500 Date: Thu, 3 Mar 2016 12:02:05 -0500 From: "Theodore Ts'o" To: Linus Torvalds Cc: "Darrick J. Wong" , Jens Axboe , Christoph Hellwig , Andrew Morton , "Martin K. Petersen" , Linux API , Linux Kernel Mailing List , shane.seymour@hpe.com, Bruce Fields , linux-fsdevel , Jeff Layton Subject: Re: [PATCH 2/2] block: create ioctl to discard-or-zeroout a range of blocks Message-ID: <20160303170205.GD24012@thunk.org> Mail-Followup-To: Theodore Ts'o , Linus Torvalds , "Darrick J. Wong" , Jens Axboe , Christoph Hellwig , Andrew Morton , "Martin K. Petersen" , Linux API , Linux Kernel Mailing List , shane.seymour@hpe.com, Bruce Fields , linux-fsdevel , Jeff Layton References: <20160302040932.16685.62789.stgit@birch.djwong.org> <20160302040947.16685.42926.stgit@birch.djwong.org> <20160302225601.GB21890@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1136 Lines: 25 On Wed, Mar 02, 2016 at 03:49:53PM -0800, Linus Torvalds wrote: > > No. This is not about enabling use of "that idiotic discard behavior", for > > that there's BLKDISCARD. This ioctl does NOT use the handwavy old TRIM > > advisory request thing that could return "fuzzy wuzzy" without violating the > > specs. > > So you agree that we could just make BLKZEROOUT always use trim? There is a massive bug in the SATA specs about trim, which is that it is considered advisory. So the storage device can throw it away whenever it feels like it. (In practice, when it's too busy doing other things). The thing is, this fuzzy wuzzy definition of trim in the SATA specs is more and more a SATA-specific bug. The eMMC 5.1 spec has a reliable trim, and SCSI has WRITE SAME. So it's just SATA which has this crazy definition of trim. (In practice there is no real difference between trim and discard; it's just a matter of terminology; in order to determine whether or not trim/discard is reliable you really have to pay close attention to the specs, on in the case of SATA, use a whitelist of drive models, which is crazy.) - Ted