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 8F4E3C433F5 for ; Tue, 8 Mar 2022 21:58:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232386AbiCHV70 (ORCPT ); Tue, 8 Mar 2022 16:59:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbiCHV7Z (ORCPT ); Tue, 8 Mar 2022 16:59:25 -0500 Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7955B1C10D for ; Tue, 8 Mar 2022 13:58:28 -0800 (PST) Received: by mail-oo1-xc2a.google.com with SMTP id q1-20020a4a7d41000000b003211b63eb7bso652740ooe.6 for ; Tue, 08 Mar 2022 13:58:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ISniBudmid6NEr+Mocu26vuOCaMQYLPeBTZk+TUseUI=; b=l1JM79SkUtlVPTKuPYh2NWnnqg/ph4pA6HAxs0SrC6PhvLKWI7lWUEVpV7QGVatp3x BaXWJ6novxp8xFzTlDzFWn+agax5j7ZTXU/I7cI7Ic+4rBfzNhmDo55Eby1M0eTEshvJ VVtqFmSmkAHb9f/ENwqxMxX+Vjb8Dl4W0/hI/hlLkTfDcSUAmu5gViomt97pAssDc6FU +tN7vb7su6mXXPIHsFRupthC7m0GjjZxoLGyo/LOxFauOcmAv0CdvYbEo4y8A1QODS2a BG5gl4yuVzJmkxqV6RwLArf93JbQm6ApMQM1U5gWRLMgRmGUKzNKOJvq53aHLPwPHB/H WVVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ISniBudmid6NEr+Mocu26vuOCaMQYLPeBTZk+TUseUI=; b=HyLqv6DESlRYFlsfcUApEOKGiVQazCkEdRAOvEMWkg7eTBBHSwhF0ESO5y19kpY5yK zccKLN7+pRGMXns9gRGoTZrxM8yNoxcrfFxC4Ml95s0MiN5mX610g92xMQMuVAanbrmF oqg+GjisT7oRjTYckJuosrDNE3Hr0OLr4q1gFYGKpdvVL6ty725IuiHQ0IrMphCvVgrd q2FgyzdoF8kPxFaIMEiRFI3EVVIR3K/aj7p/dLcLTTUEapCtYTaxZRKV1NzXVU5Cu4GS ctCH0+ei8S7cfyZPw+lHC74CpdmjohNFOVsTztenWCLJBwwADtBCJb2fKAzY3xinVc1u poNw== X-Gm-Message-State: AOAM532VkB/rjkFJAz1LO8cXgxyZzUlI2SvqF6IKxaMA7mB7D3eqM4Kf rdrxDG/Bfb7QpzDwzjVJHnIHs3riIpByNjcDm4VUKJCVo5g= X-Google-Smtp-Source: ABdhPJw+qycRk4SZ5kWG8sire85i8kr0xA/XMcMJG3HxpTqd4z2DhLXPB49bZxb+1A7V64F+Qx3nMbcUcDnDUejwkxQ= X-Received: by 2002:a05:6870:2418:b0:d3:1052:aac0 with SMTP id n24-20020a056870241800b000d31052aac0mr3840902oap.80.1646776707797; Tue, 08 Mar 2022 13:58:27 -0800 (PST) MIME-Version: 1.0 References: <455d2012-aeaf-42c5-fadb-a5dc67beff35@gmx.com> In-Reply-To: From: Jan Ziak <0xe2.0x9a.0x9b@gmail.com> Date: Tue, 8 Mar 2022 22:57:51 +0100 Message-ID: Subject: Re: Btrfs autodefrag wrote 5TB in one day to a 0.5TB SSD without a measurable benefit To: Qu Wenruo Cc: linux-btrfs@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Mon, Mar 7, 2022 at 3:39 AM Qu Wenruo wrote: > On 2022/3/7 10:23, Jan Ziak wrote: > > BTW: "compsize file-with-million-extents" finishes in 0.2 seconds > > (uses BTRFS_IOC_TREE_SEARCH_V2 ioctl), but "filefrag > > file-with-million-extents" doesn't finish even after several minutes > > of time (uses FS_IOC_FIEMAP ioctl - manages to perform only about 5 > > ioctl syscalls per second - and appears to be slowing down as the > > value of the "fm_start" ioctl argument grows; e2fsprogs version > > 1.46.5). It would be nice if filefrag was faster than just a few > > ioctls per second. > > This is mostly a race with autodefrag. > > Both are using file extent map, thus if autodefrag is still trying to > redirty the file again and again, it would definitely cause problems for > anything also using file extent map. It isn't caused by a race with autodefrag, but by something else. Autodefrag was turned off when I was running "filefrag file-with-million-extents". $ /usr/bin/time filefrag file-with-million-extents.sqlite Ctrl+C Command terminated by signal 2 0.000000 user, 4.327145 system, 0:04.331167 elapsed, 99% CPU Sincerely Jan