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 19936C433F5 for ; Wed, 5 Oct 2022 19:49:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229644AbiJETta (ORCPT ); Wed, 5 Oct 2022 15:49:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbiJETt2 (ORCPT ); Wed, 5 Oct 2022 15:49:28 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2E477F246 for ; Wed, 5 Oct 2022 12:49:26 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 4705F5C00D5; Wed, 5 Oct 2022 15:49:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 05 Oct 2022 15:49:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bur.io; h=cc :content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=1664999364; x=1665085764; bh=/AOSmRC76ykDZP5lXD9Ed+48E B0O/T9Xt1U+zFmQXH8=; b=Ac+L93f7cGo/3gGNU/+6DIMmHvekZv1qa0Jx92qxa ldA7ozk1n/F7Djbj3WEsWcILDZPlSVlFLe7BRccpOWbhQAEIHDvZkrokJFEVOvXE LlPA6b6hpz0yL4wISVoX231Z8abgjYzfspa8S2U1vo2b2yLmV1ODHUzt3Ze7aS3u ETc7Q6XSPkGFFKB7RPVToFtn+ghfJVF/xOqpHYpjvhpmLIIlgtMOamhveHRT8PMU V0zUBmTSiRm0huJTtq8AhdeuI22kAgSTKyyxbrwFJVfD6qKSFSzsgP0OHGgItCDL pJ/ByJL2QVVUjVwxAzdsyHo7H5Z3D8Hl4NyIokGleaklA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1664999364; x=1665085764; bh=/AOSmRC76ykDZP5lXD9Ed+48EB0O/T9Xt1U +zFmQXH8=; b=sGb3uxEH1Q7iGRuYR70ofbvw84mnm9k3rlfvvIudoEPYdRtAbOo dllSWKxeEXqQEdnl+B/icnvAjEW/NIePtCo0hT9ve1Ga+dL4ldennjxoRV+oN4ka gGUOSVcoRFz/+srV2qz5MT3ug8gkcZAqpU1u1oBMeiMIx9deVDgwx84zITrtmDX8 Ntbed4e7mZPvh924Mm8VqU4x0vxNL6Kp1zxBX3GheaHrV8o9g9B2wTKas5/7s+8h Cq6+YvhwpkFqShIetYMGRuA7FS/nH9NqjPxghLYWUF4H0uT3gDdie53IeuL+HhmC 4rVmo1SsSJfIHGY+D0CHzDiQ335BvKO2ztg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeifedgudegtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpeeuohhrihhsuceuuhhrkhhovhcuoegsohhrihhssegsuhhrrdhi oheqnecuggftrfgrthhtvghrnhepudeitdelueeijeefleffveelieefgfejjeeigeekud duteefkefffeethfdvjeevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomhepsghorhhishessghurhdrihho X-ME-Proxy: Feedback-ID: i083147f8:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 5 Oct 2022 15:49:23 -0400 (EDT) From: Boris Burkov To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 0/5] btrfs: data block group size classes Date: Wed, 5 Oct 2022 12:49:17 -0700 Message-Id: X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org This patch set introduces the notion of size classes to the block group allocator for data block groups. This is specifically useful because the first fit allocator tends to perform poorly when large extents free up in older block groups and small writes suddenly shift there. Generally, it should lead to slightly more predictable allocator behavior as the gaps left by frees will be used by allocations of a similar size. Details about the changes and performance testing are in the individual commit messages. The last two patches constitute the business of the change. One adds the size classes and the other handles the fact that we don't want to persist the size class, so we don't know it when we first load a block group. Boris Burkov (5): btrfs: 1G falloc extents btrfs: use ffe_ctl in btrfs allocator tracepoints btrfs: add more ffe tracepoints btrfs: introduce size class to block group allocator btrfs: load block group size class when caching fs/btrfs/block-group.c | 234 ++++++++++++++++++++++++++++++++--- fs/btrfs/block-group.h | 15 ++- fs/btrfs/extent-tree.c | 166 +++++++------------------ fs/btrfs/extent-tree.h | 86 +++++++++++++ fs/btrfs/inode.c | 2 +- fs/btrfs/super.c | 1 + include/trace/events/btrfs.h | 128 +++++++++++++++---- 7 files changed, 472 insertions(+), 160 deletions(-) create mode 100644 fs/btrfs/extent-tree.h -- 2.37.2