Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp198496pxa; Fri, 14 Aug 2020 01:17:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyte2pzfoRHuqSP0EZzgrtG3nF9DAKorwCqDzlbQgbYu92XrAsYN2Uu4jL/bB2cuEICX+3Y X-Received: by 2002:a05:6402:31ba:: with SMTP id dj26mr1156434edb.181.1597393038416; Fri, 14 Aug 2020 01:17:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597393038; cv=none; d=google.com; s=arc-20160816; b=qKEmJpFRWeyWFaKfp6EyhqwDW7UqE4NUyzM5d0qvu9rieB5Xe8aGjgb1/XGeLH43Gd cqnRsENYZ/Z46PXW8iBq9XaQtyqUpbsEwnMPHe/773le3rM9qoHT7I68uhrAlEEZWGS2 Z8rn00p9Dmd6SURgD1EdMOA8QNe/B3gm1kALSEkyItxxktNi9hT1ul/yhSwqJH9xUm29 Wh73wF+zXd1IkinCuY2ogDl60WRMmkVyRZAb16YXIAgqIQa2LOJmHtkgjOzH5tyPSs1o hAjj/ZF/zIYlZ5X4/qn1f4qVJoE1ZO441NvRBCpQl31ZoLkhKI+uu+qEJGuJ8nB+HgFc BUhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=RBq6UiQ6kGgsjOf+4Bi2VfeeyHRI8+V7TFQ6zqhUqq4=; b=mB+m4tz7hwoN3Lt1OUdKug1AhMo7TUBmspMzFSgFSJQdugvKlFvv2VnPlBRBUVUJHO xzwLn+W4xS9hFfdje4vFVKAJEFXmOPWyqkikG6tz9+fEGFhSIpJ2/c4+xbw+zDIQLzsn 0OTaQRBsw/O+jrSGkCBAALWjFNoA7If+kv3l+9a6dcL3nYJB3uU9dQ6MxHIGgOFQgtXE vG03L/qprBNF3r+D1eya6EUTO4l3M3r7albdwe9uHmYWU7X4m0/P0fC3k3tfq56w4S/l DExxS643lIfSftkBruMeZ4HQxi5O1Id6uItSDOtHtBHd4kv+ZWyabORrFJlO6DhYRCCE 0rpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=NbB0CrFL; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f1si4777400edw.580.2020.08.14.01.16.55; Fri, 14 Aug 2020 01:17:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=NbB0CrFL; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726923AbgHNIGk (ORCPT + 99 others); Fri, 14 Aug 2020 04:06:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbgHNIGk (ORCPT ); Fri, 14 Aug 2020 04:06:40 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C11DC061383 for ; Fri, 14 Aug 2020 01:06:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=RBq6UiQ6kGgsjOf+4Bi2VfeeyHRI8+V7TFQ6zqhUqq4=; b=NbB0CrFLJk3spwHkOzD/u2LA/N 1fPCh7KfIbrlZUaAL2dXFnA9NzarP7FOESSr/zB+3ruy67JMInfr9kPRFrjn3kQ6LwU/KhY8kVS3a mKBCPTY74txTAwC/GLEYJVqXgCvCNXBMTZGuD87QHGtXfImwTUJ3yqVeH1HBjYpp2g/wZWjK3AjwB TZ7X11j9ZU2O25tjar6RUThb+noumDe1V+GIop2uIQBd7IgkE5amfNjITOQ4Y0uR6zigvfQVN8wMY 3WfN1JF9UjmdFYHgPNWPZxzu8L2R1oFR1iApO8zNw0PGQrn9HOdGHKoannDzsonvDpADx+FWzQYQQ 3zoeBJrw==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k6UjT-00042i-L6; Fri, 14 Aug 2020 08:06:35 +0000 Date: Fri, 14 Aug 2020 09:06:35 +0100 From: Christoph Hellwig To: tytso@mit.edu Cc: Andreas Dilger , Wang Shilong , Ext4 Developers List , Wang Shilong , Shuichi Ihara Subject: Re: [PATCH v3 1/2] ext4: introduce EXT4_BG_WAS_TRIMMED to optimize trim Message-ID: <20200814080635.GA14827@infradead.org> References: <1592831677-13945-1-git-send-email-wangshilong1991@gmail.com> <20200806044703.GC7657@mit.edu> <20200808151801.GA284779@mit.edu> <9789BE11-11FB-42B2-A5BE-D4887838ED10@dilger.ca> <20200810132457.GA14208@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200810132457.GA14208@mit.edu> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Aug 10, 2020 at 09:24:57AM -0400, tytso@mit.edu wrote: > Part of the problem here is that discard is being used for different > things for different use cases and devices with different discard > speeds. Right now, one of the primary uses of -o discard is for > people who have fast discard implementation(s and/or people who really > want to make sure every freed block is immediately discard --- perhaps > to meet security / privacy requirements (such as HIPPA compliance, > etc.). I don't want to break that. Note that discard does not provide any security whatsover. For one none of the underlying primitives actually gurantee any action, the device is free to always ignore parts or all of a discard request. And even if it didn't that doesn't mean that data couldn't easily recovered from the media. > > We now have a requirement of people who have very slow discards --- I > think at one point people mentioned something about for devices using > HDD, probably in some kind of dm-thin use case? One solution that we > can use for those is simply use fstrim -m 8M or some such. But it > appears that part of the problem is people do want more precision than > that? Device managed SMR drivers usually support TRIM. But it actually should be a decently fast operation usually, as those drives have a remapping layer just like a FTL.