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 651B3C76188 for ; Wed, 5 Apr 2023 17:34:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232719AbjDERe4 (ORCPT ); Wed, 5 Apr 2023 13:34:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231906AbjDERez (ORCPT ); Wed, 5 Apr 2023 13:34:55 -0400 Received: from len.romanrm.net (len.romanrm.net [IPv6:2001:41d0:1:8b3b::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A0856182 for ; Wed, 5 Apr 2023 10:34:52 -0700 (PDT) Received: from nvm (nvm.home.romanrm.net [IPv6:fd39::101]) by len.romanrm.net (Postfix) with SMTP id 0536F400B1; Wed, 5 Apr 2023 17:34:49 +0000 (UTC) Date: Wed, 5 Apr 2023 22:34:49 +0500 From: Roman Mamedov To: Boris Burkov Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 1/2] btrfs: set default discard iops_limit to 1000 Message-ID: <20230405223449.1904fcad@nvm> In-Reply-To: <45f813c5fabdb32df67ba661c396c592b863ff25.1680711209.git.boris@bur.io> References: <45f813c5fabdb32df67ba661c396c592b863ff25.1680711209.git.boris@bur.io> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Wed, 5 Apr 2023 09:20:32 -0700 Boris Burkov wrote: > Previously, the default was a relatively conservative 10. This results > in a 100ms delay, so with ~300 discards in a commit, it takes the full > 30s till the next commit to finish the discards. On a workstation, this > results in the disk never going idle, wasting power/battery, etc. > > Set the default to 1000, which results in using the smallest possible > delay, currently, which is 1ms. This has shown to not pathologically > keep the disk busy by the original reporter. > > Link: https://lore.kernel.org/linux-btrfs/ZCxKc5ZzP3Np71IC@infradead.org/T/#m6ebdeb475809ed7714b21b8143103fb7e5a966da > Signed-off-by: Boris Burkov > --- > fs/btrfs/discard.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/btrfs/discard.c b/fs/btrfs/discard.c > index 317aeff6c1da..aef789bcff8f 100644 > --- a/fs/btrfs/discard.c > +++ b/fs/btrfs/discard.c > @@ -60,7 +60,7 @@ > #define BTRFS_DISCARD_TARGET_MSEC (6 * 60 * 60UL * MSEC_PER_SEC) > #define BTRFS_DISCARD_MIN_DELAY_MSEC (1UL) > #define BTRFS_DISCARD_MAX_DELAY_MSEC (1000UL) > -#define BTRFS_DISCARD_MAX_IOPS (10U) > +#define BTRFS_DISCARD_MAX_IOPS (10000U) But the patch sets 10000? > > /* Monotonically decreasing minimum length filters after index 0 */ > static int discard_minlen[BTRFS_NR_DISCARD_LISTS] = { -- With respect, Roman