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 3F15AC433F5 for ; Mon, 14 Mar 2022 20:10:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243995AbiCNUL7 (ORCPT ); Mon, 14 Mar 2022 16:11:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233445AbiCNUL6 (ORCPT ); Mon, 14 Mar 2022 16:11:58 -0400 Received: from vps.thesusis.net (vps.thesusis.net [34.202.238.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAF9B13D05 for ; Mon, 14 Mar 2022 13:10:48 -0700 (PDT) Received: by vps.thesusis.net (Postfix, from userid 1000) id EB232835FB; Mon, 14 Mar 2022 16:10:47 -0400 (EDT) References: <455d2012-aeaf-42c5-fadb-a5dc67beff35@gmx.com> <3c668ffe-edb0-bbbb-cfe0-e307bad79b1a@gmx.com> <70bc749c-4b85-f7e6-b5fd-23eb573aab70@gmx.com> <7fc9f5b4-ddb6-bd3b-bb02-2bd4af703e3b@gmx.com> <078f9f05-3f8f-eef1-8b0b-7d2a26bf1f97@gmx.com> User-agent: mu4e 1.7.0; emacs 27.1 From: Phillip Susi To: Qu Wenruo Cc: Jan Ziak <0xe2.0x9a.0x9b@gmail.com>, linux-btrfs@vger.kernel.org Subject: Re: Btrfs autodefrag wrote 5TB in one day to a 0.5TB SSD without a measurable benefit Date: Mon, 14 Mar 2022 16:09:08 -0400 In-reply-to: <078f9f05-3f8f-eef1-8b0b-7d2a26bf1f97@gmx.com> Message-ID: <87a6dscn20.fsf@vps.thesusis.net> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Qu Wenruo writes: > That's more or less expected. > > Autodefrag has two limitations: > > 1. Only defrag newer writes > It doesn't defrag older fragments. > This is the existing behavior from the beginning of autodefrag. > Thus it's not that effective against small random writes. I don't understand this bit. The whole point of defrag is to reduce the fragmentation of previous writes. New writes should always attempt to follow the previous one if possible. If auto defrag only changes the behavior of new writes, then how does it change it and why is that not the way new writes are always done?