Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp636387ybm; Wed, 27 May 2020 04:27:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfs9iNohilAtl/KHTW7sgktlmZMtkWH2i4Z6lOmUMTKzS1DXeU2lZYOGuC5df+yWol4oiD X-Received: by 2002:a17:906:17d1:: with SMTP id u17mr5468710eje.242.1590578824547; Wed, 27 May 2020 04:27:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590578824; cv=none; d=google.com; s=arc-20160816; b=Oq7Ip475Q3s/Y5I3g6F3jqmWrUQwMPaguE8xeAwdP4v/uNQN0yzWjYCSfqyZT7w9DB t+lDRK2XeCSzd3dIZk1Xxo2q/novE1ixbFxZ7IfYOAwP7ahiQ/39Uuzs1qz43ztoaIdX iG+7rCYkBP54UKcBzjQ9JMdWzN/npnk3LDM39JmPE/VDUxAIaLmCJ2nnQWudXQRNxocw 3y7gLnP6ahigWrWGFEegknI3yEMxJ/+Dcy8A9PBegu9s+i/lRGjRDEYWOomfnLSO03h1 feqOICfE17kTMD8LbyC7PojFqM2rlyve2wKqzUQyKDgyFf90I+8Sg/KE+0J9F1oEP+Bj kIpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=IAEuBA7o11Fo+AR5aKbhXzqq4O7qViGEWngiKUVMEpc=; b=GVGbX8/V7EOgA3pjpKIfMpc7aUvKvSOjuCfka3vzv7J5kv9xQXsSa64Gf0G+oc5fn4 69VYaBUM8YInIUuRU1rVMoEQN/6IPxpAa+utv0crlV6jbf6gihq2GvFrlEK7LW76TAtJ u4YaIRy7fG9mKeAL683orkIjGg6Esfyy3Py7kegjuL1lcHgYpWjItwc0jOzRXI1nXWhr zgqrx9MEKC8gYfWBmM6uOrRMAd4eUDwnz8UPUBITl7FTi11b37hM28Bg3Nx5IXBo65wD IJiHIJ36KZf0EhzFlsYMDQhCwS6b54R4mKpVpUm8eXANd1vJV6l4wR0oWzWw5pQyOeBT 45RQ== ARC-Authentication-Results: i=1; mx.google.com; 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 jx1si1702113ejb.175.2020.05.27.04.26.40; Wed, 27 May 2020 04:27:04 -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; 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 S1725897AbgE0JcG (ORCPT + 99 others); Wed, 27 May 2020 05:32:06 -0400 Received: from mail.thelounge.net ([91.118.73.15]:52799 "EHLO mail.thelounge.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbgE0JcF (ORCPT ); Wed, 27 May 2020 05:32:05 -0400 Received: from srv-rhsoft.rhsoft.net (rh.vpn.thelounge.net [10.10.10.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) (Authenticated sender: h.reindl@thelounge.net) by mail.thelounge.net (THELOUNGE MTA) with ESMTPSA id 49X5FZ3DSLzXSL; Wed, 27 May 2020 11:32:02 +0200 (CEST) Subject: Re: [PATCH] ext4: introduce EXT4_BG_WAS_TRIMMED to optimize trim To: Lukas Czerner , Wang Shilong Cc: linux-ext4@vger.kernel.org, Wang Shilong , Shuichi Ihara , Andreas Dilger References: <1590565130-23773-1-git-send-email-wangshilong1991@gmail.com> <20200527091938.647363ekmnz7av7y@work> From: Reindl Harald Organization: the lounge interactive design Message-ID: <520b260b-13e9-4c62-eaeb-c44215b14089@thelounge.net> Date: Wed, 27 May 2020 11:32:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200527091938.647363ekmnz7av7y@work> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Am 27.05.20 um 11:19 schrieb Lukas Czerner: > On Wed, May 27, 2020 at 04:38:50PM +0900, Wang Shilong wrote: >> From: Wang Shilong >> >> Currently WAS_TRIMMED flag is not persistent, whenever filesystem was >> remounted, fstrim need walk all block groups again, the problem with >> this is FSTRIM could be slow on very large LUN SSD based filesystem. >> >> To avoid this kind of problem, we introduce a block group flag >> EXT4_BG_WAS_TRIMMED, the side effect of this is we need introduce >> extra one block group dirty write after trimming block group. would that also fix the issue that *way too much* is trimmed all the time, no matter if it's a thin provisioned vmware disk or a phyiscal RAID10 with SSD no way of 315 MB deletes within 2 hours or so on a system with just 485M used [root@firewall:~]$ fstrim -av /boot: 0 B (0 bytes) trimmed on /dev/sda1 /: 315.2 MiB (330522624 bytes) trimmed on /dev/sdb1 [root@firewall:~]$ df Filesystem Type Size Used Avail Use% Mounted on /dev/sdb1 ext4 5.8G 463M 5.4G 8% / /dev/sda1 ext4 485M 42M 440M 9% /boot