Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4660871pxu; Tue, 13 Oct 2020 04:13:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhxJtfIYZhqMnmP3zfcsvDcOUKP9bdD+8yuIo2ZiqNlWgOmojs9sXfcp0u3KcLR50lBdCI X-Received: by 2002:a05:6402:396:: with SMTP id o22mr19405661edv.361.1602587630535; Tue, 13 Oct 2020 04:13:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602587630; cv=none; d=google.com; s=arc-20160816; b=GiwIKkIPHZyqNS6dzoVFel1f9QVZMkT1E/6/rPkUlR81Ik7fcxpwo0XMRVRXJUcRPm RH5k+xLMVqu3tXaWzFRg9yge2IJ3z86OITF72TpuwnZN0CSHUT9wY4Tm73XgrQN6Rztj RF9S0F6qc7BgSBxdaHsXrRa5XtcuIThz62eO9q9UPtEK/pR5kMDjTPhMev8HpXUj0n2t eCwfRoMbYcZvQzWugcv6n8Nyq4EKfsWrIe0d0WMcqVfdBclYFjx3dn1pnf3mwDskrgTr CKcNuD8yfquMXrjZB8zvXJ1RlMgMsVOWoc/g30ksxOpR+beYtqU1tONrQejnXkI4/y/3 PL0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Y4Wttd+A0+DB1q6HUUXbh8k60Zb40tfW6j7k43/5AOA=; b=w2ykCicSF+iBiuSM+j9DmFuZfDzIB8icBN4O0A9ZTdIpgYTtm9UqI1YPqlzAmrzqQr nrjDPVRtS3O+L8IYY4yTZH2pddlNYltY36JQD3g+g4VKq78gBBf/pHSBt6AJiiDowizJ LpNDO3YsTLerASzr7+sLTCQDZ+4POYpQXsBSQE4ww1QdrnzDha/Mk1+Sh//UQUtyyRW9 th6qf3b+ddpwDhinMcGGo14agVP5TmqyK9+DVJA7RQDYvfF7D18YhSbDwcbsVWDh7cN8 B+qKMsXXSvoRBmUA0TS1kbkOL79Qe09Cqy6Zqzd6jj6u1q7EmveDxwCtoDx+06xIJB/O jkog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fNi2em0V; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i23si15057951edg.229.2020.10.13.04.13.28; Tue, 13 Oct 2020 04:13:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fNi2em0V; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 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 S1726830AbgJMA1u (ORCPT + 99 others); Mon, 12 Oct 2020 20:27:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726564AbgJMA1u (ORCPT ); Mon, 12 Oct 2020 20:27:50 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 394C2C0613D0 for ; Mon, 12 Oct 2020 17:27:50 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id t25so25744384ejd.13 for ; Mon, 12 Oct 2020 17:27:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Y4Wttd+A0+DB1q6HUUXbh8k60Zb40tfW6j7k43/5AOA=; b=fNi2em0VhNuNBPw5iO5eniJSHBEFpvlalBslHWLsna2DNWo1app6SJIfEgoXRjzjwR 0ykrtTwiDQPrJ/jDmXHyxgatUWrje/8rIGqc+1EH4d5VdAYLMSbn1ci7SvqYOnw2Su4o QZrUqXSLZA10OM0HyhR2GoOz/2jbrkfE0j7qQdQl/FYlOn+/mL6+gKa+mzYNgNLbn5uQ 8zyk3GalwM47YkKfIOYhDGDgZXNqReeovZxqufq3MzwCB/uiLpgGP2jqUrBwGv6Fs0g6 FBLHoehH6i2KFmBqeFq+knrVnqWi9Zr/dVTQbxEqKUu89FNDptF0KYOuw45uWAa2Voje CrTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Y4Wttd+A0+DB1q6HUUXbh8k60Zb40tfW6j7k43/5AOA=; b=U4fCdCj5IV1kG/nPJm1W+ucygLLRJyyDFwiO5o+HWTR9JRrICWQw++Q1XwucliNitE arFatiZFHl7chiJWJgabcXw4JVLy6k/0Bs10rJnA/hlWznKPtCo6XA4DRtdrnCD9ZVEA yw58vV1hZmqhohUNa90DnMo5JfS9G809jzLTF5T6Szk/n7oiU5QisFFf3RiodPmMM7Zg vX8u/71tiQyprEUt1HiUBGvR/L16QYGpnpDc1WGxrI/6hmXt+2UoFSoPSEeY2NL+T4IM 0Llxg37/quxzB/m/3rxEkq6Nm6/4kUlAX95vwth1/5EJ4YmNLKq65eBUe4T7fjX0xIf5 XUsQ== X-Gm-Message-State: AOAM531/OFF3yAfsTn98s26jg7Er94fBe1DVSGo4npNPPdL3x9nUcDec 0bl6ct6cKTYtdKvfKzhqcpMqD7pOh7M9wSukgKSBvVj+lG0= X-Received: by 2002:a17:906:bc98:: with SMTP id lv24mr30385392ejb.545.1602548868870; Mon, 12 Oct 2020 17:27:48 -0700 (PDT) MIME-Version: 1.0 References: <20200919005451.3899779-1-harshadshirwadkar@gmail.com> <20200919005451.3899779-2-harshadshirwadkar@gmail.com> <20201009182835.GN235506@mit.edu> In-Reply-To: <20201009182835.GN235506@mit.edu> From: harshad shirwadkar Date: Mon, 12 Oct 2020 17:27:37 -0700 Message-ID: Subject: Re: [PATCH v9 1/9] doc: update ext4 and journalling docs to include fast commit feature To: "Theodore Y. Ts'o" Cc: Ext4 Developers List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Oct 9, 2020 at 11:28 AM Theodore Y. Ts'o wrote: > > On Fri, Sep 18, 2020 at 05:54:43PM -0700, Harshad Shirwadkar wrote: > > This patch adds necessary documentation for fast commits. > > > > Signed-off-by: Harshad Shirwadkar > > --- > > Documentation/filesystems/ext4/journal.rst | 66 ++++++++++++++++++++++ > > Documentation/filesystems/journalling.rst | 28 +++++++++ > > 2 files changed, 94 insertions(+) > > > > diff --git a/Documentation/filesystems/ext4/journal.rst b/Documentation/filesystems/ext4/journal.rst > > index ea613ee701f5..c2e4d010a201 100644 > > --- a/Documentation/filesystems/ext4/journal.rst > > +++ b/Documentation/filesystems/ext4/journal.rst > > @@ -609,3 +620,58 @@ bytes long (but uses a full block): > > - h\_commit\_nsec > > - Nanoseconds component of the above timestamp. > > > > +Fast commits > > +~~~~~~~~~~~~ > > + > > +Fast commit area is organized as a log of tag tag length values. Each TLV has > > s/tag tag/tag/ ack > > > + > > +File system is free to perform fast commits as and when it wants as long as it > > +gets permission from JBD2 to do so by calling the function > > +:c:func:`jbd2_fc_start()`. Once a fast commit is done, the client > > +file system should tell JBD2 about it by calling :c:func:`jbd2_fc_stop()`. > > +If file system wants JBD2 to perform a full commit immediately after stopping > > +the fast commit it can do so by calling :c:func:`jbd2_fc_stop_do_commit()`. > > +This is useful if fast commit operation fails for some reason and the only way > > +to guarantee consistency is for JBD2 to perform the full traditional commit. > > One of the things which is a bit confusing is that there is a > substantial part of the fast commit functionality which is implemented > in ext4, and not in the jbd2 layer. > > We can't just talk about ext4_fc_start_update() and > ext4_fc_stop_update() here, since it would be a vit of a layering > violation. But some kind of explanation of how a file system would > use the jbd2 fast commit framework would be useful, and the big > picture view of how the ext4 fast commit infrastruction (which is > currently documented in the top-level comments of > fs/ext4/fast_commit.c) fit into jbd2 infrastructure. As we discussed offline, the names "jbd2_fc_start()" and "jbd2_fc_stop()" are kind of confusing. I didn't mean to put any Ext4 specific information here and it sounds like the names "jbd2_fc_start/stop()" should be renamed to something like jbd2_fc_begin_commit() and jbd2_fc_end_commit(). My goal is to add documentation here that explains how a client FS can use JBD2 fast commits. > > Maybe put the big picture explanation in fs/ext4/fast_commit.c and > then put a pointer in journaling.rst to the comments in > fs/ext4/fast_commit.c as an example of how the jbd2 fast_commit > infrastructure would get used (for example, if ocfs2 ever got > interested in doing something similar)? Or maybe we need to move some > of the description from comments in fast_commit.c to a file in > Documentation/filesystems/ext4/fast_commit.rst, perhaps? I like the first option. I'll update the docs accordingly in V10. Thanks, Harshad. > > - Ted