Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2914333pxp; Tue, 8 Mar 2022 04:36:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJygO6b2faODlSwoLm0aQf2X4MWUoJkHU+cUKoZyOLPdNTPZFShsZ+v6zEVbGB8UrpJ1QKeJ X-Received: by 2002:a62:8453:0:b0:4f6:b00c:9388 with SMTP id k80-20020a628453000000b004f6b00c9388mr18286074pfd.84.1646742987344; Tue, 08 Mar 2022 04:36:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646742987; cv=none; d=google.com; s=arc-20160816; b=YVErfncmcrGiuKSNAO+E8a0igRwVv7GZG9RsRX6QrwS1VOSyV7/sA2wQMqqYynDR2q DsMBWxP6/1o7qE93FyTK1dsiqpzOVPSOv93ngQSWamVc4P0QMPweMKTpyzZ/Zd4U/r1c relTAMheOxCvz/TgDWsDjHc8+z0u05fHL8/czcUgTjmtQP1PgNVo1DywFkCwMjfEsxja N10u3K7ho7n55vTsJeHhfmXU5s6wRlxgFGoOIQ1IldD2Wpf4I8t376NaCR/Ht8q4scWC J60fdj3VzBNGCvh2MvzWHWT4DxHpqcbephz2kYpn+oClNq6TqFasl0h951zlkXH+2RQ0 tX+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=EMOG2BPj4fOBhtEo1bzOzs3c76jXokca/v61/sHM5fA=; b=ZJS4uBXrx87lIYTHonJ2Pu2/fXtA2jr554PD74hoxjMNHgNhnSM9/RkHJIWo5Qk5l4 AW5nx6aFQKv7oQcxwVgOCe9GTB0wW5yw5JsIvUac7HrnGtIkX/dqdhMWWGceIjmrT3xo OlO295Rj5wJJM+t1gwyw+0Bh7w9IwXinF95Egr8xqfRBXrj+7nqzIKEXmUfffrdf0MnX g62VvFBCrZJKpS6z9qfmqTvEORQ4zU9qMPk3+g//9+9JpPbAUar4bEneq9iH/AiinY8P vQUoIHKRfC2w4ggP5zzzrrcSqGUbJsB79dnIc5UqcO32YNSfU/9DYVuBBtuhUzVcraZf 4jOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eB9M3uaj; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r3-20020a63ec43000000b00372ba7bc899si15173604pgj.677.2022.03.08.04.35.58; Tue, 08 Mar 2022 04:36:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eB9M3uaj; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344337AbiCHKwX (ORCPT + 99 others); Tue, 8 Mar 2022 05:52:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235309AbiCHKwX (ORCPT ); Tue, 8 Mar 2022 05:52:23 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14A22433B1 for ; Tue, 8 Mar 2022 02:51:27 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id mg21-20020a17090b371500b001bef9e4657cso1916121pjb.0 for ; Tue, 08 Mar 2022 02:51:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EMOG2BPj4fOBhtEo1bzOzs3c76jXokca/v61/sHM5fA=; b=eB9M3uaj12BKY/d9xGJpVM1b2mBm6qd5b6sDc4vK1tcpT8T5L7dZOU3jW8+OZeA2/w aFEJBdU0inHo5EPJgxDC3b+c6beraOld/t6z8i2HcIDcdhZnonnmB6tfKJNKDACWRNeh Sp2ynSfygPvgcfUkbMBbFZCJAs0ccNJn8KkPYCmTxNdwzieh4bbIyPejXMxo1uthbgcQ b5RqvQnwhEIkTAajkjf7FYnedEVuzIaa2BhOw59Q/GESqJyirgbnHYSiLk1ummQ5N1pc vpJPs7zxTj0yZidJzEP4pHjsT0hrnEjqIXQYV/pxlecTv9ym5XU1ZYtfFCeQbtemwdG/ btKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EMOG2BPj4fOBhtEo1bzOzs3c76jXokca/v61/sHM5fA=; b=NTHs//0KjMIo+WfOG99ytV4fpOIDjXb03ViXG8vMTJbuSmXOoASt8yPEkjpCyQ1CBr Rjbz8Y2fTZu89/BErZG6EftJpYHELm0pXIPYzh4JAroDOBQWw+FC5g8p3wtq8fhdzG6/ xtRV4UKI8lojYplrwlL0PbdabH3FlDnRkGTG5EzdZPiJPwoTd9/YMV5L7XdNUmEagv7O LO7snVshr7eFX1RxKoaQuRphijMbiTEQUik0Pa1PYQbgoIAMTzIchRYbX83D3nGYX87m HqrwKOtnu8Hi45nPVXxmwyHOC8vWdyN44CJKLpPOHSZpw8lda1/1aTMi5qlSa0N/r3bm E1vg== X-Gm-Message-State: AOAM532ECFDJeFW8rzxCuKDLwnDL1FQOaTrWkw+LLEQppxKtjGZ6r7bu 8p8SLvTBpj0nd9mSBaDea3EjL3vzS7wGSgEk X-Received: by 2002:a17:90a:6c01:b0:1bf:1e67:b532 with SMTP id x1-20020a17090a6c0100b001bf1e67b532mr4017626pjj.138.1646736685985; Tue, 08 Mar 2022 02:51:25 -0800 (PST) Received: from harshads-520.kir.corp.google.com ([2620:15c:17:10:c24c:d8e5:a9be:227]) by smtp.googlemail.com with ESMTPSA id f6-20020a056a00228600b004f709f5f3c1sm6282040pfe.28.2022.03.08.02.51.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 02:51:25 -0800 (PST) From: Harshad Shirwadkar X-Google-Original-From: Harshad Shirwadkar To: linux-ext4@vger.kernel.org Cc: riteshh@linux.ibm.com, jack@suse.cz, tytso@mit.edu, Harshad Shirwadkar Subject: [PATCH 0/5] ext4: improve commit path performance for fast commit Date: Tue, 8 Mar 2022 02:51:07 -0800 Message-Id: <20220308105112.404498-1-harshads@google.com> X-Mailer: git-send-email 2.35.1.616.g0bdcbb4464-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Harshad Shirwadkar This patch series supersedes the patch "ext4: remove journal barrier during fast commit" sent in Feb 2022. This patch series reworks the fast commit's commit path to improve overall performance of the commit path. Following optimizations have been added in this series: * Avoid having to lock the journal throughout the fast commit. * Remove tracking of open handles per inode. With the changes introduced in this patch series, now the commit path for fast commits is as follows: [1] Lock the journal by calling jbd2_journal_lock_updates. This ensures that all the exsiting handles finish and no new handles can start. [2] Mark all the fast commit eligible inodes as undergoing fast commit by setting "EXT4_STATE_FC_COMMITTING" state. [3] Unlock the journal by calling jbd2_journal_unlock_updates. This allows starting of new handles. If new handles try to start an update on any of the inodes that are being committed, ext4_fc_track_inode() will block until those inodes have finished the fast commit. [4] Submit data buffers of all the committing inodes. [5] Wait for [4] to complete. [6] Commit all the directory entry updates in the fast commit space. [7] Commit all the changed inodes in the fast commit space and clear "EXT4_STATE_FC_COMMITTING" for all the inodes. [8] Write tail tag to ensure atomicity of commits. (The above flow has been documented in the code as well) I verified that the patch series introduces no regressions in "quick" and "log" groups when "fast_commit" feature is enabled. Signed-off-by: Harshad Shirwadkar Harshad Shirwadkar (5): ext4: convert i_fc_lock to spinlock ext4: drop i_fc_updates from inode fc info ext4: for committing inode, make ext4_fc_track_inode wait ext4: rework fast commit commit path ext4: update code documentation fs/ext4/ext4.h | 12 +-- fs/ext4/ext4_jbd2.c | 12 +++ fs/ext4/ext4_jbd2.h | 13 +-- fs/ext4/fast_commit.c | 228 ++++++++++++++++++++---------------------- fs/ext4/inode.c | 3 +- fs/ext4/super.c | 2 +- fs/jbd2/journal.c | 2 - 7 files changed, 134 insertions(+), 138 deletions(-) -- 2.35.1.616.g0bdcbb4464-goog