Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6716657rwl; Wed, 22 Mar 2023 14:40:54 -0700 (PDT) X-Google-Smtp-Source: AK7set93Skgj/oFkHi0P8q3UHtGcUNCiz50mRdCWEOnr8veo976ARGtBWxFjboMsF/lOLsXJErNq X-Received: by 2002:a17:906:abc2:b0:88d:79df:7cfc with SMTP id kq2-20020a170906abc200b0088d79df7cfcmr8096041ejb.62.1679521253761; Wed, 22 Mar 2023 14:40:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679521253; cv=none; d=google.com; s=arc-20160816; b=TEOzqVp4uw6I2ILqsb6tRP7CvyKSoFhBXqRg4lpGuoFR4ezXBdqruPIAfqyFVWAwaC mf9XUQYky0T2dg8jeU7XDHaD2k5WcbgnYO076WpuJ1H7JtSuu0DnGCat9n80kLCKqn+9 6ovkS4GOJPg4WWIVplfWEaScpkxuEbmdff/D2JEF8ElBrUqS0NbH5uvvcv0BOlVNcz2z ZbDad5h5v5vtVUqNzp0tZb9K2TEti2DhZz6r6WSh8sadL1dnF2Rb3haDVpMTiA9dTR1U isSCBGABglRPTpb4ao1sg5auNFRTOVG41dOo34/K+31lz8iseQlRRPqE/XZV8GwkLKwe X6ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:to:cc:in-reply-to:date:subject :mime-version:message-id:from:dkim-signature; bh=6cf5ZrocLuP8eawgd/E60BNCFQFk3YmpTvolIL7gKtM=; b=Lem8QlClBtThnX2E4Osff3Iof6C5ft8r+3HKzMneReXbcRd+uNJpKF0IMDJWq9wETj RL1M6XnkTztUM51KycF1uqWen1sXPT/1WB4iC0YeY6TK1Cjk3ScLgsaCSIbhKDUCseRx SgrzBzsQ8Vipg37I6ov9v1mKsTO2D7JRb9k6GKwqM9y425bdvJsVT+efnjPWJnIyZntc eeqiUxIWpW0tuKEuYAQOdLxnzqoex0RQ+hHgCcWXckqiFaBIJZh37OGG4P8f/QUTCm91 7tl8y+9lObK3opoV2Ua6IEKziJwzlQwK+QoBgQ39PLs7JmkfRe7DocTaGErphEQMjKPe g2ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dilger-ca.20210112.gappssmtp.com header.s=20210112 header.b=faeZG4hd; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a1709067f0b00b0093026fb89e0si860118ejr.545.2023.03.22.14.40.21; Wed, 22 Mar 2023 14:40:53 -0700 (PDT) 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=@dilger-ca.20210112.gappssmtp.com header.s=20210112 header.b=faeZG4hd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229654AbjCVVek (ORCPT + 99 others); Wed, 22 Mar 2023 17:34:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbjCVVek (ORCPT ); Wed, 22 Mar 2023 17:34:40 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C25E7F74C for ; Wed, 22 Mar 2023 14:34:38 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id l7so2662418pjg.5 for ; Wed, 22 Mar 2023 14:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dilger-ca.20210112.gappssmtp.com; s=20210112; t=1679520878; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=6cf5ZrocLuP8eawgd/E60BNCFQFk3YmpTvolIL7gKtM=; b=faeZG4hdCo63xtvEwQPUpWCfDvsFDutyznovvy6/bZ98AS0UU71WEzQGJUR7W5tSHk B1Hsj6F9JacOellvN0OTgxD/E6WleiOQ3iyKGlogFrHx+qwp08RGZ0mj+QhpJNuAE3MC hIYLd2L1yNJ8b67wymi2bKPuFWD1KthvNoT4n/rbLLf8keMJKz2N1BBalkMOv/7naqqU BjRA6ygmeIFqgcd/AJVZqdZeaCtDD5Flsd/9+01c0FDrX+NXCZjImup6kZn41GXLPg9a 5KW6AR/7+qY+u1zzHzNU1wkUnLPWQ1MZcuKgpDvMiKf+n7AbluhYZzWSzQ9U1OyxFYJo oYww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679520878; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6cf5ZrocLuP8eawgd/E60BNCFQFk3YmpTvolIL7gKtM=; b=jljWnFFnDNmKz7rAcaYh58T0wLXoPGMNTfac9hNs3H06na2HuaHZ9mEoMI2du2T/gQ Wpt561UIre8q6HNzqSploeCxX1ZUWrqTlaYnT31E9Icurtx3yzF//Nvt41Iqeu2bQPaY QcyP13HvRzwSUloYZlteMbbKLrsjWnksJzTkXNIQtfGnAbPSxZU3HOy4lt5yVF+O7qUU ZvPMAVOYG1rt/dCOUJntiwATlhZzYEs9XO5yZ1MuclHXcMUyAzbc6e9SMOzfwGBlvSUp ozp7rmgVMs6tcSV22IGCkQHvFXUfnScsyTa83OvkviruHq7zlSyCsl49fhASHUL57i5E rYcQ== X-Gm-Message-State: AO0yUKVJvi+qCdGiOoecUrT4FUZNpyg0ytgsuD4056GSUeA4+9KFTqDA MDJCaDzGVLyLBieDt6vIuZYsLSjH7wcgxnssyrIWZA== X-Received: by 2002:a17:90b:38c5:b0:23f:81de:6a77 with SMTP id nn5-20020a17090b38c500b0023f81de6a77mr4981404pjb.28.1679520878075; Wed, 22 Mar 2023 14:34:38 -0700 (PDT) Received: from cabot.adilger.int (S01061cabc081bf83.cg.shawcable.net. [70.77.221.9]) by smtp.gmail.com with ESMTPSA id o5-20020a17090ad24500b00234e6d2de3dsm10206340pjw.11.2023.03.22.14.34.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2023 14:34:37 -0700 (PDT) From: Andreas Dilger Message-Id: <06F8DFC9-26F5-475F-9428-06FED2CA01AA@dilger.ca> Content-Type: multipart/signed; boundary="Apple-Mail=_91D2A469-7A61-4CB1-93C3-4B807A11CBBD"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH v5 0/3] ext4, jbd2: journal cycled record transactions between each mount Date: Wed, 22 Mar 2023 15:34:49 -0600 In-Reply-To: <20230322013353.1843306-1-yi.zhang@huaweicloud.com> Cc: Ext4 Developers List , Theodore Ts'o , Jan Kara , Zhang Yi , yukuai3@huawei.com To: Zhang Yi References: <20230322013353.1843306-1-yi.zhang@huaweicloud.com> X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 --Apple-Mail=_91D2A469-7A61-4CB1-93C3-4B807A11CBBD Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On Mar 21, 2023, at 7:33 PM, Zhang Yi wrote: > This patch set add a new journal option 'JBD2_CYCLE_RECORD' and always > enable on ext4. It saves journal head for a clean unmounted file system > in the journal super block, which could let us record journal > transactions between each mount continuously. It could help us to do > journal backtrack and find root cause from a corrupted filesystem. > Current filesystem's corruption analysis is difficult and less useful > information, especially on the real products. It is useful to some > extent, especially for the cases of doing fuzzy tests and deploy in some > shout-runing products. Another interesting side benefit of this change is that it gets a step closer to the "lazy ext4" (log-structured optimization) that had been described some time ago at FAST: https://lwn.net/Articles/720226/ https://www.usenix.org/system/files/conference/fast17/fast17-aghayev.pdf https://lists.openwall.net/linux-ext4/2017/04/11/1 Essentially, free space in the filesystem (or a large external device) could be used as a continuous journal, and metadata would only rarely be checkpointed to the actual filesystem. If the "journal" is close to wrapping to the start, either the meta/data is checkpointed (if it is no longer actively used or can make a large write), or re-journaled to the end of the journal. At remount time, the full journal is read into memory (discarding old copies of blocks) and this is used to identify the current metadata rather than reading from the filesystem itself. This would allow e.g. very efficient flash caching of metadata (and also journaled data for small writes) for an HDD (or QLC) device. Cheers, Andreas --Apple-Mail=_91D2A469-7A61-4CB1-93C3-4B807A11CBBD Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQIzBAEBCAAdFiEEDb73u6ZejP5ZMprvcqXauRfMH+AFAmQbdHoACgkQcqXauRfM H+CvOxAAs8h7UWeM/XFNozgG2NrYa4eEnPHUxApEP5jcmij0B72Zg48cFi5Nivjg DXPkslM1kDIA7Dn0a94cnwfJT6BXQrpgmhLggZtFnVVILb7+WHUuLx+1hYbILtWa wndRZwnaV3nVWdaEL6HiZlHgmyw9fS+gWXUOSP07Me48Ox8pQVrKJ5ht0uXQszgg ff9DaUCVmTX1OY9JvslqFh84BHCSV3/Q1fMcy8JGile1MBduRLZg2IEi+DvS+FTe Xrwm7BSfD7MdfSSWnt5EbiZibAYNH69cCDIAHPPdDHbLVDRw/HmUcD31+OiOlriz eme991yqCKE4BGxUl01m8WJ4uqCFEvRszAxrOFpLjtuO28xUeTkOgoqTfCwuFVDF ifywPCKZDX9rX06t7D2DSiyupK/vFS88/7cKDraULD7vB6gXJg+sjKzSNRryKUlA o5koFfpl8cVXAyAvARA/lIf1OyVh/jlvFcwhshMPSBh5NuP+OUvxmTdlhN44VRnH e0enPVD+ZSZ4pDAlNYvDzo2FgQ43aCwEBxdL7H3MQ4KPwl4CZT0qwR5u9EehNJHK BX7x/O0d8tG3dMVbfm8juQU9zSvMwgAqBEtQbGRIuKlacXs0rwUHciZyMPkohfQJ 8D5JAJ5cj/yg+WqDno1IivFvYnsxpjgSKx4JC62bEQ7w0q87qcI= =c7GG -----END PGP SIGNATURE----- --Apple-Mail=_91D2A469-7A61-4CB1-93C3-4B807A11CBBD--