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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E358DC433EF for ; Mon, 25 Oct 2021 16:32:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C641960E74 for ; Mon, 25 Oct 2021 16:32:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232974AbhJYQeZ (ORCPT ); Mon, 25 Oct 2021 12:34:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:44176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232526AbhJYQeZ (ORCPT ); Mon, 25 Oct 2021 12:34:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3503E60F0F; Mon, 25 Oct 2021 16:32:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635179522; bh=A/+eKNIYni7ZOGyGjRdSxdvaTVQw65e70fzEBwT1MJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kPFD1f26LKn5grtYlj+oiltxrZ2sNcO4DEz1mXJuyjNcXuZwfWxzk4c71BGEY8yAO 1DBwySV9PyoH2x+s0MwsJIh26/YKX9iRx/ACjLs+EXhDky4AiIjrXvAN+yuhapeCG4 KBVAOQbJv9Jd1rLUc/AETwwtqIxnbpq8TC0wiP/aPcpL2G6yhq2VfDf4RsICOY2Gli pyyWNLOu2eza+nw3KlxnpLUyxKO7vRDgTdI3vHqXcxUhCVcDwznKZoFB73kUwEu1Cl 01m57RRnD1L5qzwmEnoWMOX1cmBKg2hVZfaP8GlW5FTXSyX8/0bF5NHD9gKPrfryYl NdfV1uSieE5Nw== From: fdmanana@kernel.org To: linux-btrfs@vger.kernel.org Cc: josef@toxicpanda.com, Filipe Manana Subject: [PATCH v2 0/6] btrfs: speedup directory logging/fsync by copying index keys only Date: Mon, 25 Oct 2021 17:31:48 +0100 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Filipe Manana This patchset reworks directory logging to make it copy only the dir index keys, instead of copying both dir index keys and dir item keys, as both have the same type of information. This reduces the amount of logged metadata by about half, and therefore we do about half of the cpu bound work, half of the IO and use less log tree space (except for very small directories). This will allow other optimizations to build on top, some of which are only possible after this change, while others become easier and less cumbersome to implement after this change. Performance tests are in the changelog of patch 5/6. Patch 6/6 only removes code that deals with dir item keys when replaying directory deletions and it could have been squashed into patch 5/6, but since that one is already large and works without 6/6, I opted to make it separate to make it easier to review. Also, after this change we are still able to correctly replay a log tree generated by an old kernel, and an old kernel is also able to correctly replay a log tree generated by a kernel that has this patchset applied. I'm sending this close to the 5.16 merge window, but my intention is to have it only for the next merge window (5.17). V2: Updated changelog of patch 5/6 to make it more clear why backward and forward compatibility are guaranteed. Filipe Manana (6): btrfs: remove root argument from drop_one_dir_item() btrfs: remove root argument from btrfs_unlink_inode() btrfs: remove root argument from add_link() btrfs: remove root argument from check_item_in_log() btrfs: only copy dir index keys when logging a directory btrfs: remove no longer needed logic for replaying directory deletes fs/btrfs/btrfs_inode.h | 18 +- fs/btrfs/ctree.h | 1 - fs/btrfs/inode.c | 25 +- fs/btrfs/tree-log.c | 582 ++++++++++++++------------------ include/uapi/linux/btrfs_tree.h | 4 +- 5 files changed, 280 insertions(+), 350 deletions(-) -- 2.33.0