[{"id":3674974,"web_url":"http://patchwork.ozlabs.org/comment/3674974/","msgid":"<20260408160405.45a5ee09@gandalf.local.home>","list_archive_url":null,"date":"2026-04-08T20:04:05","subject":"Re: [RFC v6 6/7] ext4: fast commit: add lock_updates tracepoint","submitter":{"id":112,"url":"http://patchwork.ozlabs.org/api/people/112/","name":"Steven Rostedt","email":"rostedt@goodmis.org"},"content":"On Wed,  8 Apr 2026 19:20:17 +0800\nLi Chen <me@linux.beauty> wrote:\n\n> Commit-time fast commit snapshots run under jbd2_journal_lock_updates(),\n> so it is useful to quantify the time spent with updates locked and to\n> understand why snapshotting can fail.\n> \n> Add a new tracepoint, ext4_fc_lock_updates, reporting the time spent in\n> the updates-locked window along with the number of snapshotted inodes\n> and ranges. Record the first snapshot failure reason in a stable snap_err\n> field for tooling.\n> \n\n[..]\n\n> @@ -1338,13 +1375,13 @@ static int ext4_fc_perform_commit(journal_t *journal)\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> -\n>  \tret = ext4_fc_alloc_snapshot_inodes(sb, &inodes, &inodes_size);\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n>  \t/* Step 4: Mark all inodes as being committed. */\n>  \tjbd2_journal_lock_updates(journal);\n> +\tlock_start = ktime_get();\n\nktime_get() is rather quick but if you care about micro-optimizations, you\ncould have:\n\n\tif (trace_ext4_fc_lock_updates_enabled())\n\t\tlock_start = ktime_get();\n\telse\t\n\t\tlock_start = 0;\n\n>  \t/*\n>  \t * The journal is now locked. No more handles can start and all the\n>  \t * previous handles are now drained. Snapshotting happens in this\n> @@ -1358,8 +1395,15 @@ static int ext4_fc_perform_commit(journal_t *journal)\n>  \t}\n>  \text4_fc_unlock(sb, alloc_ctx);\n>  \n> -\tret = ext4_fc_snapshot_inodes(journal, inodes, inodes_size);\n> +\tret = ext4_fc_snapshot_inodes(journal, inodes, inodes_size,\n> +\t\t\t\t      &snap_inodes, &snap_ranges, &snap_err);\n>  \tjbd2_journal_unlock_updates(journal);\n> +\tif (trace_ext4_fc_lock_updates_enabled()) {\n\n\tif (trace_ext4_fc_lock_updates_enabled() && lock_start) {\n\nBut feel free to ignore this if the overhead of always calling ktime_get()\nis not an issue.\n\n\n> +\t\tlocked_ns = ktime_to_ns(ktime_sub(ktime_get(), lock_start));\n> +\t\ttrace_ext4_fc_lock_updates(sb, commit_tid, locked_ns,\n> +\t\t\t\t\t   snap_inodes, snap_ranges, ret,\n> +\t\t\t\t\t   snap_err);\n> +\t}\n>  \tkvfree(inodes);\n>  \tif (ret)\n>  \t\treturn ret;\n> @@ -1564,7 +1608,7 @@ int ext4_fc_commit(journal_t *journal, tid_t commit_tid)\n>  \t\tjournal_ioprio = EXT4_DEF_JOURNAL_IOPRIO;\n>  \tset_task_ioprio(current, journal_ioprio);\n>  \tfc_bufs_before = (sbi->s_fc_bytes + bsize - 1) / bsize;\n> -\tret = ext4_fc_perform_commit(journal);\n> +\tret = ext4_fc_perform_commit(journal, commit_tid);\n>  \tif (ret < 0) {\n>  \t\tif (ret == -EAGAIN || ret == -E2BIG || ret == -ECANCELED)\n>  \t\t\tstatus = EXT4_FC_STATUS_INELIGIBLE;\n> diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h\n> index f493642cf121..7028a28316fa 100644\n> --- a/include/trace/events/ext4.h\n> +++ b/include/trace/events/ext4.h\n> @@ -107,6 +107,26 @@ TRACE_DEFINE_ENUM(EXT4_FC_REASON_VERITY);\n>  TRACE_DEFINE_ENUM(EXT4_FC_REASON_MOVE_EXT);\n>  TRACE_DEFINE_ENUM(EXT4_FC_REASON_MAX);\n>  \n> +#undef EM\n> +#undef EMe\n> +#define EM(a)\tTRACE_DEFINE_ENUM(EXT4_FC_SNAP_ERR_##a);\n> +#define EMe(a)\tTRACE_DEFINE_ENUM(EXT4_FC_SNAP_ERR_##a);\n> +\n> +#define TRACE_SNAP_ERR\t\t\t\t\t\t\\\n> +\tEM(NONE)\t\t\t\t\t\t\\\n> +\tEM(ES_MISS)\t\t\t\t\t\t\\\n> +\tEM(ES_DELAYED)\t\t\t\t\t\t\\\n> +\tEM(ES_OTHER)\t\t\t\t\t\t\\\n> +\tEM(INODES_CAP)\t\t\t\t\t\t\\\n> +\tEM(RANGES_CAP)\t\t\t\t\t\t\\\n> +\tEM(NOMEM)\t\t\t\t\t\t\\\n> +\tEMe(INODE_LOC)\n> +\n> +TRACE_SNAP_ERR\n> +\n> +#undef EM\n> +#undef EMe\n> +\n>  #define show_fc_reason(reason)\t\t\t\t\t\t\\\n>  \t__print_symbolic(reason,\t\t\t\t\t\\\n>  \t\t{ EXT4_FC_REASON_XATTR,\t\t\"XATTR\"},\t\t\\\n> @@ -2818,6 +2838,47 @@ TRACE_EVENT(ext4_fc_commit_stop,\n>  \t\t  __entry->num_fc_ineligible, __entry->nblks_agg, __entry->tid)\n>  );\n>  \n> +#define EM(a)\t{ EXT4_FC_SNAP_ERR_##a, #a },\n> +#define EMe(a)\t{ EXT4_FC_SNAP_ERR_##a, #a }\n> +\n> +TRACE_EVENT(ext4_fc_lock_updates,\n> +\t    TP_PROTO(struct super_block *sb, tid_t commit_tid, u64 locked_ns,\n> +\t\t     unsigned int nr_inodes, unsigned int nr_ranges, int err,\n> +\t\t     int snap_err),\n> +\n> +\tTP_ARGS(sb, commit_tid, locked_ns, nr_inodes, nr_ranges, err, snap_err),\n> +\n> +\tTP_STRUCT__entry(/* entry */\n> +\t\t__field(dev_t, dev)\n> +\t\t__field(tid_t, tid)\n> +\t\t__field(u64, locked_ns)\n> +\t\t__field(unsigned int, nr_inodes)\n> +\t\t__field(unsigned int, nr_ranges)\n> +\t\t__field(int, err)\n> +\t\t__field(int, snap_err)\n> +\t),\n> +\n> +\tTP_fast_assign(/* assign */\n> +\t\t__entry->dev = sb->s_dev;\n> +\t\t__entry->tid = commit_tid;\n> +\t\t__entry->locked_ns = locked_ns;\n> +\t\t__entry->nr_inodes = nr_inodes;\n> +\t\t__entry->nr_ranges = nr_ranges;\n> +\t\t__entry->err = err;\n> +\t\t__entry->snap_err = snap_err;\n> +\t),\n> +\n> +\tTP_printk(\"dev %d,%d tid %u locked_ns %llu nr_inodes %u nr_ranges %u err %d snap_err %s\",\n> +\t\t  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid,\n> +\t\t  __entry->locked_ns, __entry->nr_inodes, __entry->nr_ranges,\n> +\t\t  __entry->err, __print_symbolic(__entry->snap_err,\n> +\t\t\t\t\t\t TRACE_SNAP_ERR))\n> +);\n> +\n> +#undef EM\n> +#undef EMe\n> +#undef TRACE_SNAP_ERR\n> +\n>  #define FC_REASON_NAME_STAT(reason)\t\t\t\t\t\\\n>  \tshow_fc_reason(reason),\t\t\t\t\t\t\\\n>  \t__entry->fc_ineligible_rc[reason]\n\nAs for the rest:\n\nReviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>\n\n[ Please add this reviewed-by to any new versions so I remember I already\n  looked at it. ]\n\nThanks,\n\n-- Steve","headers":{"Return-Path":"\n <SRS0=DmCb=CH=vger.kernel.org=linux-ext4+bounces-15687-patchwork-incoming=ozlabs.org@ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-ext4@vger.kernel.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","patchwork-incoming@ozlabs.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=150.107.74.76; helo=mail.ozlabs.org;\n envelope-from=srs0=dmcb=ch=vger.kernel.org=linux-ext4+bounces-15687-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)","gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c15:e001:75::12fc:5321\"\n arc.chain=subspace.kernel.org","gandalf.ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=goodmis.org","gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15687-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=216.40.44.17","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=goodmis.org","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=goodmis.org"],"Received":["from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frZ4d6XPKz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 06:13:05 +1000 (AEST)","from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4frZ4d2CWsz4wT4\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 06:13:05 +1000 (AEST)","by gandalf.ozlabs.org (Postfix)\n\tid 4frZ4d27P6z4wTh; Thu, 09 Apr 2026 06:13:05 +1000 (AEST)","from sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4frZ4Y5zwlz4wT4\n\tfor <patchwork-incoming@ozlabs.org>; Thu, 09 Apr 2026 06:13:01 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id A3D69301AA82\n\tfor <patchwork-incoming@ozlabs.org>; Wed,  8 Apr 2026 20:05:48 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 9150438D6A2;\n\tWed,  8 Apr 2026 20:03:01 +0000 (UTC)","from relay.hostedemail.com (smtprelay0017.hostedemail.com\n [216.40.44.17])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id BF13038D007;\n\tWed,  8 Apr 2026 20:02:59 +0000 (UTC)","from omf20.hostedemail.com (a10.router.float.18 [10.200.18.1])\n\tby unirelay02.hostedemail.com (Postfix) with ESMTP id D3F52138162;\n\tWed,  8 Apr 2026 20:02:51 +0000 (UTC)","from [HIDDEN] (Authenticated sender: rostedt@goodmis.org) by\n omf20.hostedemail.com (Postfix) with ESMTPA id F130320026;\n\tWed,  8 Apr 2026 20:02:48 +0000 (UTC)"],"ARC-Seal":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1775679185; cv=pass;\n\tb=xfCPs0OHXjeIquDZvmDBx6C65ZuFYZnjTNc4IVluNY7rY+8BqysZX/0eltJC+iy6gYZiqn6NX7eOTDPuMeitDcpuBETeEMbMd80Rc32GS49h/3HmuJf+aAYNdwyGKqvFGLDp5xfMH597P2RPthwys+d1r2GBxVWPXFGtGKUd2cPG0h9YIRaqxtz4o/ZguzH28yRNCt4HOu9B5tQc1DE/fF282KkA1J8wfWI48iKtJEf6TShrRLjeFk3IIjPmDomV6gfrX5iGoAKDOlOKyRRvVEqqDEq9OIdaSb7sXlyo5hAv4Kv/8xTb+ZvK6HR6xMEzosdIMZIW5zLhkxvIiX12Xg==","i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775678581; cv=none;\n b=TjzvU0YnM6c0WqZ+i1Sx2KRAyBvhIbjHmQvif0ybwC+EMfSO1jzpTdOCRdvctdzrofCXXDEAlXeNREWroXr90ecZ4TiUDWXYOzpL/bwoZFOt4qSuK7YFC+PQUNm3A2OzjKoGqUmBxMPNrGCQ1AFfCY83HaU9H2l0lBBeNYfnXyk="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1775679185; c=relaxed/relaxed;\n\tbh=C0Jmd5jh51B0Aj7Q3wA5/VzUmQ3Dy+DeXVHclWplLX4=;\n\th=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=ZDu7o45emPsuJzrbdLMWBFqfq23zwWj0fUplS2+gYBR8Z1K1NTRNTXh3cXQZP3lbcx+q5yBqDIT6hfZE0bWc0wOggpHdFKu8W/wnCxRGITFDM4BSM8G6y5M0ac9nkCjVnWdCU/1wtgSGcuvSeskA3Fgqz2cNvdRBdrQ12UZRMPZU9W42+2RWgVCz7Y0jygzMFmvSNMqJs2dl/m5hcHgtsl1oZdIBIOP0cvMcBnh8Cfrux1cs54YiyxocUl068RRHjCcMGgq3fqpVSazMY4nUrXO3NfF9liSD4UqDtzryzfT0JLm0uRVk/1okrpvhNaHfU7XiYf7aPdOJFDCNfAIhQg==","i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775678581; c=relaxed/simple;\n\tbh=yI0gf8gI4SVLBBvRbXbDhKekxGCVbzCyZg+rugJd84Y=;\n\th=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=nf0uSv5eASdRcMaR8R7ZdQtxbaXhpad90HcZjdaJ6HwyXzJUew0IgDcXNfALMswDnehj1GKaZMds4q5XRSy8AXgRNsDcvDdYVU2kUwmC94f3m4C6VJA3124+yDOEeLwii4L74nBV6axPGj+tFTOb//avi+xVxSJT94TxoA0Qmaw="],"ARC-Authentication-Results":["i=2; gandalf.ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=goodmis.org;\n spf=pass (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15687-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org","i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=goodmis.org;\n spf=pass smtp.mailfrom=goodmis.org; arc=none smtp.client-ip=216.40.44.17"],"Date":"Wed, 8 Apr 2026 16:04:05 -0400","From":"Steven Rostedt <rostedt@goodmis.org>","To":"Li Chen <me@linux.beauty>","Cc":"Zhang Yi <yi.zhang@huaweicloud.com>, Theodore Ts'o <tytso@mit.edu>,\n Andreas Dilger <adilger.kernel@dilger.ca>, Baokun Li\n <libaokun@linux.alibaba.com>, Jan Kara <jack@suse.cz>, Ojaswin Mujoo\n <ojaswin@linux.ibm.com>, \"Ritesh Harjani (IBM)\" <ritesh.list@gmail.com>,\n Zhang Yi <yi.zhang@huawei.com>, Masami Hiramatsu <mhiramat@kernel.org>,\n Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,\n linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,\n linux-trace-kernel@vger.kernel.org","Subject":"Re: [RFC v6 6/7] ext4: fast commit: add lock_updates tracepoint","Message-ID":"<20260408160405.45a5ee09@gandalf.local.home>","In-Reply-To":"<20260408112020.716706-7-me@linux.beauty>","References":"<20260408112020.716706-1-me@linux.beauty>\n\t<20260408112020.716706-7-me@linux.beauty>","X-Mailer":"Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu)","Precedence":"bulk","X-Mailing-List":"linux-ext4@vger.kernel.org","List-Id":"<linux-ext4.vger.kernel.org>","List-Subscribe":"<mailto:linux-ext4+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-ext4+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","X-Rspamd-Queue-Id":"F130320026","X-Rspamd-Server":"rspamout06","X-Stat-Signature":"31f3wkxzr7b1o9rbmffjuiurwxs7afg4","X-Session-Marker":"726F737465647440676F6F646D69732E6F7267","X-Session-ID":"U2FsdGVkX1+fNRqLMKHLva9mfCIRC3qtfuY8KaONfJs=","X-HE-Tag":"1775678568-265512","X-HE-Meta":"\n U2FsdGVkX18aAJWzRtF34Vi9zUSLx49mvEH+R9xkDO1iO/T6NoLAGMimOxsRrT7nU6Ww9B/VRzMcJV6Mhkj9S3CAE7VXwLM0CbV9tiELPqIsbXoPnmAX1saMakuxvCU4wDOMZvzzXJbkk/5n10QK0/9uR0sy7KPhBlLWaXbS7Y8Ky0SM7gXd5ht0si9JNB0k8ltzMrKVZGoOjag1lVH05TUd9HNc/LRPBgf4jUJT41C8Kzvik3MPSLVshoYDL3FdZINYV7wTl/GDG15bKQcuo0SFvkUX9MotBS8QhjogsaRPUnA/K5ppkBnIwsfmwApC7N/jCTdCdU5nYPMtyRTapTC3iuBh8SztvyrAciTFUvAWLD5Z4SY8qhA9ZF8AGVF9","X-Spam-Status":"No, score=-0.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDMARC_NONE,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,\n\tSPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=disabled\n\tversion=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"}},{"id":3676732,"web_url":"http://patchwork.ozlabs.org/comment/3676732/","msgid":"<19d86ebd732.2bd14e621132527.1624681536327289755@linux.beauty>","list_archive_url":null,"date":"2026-04-13T12:58:16","subject":"Re: [RFC v6 6/7] ext4: fast commit: add lock_updates tracepoint","submitter":{"id":84264,"url":"http://patchwork.ozlabs.org/api/people/84264/","name":"Li Chen","email":"me@linux.beauty"},"content":"Hi Steven,\n\n ---- On Thu, 09 Apr 2026 04:02:56 +0800  Steven Rostedt <rostedt@goodmis.org> wrote --- \n > On Wed,  8 Apr 2026 19:20:17 +0800\n > Li Chen <me@linux.beauty> wrote:\n > \n > > Commit-time fast commit snapshots run under jbd2_journal_lock_updates(),\n > > so it is useful to quantify the time spent with updates locked and to\n > > understand why snapshotting can fail.\n > > \n > > Add a new tracepoint, ext4_fc_lock_updates, reporting the time spent in\n > > the updates-locked window along with the number of snapshotted inodes\n > > and ranges. Record the first snapshot failure reason in a stable snap_err\n > > field for tooling.\n > > \n > \n > [..]\n > \n > > @@ -1338,13 +1375,13 @@ static int ext4_fc_perform_commit(journal_t *journal)\n > >      if (ret)\n > >          return ret;\n > >  \n > > -\n > >      ret = ext4_fc_alloc_snapshot_inodes(sb, &inodes, &inodes_size);\n > >      if (ret)\n > >          return ret;\n > >  \n > >      /* Step 4: Mark all inodes as being committed. */\n > >      jbd2_journal_lock_updates(journal);\n > > +    lock_start = ktime_get();\n > \n > ktime_get() is rather quick but if you care about micro-optimizations, you\n > could have:\n > \n >     if (trace_ext4_fc_lock_updates_enabled())\n >         lock_start = ktime_get();\n >     else    \n >         lock_start = 0;\n > \n > >      /*\n > >       * The journal is now locked. No more handles can start and all the\n > >       * previous handles are now drained. Snapshotting happens in this\n > > @@ -1358,8 +1395,15 @@ static int ext4_fc_perform_commit(journal_t *journal)\n > >      }\n > >      ext4_fc_unlock(sb, alloc_ctx);\n > >  \n > > -    ret = ext4_fc_snapshot_inodes(journal, inodes, inodes_size);\n > > +    ret = ext4_fc_snapshot_inodes(journal, inodes, inodes_size,\n > > +                      &snap_inodes, &snap_ranges, &snap_err);\n > >      jbd2_journal_unlock_updates(journal);\n > > +    if (trace_ext4_fc_lock_updates_enabled()) {\n > \n >     if (trace_ext4_fc_lock_updates_enabled() && lock_start) {\n > \n > But feel free to ignore this if the overhead of always calling ktime_get()\n > is not an issue.\n > \n > \n > > +        locked_ns = ktime_to_ns(ktime_sub(ktime_get(), lock_start));\n > > +        trace_ext4_fc_lock_updates(sb, commit_tid, locked_ns,\n > > +                       snap_inodes, snap_ranges, ret,\n > > +                       snap_err);\n > > +    }\n > >      kvfree(inodes);\n > >      if (ret)\n > >          return ret;\n > > @@ -1564,7 +1608,7 @@ int ext4_fc_commit(journal_t *journal, tid_t commit_tid)\n > >          journal_ioprio = EXT4_DEF_JOURNAL_IOPRIO;\n > >      set_task_ioprio(current, journal_ioprio);\n > >      fc_bufs_before = (sbi->s_fc_bytes + bsize - 1) / bsize;\n > > -    ret = ext4_fc_perform_commit(journal);\n > > +    ret = ext4_fc_perform_commit(journal, commit_tid);\n > >      if (ret < 0) {\n > >          if (ret == -EAGAIN || ret == -E2BIG || ret == -ECANCELED)\n > >              status = EXT4_FC_STATUS_INELIGIBLE;\n > > diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h\n > > index f493642cf121..7028a28316fa 100644\n > > --- a/include/trace/events/ext4.h\n > > +++ b/include/trace/events/ext4.h\n > > @@ -107,6 +107,26 @@ TRACE_DEFINE_ENUM(EXT4_FC_REASON_VERITY);\n > >  TRACE_DEFINE_ENUM(EXT4_FC_REASON_MOVE_EXT);\n > >  TRACE_DEFINE_ENUM(EXT4_FC_REASON_MAX);\n > >  \n > > +#undef EM\n > > +#undef EMe\n > > +#define EM(a)    TRACE_DEFINE_ENUM(EXT4_FC_SNAP_ERR_##a);\n > > +#define EMe(a)    TRACE_DEFINE_ENUM(EXT4_FC_SNAP_ERR_##a);\n > > +\n > > +#define TRACE_SNAP_ERR                        \\\n > > +    EM(NONE)                        \\\n > > +    EM(ES_MISS)                        \\\n > > +    EM(ES_DELAYED)                        \\\n > > +    EM(ES_OTHER)                        \\\n > > +    EM(INODES_CAP)                        \\\n > > +    EM(RANGES_CAP)                        \\\n > > +    EM(NOMEM)                        \\\n > > +    EMe(INODE_LOC)\n > > +\n > > +TRACE_SNAP_ERR\n > > +\n > > +#undef EM\n > > +#undef EMe\n > > +\n > >  #define show_fc_reason(reason)                        \\\n > >      __print_symbolic(reason,                    \\\n > >          { EXT4_FC_REASON_XATTR,        \"XATTR\"},        \\\n > > @@ -2818,6 +2838,47 @@ TRACE_EVENT(ext4_fc_commit_stop,\n > >            __entry->num_fc_ineligible, __entry->nblks_agg, __entry->tid)\n > >  );\n > >  \n > > +#define EM(a)    { EXT4_FC_SNAP_ERR_##a, #a },\n > > +#define EMe(a)    { EXT4_FC_SNAP_ERR_##a, #a }\n > > +\n > > +TRACE_EVENT(ext4_fc_lock_updates,\n > > +        TP_PROTO(struct super_block *sb, tid_t commit_tid, u64 locked_ns,\n > > +             unsigned int nr_inodes, unsigned int nr_ranges, int err,\n > > +             int snap_err),\n > > +\n > > +    TP_ARGS(sb, commit_tid, locked_ns, nr_inodes, nr_ranges, err, snap_err),\n > > +\n > > +    TP_STRUCT__entry(/* entry */\n > > +        __field(dev_t, dev)\n > > +        __field(tid_t, tid)\n > > +        __field(u64, locked_ns)\n > > +        __field(unsigned int, nr_inodes)\n > > +        __field(unsigned int, nr_ranges)\n > > +        __field(int, err)\n > > +        __field(int, snap_err)\n > > +    ),\n > > +\n > > +    TP_fast_assign(/* assign */\n > > +        __entry->dev = sb->s_dev;\n > > +        __entry->tid = commit_tid;\n > > +        __entry->locked_ns = locked_ns;\n > > +        __entry->nr_inodes = nr_inodes;\n > > +        __entry->nr_ranges = nr_ranges;\n > > +        __entry->err = err;\n > > +        __entry->snap_err = snap_err;\n > > +    ),\n > > +\n > > +    TP_printk(\"dev %d,%d tid %u locked_ns %llu nr_inodes %u nr_ranges %u err %d snap_err %s\",\n > > +          MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid,\n > > +          __entry->locked_ns, __entry->nr_inodes, __entry->nr_ranges,\n > > +          __entry->err, __print_symbolic(__entry->snap_err,\n > > +                         TRACE_SNAP_ERR))\n > > +);\n > > +\n > > +#undef EM\n > > +#undef EMe\n > > +#undef TRACE_SNAP_ERR\n > > +\n > >  #define FC_REASON_NAME_STAT(reason)                    \\\n > >      show_fc_reason(reason),                        \\\n > >      __entry->fc_ineligible_rc[reason]\n > \n > As for the rest:\n > \n > Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>\n > \n > [ Please add this reviewed-by to any new versions so I remember I already\n >   looked at it. ]\n\nSure, thanks a lot for your thoughtful review!\n\nRegards,\nLi​","headers":{"Return-Path":"\n <SRS0=xW+E=CM=vger.kernel.org=linux-ext4+bounces-15810-patchwork-incoming=ozlabs.org@ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-ext4@vger.kernel.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","patchwork-incoming@ozlabs.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=linux.beauty header.i=me@linux.beauty\n header.a=rsa-sha256 header.s=zmail header.b=KuvYusmn;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org;\n envelope-from=srs0=xw+e=cm=vger.kernel.org=linux-ext4+bounces-15810-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)","gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=172.234.253.10\n arc.chain=\"subspace.kernel.org:zohomail.com\"","gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.beauty","gandalf.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=linux.beauty header.i=me@linux.beauty\n header.a=rsa-sha256 header.s=zmail header.b=KuvYusmn;\n\tdkim-atps=neutral","gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15810-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty\n header.b=\"KuvYusmn\"","smtp.subspace.kernel.org;\n arc=pass smtp.client-ip=136.143.188.12","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.beauty","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.beauty"],"Received":["from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvSKX57Thz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 23:04:16 +1000 (AEST)","from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4fvSKW71BNz4wCx\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 23:04:15 +1000 (AEST)","by gandalf.ozlabs.org (Postfix)\n\tid 4fvSKW6tgfz4wHp; Mon, 13 Apr 2026 23:04:15 +1000 (AEST)","from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4fvSKR5YBzz4wCx\n\tfor <patchwork-incoming@ozlabs.org>; Mon, 13 Apr 2026 23:04:11 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id EB0493034DEA\n\tfor <patchwork-incoming@ozlabs.org>; Mon, 13 Apr 2026 12:58:50 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 48E973C9EF1;\n\tMon, 13 Apr 2026 12:58:49 +0000 (UTC)","from sender4-op-o12.zoho.com (sender4-op-o12.zoho.com\n [136.143.188.12])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D98835B659;\n\tMon, 13 Apr 2026 12:58:47 +0000 (UTC)","from mail.zoho.com by mx.zohomail.com\n\twith SMTP id 1776085096273431.4644491260433;\n Mon, 13 Apr 2026 05:58:16 -0700 (PDT)"],"ARC-Seal":["i=3; a=rsa-sha256; d=ozlabs.org; s=201707; t=1776085455; cv=pass;\n\tb=asv9N0uO+g6tc4d9TxLxJl/oBAcUBF1K/2vXWlcBTc5txie9eJfSH8REhdsuPVvl6SYnBomvz/To2LltbPkBrPraD/NI1hTQ614bTfMAWdbkOXcHXr/KhOCY1qkT78ouiaUR77SA66XTGo0rrIOr/+IpjOiI1adtFsO22d2883AnF0nWUfxeIgpPtEGH4a8FfoFH0mhxEHdWIE2tEoOCe9AjKGke9QnjjMWL4Id+srPu9zYyVVH1/J8FHPXQ9gVtvEAvOR9mDEueEdHIVZ3pqteqCMhO7R5atXatZaiRP7KyF6JToSEYovHLUeH3BXnVeHh/76cPxOM5N8ZEXpZydA==","i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776085129; cv=pass;\n b=sZ6STDBauFdm2QNjv1LN/zZ5FeukeUqSfeh1X1M5gRjLl1fYgvH9yD7CcmipQTqmxgfZxi5bSCvZEoj9/5/cRsyPCoW5wovd8uWzqe1rRePO+j19qs2juUjkRsOg7p2tmf7Pa8J5z0sI4e3p+klvv7BRpYPNsV4jbJgqxkz4kUk=","i=1; a=rsa-sha256; t=1776085102; cv=none;\n\td=zohomail.com; s=zohoarc;\n\tb=EahS+tTmOMhjHbCFylZeg8F4L/JY36UK1o4kXT92fLJkWv3wVtJJhYvq7LVH9WnXw+PooVI1bABe7zUJoep6vatPlnGBOVfGtuXsuuwLQ2CymrdWDEMYv1AuEJ8wlPVRP3TS3c5Ef3RJHzI2Xz6UMqBe+Evw4ZRVoro2+YUwjAw="],"ARC-Message-Signature":["i=3; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1776085455; c=relaxed/relaxed;\n\tbh=HrbHs38rBBU+0LG97kiTuX3QSRvWfEGGGf9SzO2HNr8=;\n\th=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject:\n\t MIME-Version:Content-Type;\n b=PhkbLwghBSlBdWBa9zPLPwa8QOwJHchBNfCxmOaTOQ/we9gvOOOZhjy4eqtWm2uhqBjuja5Akb8xPrq2iRfRdO49vDPYKCZDS+wuoyVyZtauJAfbFnRxH/E1V3jtBqiW1dWSAKFRw91fQklXWCoVmvXo+FGSiDLlCLBe1G0rmwtGGYLlxPST8Tnmdxi0om0RJqBrRMZMaM9ttBQdu8AKDXuGUovWytupuBTSUl+A6AKLgLS4hTgGCQSLOMvsbLp08g3Ap+89ZuwZZCxHfTe9I+pCMyFomTOCVDPvYWe84bTwul3v2I+GtBd1dl/zETpWKe3iQCbcPfh08WcS87rHvg==","i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776085129; c=relaxed/simple;\n\tbh=cXdkLXwq7Xwzvgz37Nv3CF3yfZGhaoPAQ/lX82GVBoE=;\n\th=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject:\n\t MIME-Version:Content-Type;\n b=tR2NcK6heCqDy/J6dLsbda50zgyodrzW678Am043g9IYCwEUiSxK8MoNcBZxHg6GaOXggsARUTjxFplP+YcxmqJevH9GD2Y49PGuUeUsqzM98GAd/bqGVmH5DchUfqr7lGHwjV+1uyhFjHLVMbSxB0KfwPxTxMUYAbJzxiT5PL8=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;\n s=zohoarc;\n\tt=1776085102;\n h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To;\n\tbh=HrbHs38rBBU+0LG97kiTuX3QSRvWfEGGGf9SzO2HNr8=;\n\tb=bokMICCH17SFPFG/eYFkmL9sTfUKwaPX7Gpt56nPqhIwaTS0bbda7VxglCe7JKHsW4f2iA6UK1RT+xwCMnX3UTspKpJkJ6b5+eJ3I9lejrRX9c2PCf8Bq/rth2g+GYCIyApp7M1/7I/XFRd/ssjy6FE+U0unZ3vwndbyM/hmqTw="],"ARC-Authentication-Results":["i=3; gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.beauty;\n dkim=pass (1024-bit key;\n unprotected) header.d=linux.beauty header.i=me@linux.beauty\n header.a=rsa-sha256 header.s=zmail header.b=KuvYusmn; dkim-atps=neutral;\n spf=pass (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15810-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org","i=2; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.beauty;\n spf=pass smtp.mailfrom=linux.beauty;\n dkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty\n header.b=KuvYusmn; arc=pass smtp.client-ip=136.143.188.12","i=1; mx.zohomail.com;\n\tdkim=pass  header.i=linux.beauty;\n\tspf=pass  smtp.mailfrom=me@linux.beauty;\n\tdmarc=pass header.from=<me@linux.beauty>"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1776085102;\n\ts=zmail; d=linux.beauty; i=me@linux.beauty;\n\th=Date:Date:From:From:To:To:Cc:Cc:Message-ID:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;\n\tbh=HrbHs38rBBU+0LG97kiTuX3QSRvWfEGGGf9SzO2HNr8=;\n\tb=KuvYusmnvMWHG2CK9ks0zzE64smUUTSZRoX9TqZmDfrv3FLGI8W/jjMejLgFCKQj\n\tPleDfRdzHBjaiH1BWqebnTsumvsw6i60RI+NWAvGOoWDiLd0oov7eitZv5VSW0yoZB+\n\tsnAPiyY8QzwUbZFSufQ4UxZ7TEl+JvniP+5PIlnQ=","Date":"Mon, 13 Apr 2026 20:58:16 +0800","From":"Li Chen <me@linux.beauty>","To":"\"Steven Rostedt\" <rostedt@goodmis.org>","Cc":"\"Zhang Yi\" <yi.zhang@huaweicloud.com>, \"Theodore Ts'o\" <tytso@mit.edu>,\n\t\"Andreas Dilger\" <adilger.kernel@dilger.ca>,\n\t\"Baokun Li\" <libaokun@linux.alibaba.com>, \"Jan Kara\" <jack@suse.cz>,\n\t\"Ojaswin Mujoo\" <ojaswin@linux.ibm.com>,\n\t\"Ritesh Harjani\" <ritesh.list@gmail.com>,\n\t\"Zhang Yi\" <yi.zhang@huawei.com>,\n\t\"Masami Hiramatsu\" <mhiramat@kernel.org>,\n\t\"Mathieu Desnoyers\" <mathieu.desnoyers@efficios.com>,\n\t\"linux-ext4\" <linux-ext4@vger.kernel.org>,\n\t\"linux-kernel\" <linux-kernel@vger.kernel.org>,\n\t\"linux-trace-kernel\" <linux-trace-kernel@vger.kernel.org>","Message-ID":"<19d86ebd732.2bd14e621132527.1624681536327289755@linux.beauty>","In-Reply-To":"<20260408160405.45a5ee09@gandalf.local.home>","References":"<20260408112020.716706-1-me@linux.beauty>\n\t<20260408112020.716706-7-me@linux.beauty>\n <20260408160405.45a5ee09@gandalf.local.home>","Subject":"Re: [RFC v6 6/7] ext4: fast commit: add lock_updates tracepoint","Precedence":"bulk","X-Mailing-List":"linux-ext4@vger.kernel.org","List-Id":"<linux-ext4.vger.kernel.org>","List-Subscribe":"<mailto:linux-ext4+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-ext4+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","Importance":"Medium","User-Agent":"Zoho Mail","X-Mailer":"Zoho Mail","X-Spam-Status":"No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tHEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,\n\tSPF_PASS autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"}}]