From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23302C433F5 for ; Mon, 14 Mar 2022 23:07:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237663AbiCNXI5 (ORCPT ); Mon, 14 Mar 2022 19:08:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237832AbiCNXI4 (ORCPT ); Mon, 14 Mar 2022 19:08:56 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDF8E38F for ; Mon, 14 Mar 2022 16:07:45 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 6B1CF3201DFB for ; Mon, 14 Mar 2022 19:07:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 14 Mar 2022 19:07:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=georgianit.com; h=cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; bh=3G3dZ5V5cIAEFn duBTxQ0hM95qgCWOS76pbim29/mzw=; b=dVR2SIZq+ANuJqvjSJmC8ch0XY7hyj VDABblsGG3cvbZWY/9vOlsSdvOO6o55vLJiVnK0K0WBBs1sj8uSSDXxD1FsPq2qd oh1LCxhCaj4pxyCkg8PbCIbAormf4SwPjh+IY1l2e64c3J/0v9vcLUT3jVdOvOFE 2WZflx5vFVGesayORU/Bv98U/VvOqnhvGaQkNLwRWt9Bg+xTDMpIs0CE8UeNrzoS ie523Nq6SW57Rk1/v1GB8CvcBlpiIn9Z9HVUGdQc2/hW+odoT3Tnd6t6JBWfOVPK WhdiJ80mBNaKxAajr8zNM2YsL7HGWdgor0f96CoyW3xpPZypygs1DoXA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=3G3dZ5V5cIAEFnduBTxQ0hM95qgCWOS76pbim29/mzw=; b=NI0ad0e3 bKQv1BOuj3tAvicT4zbB6UWoeOeCczmZ8aklc61PIqkR+ZIs9rkx1BOtDpVjn9fC ETaCQSaLbQNdvx0tPhUWt+nNtxZ0yKls0eFXSg+fr4tG83MTASwdsz8X3c+JEKyH XsYCd4Yu++OV2rSdD+4IlaPfVDV8vxcsDPFKSpTxfw3xliN0EnVGQ56lS7iWxmA4 pfGcIndXeT9rvT5mWyBVpaNuKqDbvQIGPJkUNJYGv2hKNVX5YIaPuv+eG5LvsA2O DYMR0QzghJCTbvtWZ98fAm5wGNnxaBFMEMP59VrcWozakbvogijG9A4fbV7WWay0 X7c/e0tSrxTJlw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddvledgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhuffvfhfkffgfgggjtgfgsehtje ertddtfeejnecuhfhrohhmpeftvghmihcuifgruhhvihhnuceorhgvmhhisehgvghorhhg ihgrnhhithdrtghomheqnecuggftrfgrthhtvghrnhephfegffduhfekfefgjedtieejle dttedvveefveeuhedtudeileevvefhveeigfelnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheprhgvmhhisehgvghorhhgihgrnhhithdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 14 Mar 2022 19:07:44 -0400 (EDT) From: Remi Gauvin Subject: Re: Btrfs autodefrag wrote 5TB in one day to a 0.5TB SSD without a measurable benefit To: linux-btrfs References: <87tuc9q1fc.fsf@vps.thesusis.net> <87tuc7gdzp.fsf@vps.thesusis.net> <87ee34cnaq.fsf@vps.thesusis.net> Message-ID: <23441a6c-3860-4e99-0e56-43490d8c0ac2@georgianit.com> Date: Mon, 14 Mar 2022 19:07:44 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On 2022-03-14 6:51 p.m., Zygo Blaxell wrote: > > If you never use prealloc or defrag, it's usually not a problem. > You're assuming that the file is created from scratch on that media. VM and databases that are restored from images/backups, or re-written as some kind of maintenance, (shrink vm images, compress database, or whatever) become a huge problem. In one instance, I had a VM image that was taking up more than 100% of it's filesize due to lack of defrag. For a while I was regularly defragmenting those with target size of 100MB as the only way to garbage collect, but that is a shameful waste of write cycles on SSD. Adding compress-force=lzo was the only way for me to solve this issue, (and it even seems to help performance (on SSD, *not* HDD), though probably not for small random reads,, I haven't properly compared that.)