[{"id":3665347,"web_url":"http://patchwork.ozlabs.org/comment/3665347/","msgid":"<20260317122149.5d07132a@gandalf.local.home>","list_archive_url":null,"date":"2026-03-17T16:21:49","subject":"Re: [RFC v5 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 Tue, 17 Mar 2026 16:46:21 +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> Signed-off-by: Li Chen <me@linux.beauty>\n> ---\n>  fs/ext4/ext4.h              | 15 ++++++++\n>  fs/ext4/fast_commit.c       | 71 +++++++++++++++++++++++++++++--------\n>  include/trace/events/ext4.h | 61 +++++++++++++++++++++++++++++++\n>  3 files changed, 132 insertions(+), 15 deletions(-)\n> \n> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h\n> index 68a64fa0be926..b9e146f3dd9e4 100644\n> --- a/fs/ext4/ext4.h\n> +++ b/fs/ext4/ext4.h\n> @@ -1037,6 +1037,21 @@ enum {\n>  \n>  struct ext4_fc_inode_snap;\n>  \n> +/*\n> + * Snapshot failure reasons for ext4_fc_lock_updates tracepoint.\n> + * Keep these stable for tooling.\n> + */\n> +enum ext4_fc_snap_err {\n> +\tEXT4_FC_SNAP_ERR_NONE\t\t= 0,\n> +\tEXT4_FC_SNAP_ERR_ES_MISS\t= 1,\n> +\tEXT4_FC_SNAP_ERR_ES_DELAYED\t= 2,\n> +\tEXT4_FC_SNAP_ERR_ES_OTHER\t= 3,\n> +\tEXT4_FC_SNAP_ERR_INODES_CAP\t= 4,\n> +\tEXT4_FC_SNAP_ERR_RANGES_CAP\t= 5,\n> +\tEXT4_FC_SNAP_ERR_NOMEM\t\t= 6,\n> +\tEXT4_FC_SNAP_ERR_INODE_LOC\t= 7,\n\nYou don't need to explicitly state the assignments, the enum will increment\nthem without them.\n\n> +};\n> +\n>  /*\n>   * fourth extended file system inode data in memory\n>   */\n> diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c\n> index d1eefee609120..4929e2990b292 100644\n> --- a/fs/ext4/fast_commit.c\n> +++ b/fs/ext4/fast_commit.c\n> @@ -193,6 +193,12 @@ static struct kmem_cache *ext4_fc_range_cachep;\n>  #define EXT4_FC_SNAPSHOT_MAX_INODES\t1024\n>  #define EXT4_FC_SNAPSHOT_MAX_RANGES\t2048\n>  \n> +static inline void ext4_fc_set_snap_err(int *snap_err, int err)\n> +{\n> +\tif (snap_err && *snap_err == EXT4_FC_SNAP_ERR_NONE)\n> +\t\t*snap_err = err;\n> +}\n> +\n>  static void ext4_end_buffer_io_sync(struct buffer_head *bh, int uptodate)\n>  {\n>  \tBUFFER_TRACE(bh, \"\");\n> @@ -983,11 +989,12 @@ static void ext4_fc_free_inode_snap(struct inode *inode)\n>  static int ext4_fc_snapshot_inode_data(struct inode *inode,\n>  \t\t\t\t       struct list_head *ranges,\n>  \t\t\t\t       unsigned int nr_ranges_total,\n> -\t\t\t\t       unsigned int *nr_rangesp)\n> +\t\t\t\t       unsigned int *nr_rangesp,\n> +\t\t\t\t       int *snap_err)\n>  {\n>  \tstruct ext4_inode_info *ei = EXT4_I(inode);\n> -\tunsigned int nr_ranges = 0;\n>  \text4_lblk_t start_lblk, end_lblk, cur_lblk;\n> +\tunsigned int nr_ranges = 0;\n>  \n>  \tspin_lock(&ei->i_fc_lock);\n>  \tif (ei->i_fc_lblk_len == 0) {\n> @@ -1010,11 +1017,16 @@ static int ext4_fc_snapshot_inode_data(struct inode *inode,\n>  \t\tstruct ext4_fc_range *range;\n>  \t\text4_lblk_t len;\n>  \n> -\t\tif (!ext4_es_lookup_extent(inode, cur_lblk, NULL, &es, NULL))\n> +\t\tif (!ext4_es_lookup_extent(inode, cur_lblk, NULL, &es, NULL)) {\n> +\t\t\text4_fc_set_snap_err(snap_err, EXT4_FC_SNAP_ERR_ES_MISS);\n>  \t\t\treturn -EAGAIN;\n> +\t\t}\n>  \n> -\t\tif (ext4_es_is_delayed(&es))\n> +\t\tif (ext4_es_is_delayed(&es)) {\n> +\t\t\text4_fc_set_snap_err(snap_err,\n> +\t\t\t\t\t     EXT4_FC_SNAP_ERR_ES_DELAYED);\n>  \t\t\treturn -EAGAIN;\n> +\t\t}\n>  \n>  \t\tlen = es.es_len - (cur_lblk - es.es_lblk);\n>  \t\tif (len > end_lblk - cur_lblk + 1)\n> @@ -1024,12 +1036,17 @@ static int ext4_fc_snapshot_inode_data(struct inode *inode,\n>  \t\t\tcontinue;\n>  \t\t}\n>  \n> -\t\tif (nr_ranges_total + nr_ranges >= EXT4_FC_SNAPSHOT_MAX_RANGES)\n> +\t\tif (nr_ranges_total + nr_ranges >= EXT4_FC_SNAPSHOT_MAX_RANGES) {\n> +\t\t\text4_fc_set_snap_err(snap_err,\n> +\t\t\t\t\t     EXT4_FC_SNAP_ERR_RANGES_CAP);\n>  \t\t\treturn -E2BIG;\n> +\t\t}\n>  \n>  \t\trange = kmem_cache_alloc(ext4_fc_range_cachep, GFP_NOFS);\n> -\t\tif (!range)\n> +\t\tif (!range) {\n> +\t\t\text4_fc_set_snap_err(snap_err, EXT4_FC_SNAP_ERR_NOMEM);\n>  \t\t\treturn -ENOMEM;\n> +\t\t}\n>  \t\tnr_ranges++;\n>  \n>  \t\trange->lblk = cur_lblk;\n> @@ -1054,6 +1071,7 @@ static int ext4_fc_snapshot_inode_data(struct inode *inode,\n>  \t\t\t\trange->len = max;\n>  \t\t} else {\n>  \t\t\tkmem_cache_free(ext4_fc_range_cachep, range);\n> +\t\t\text4_fc_set_snap_err(snap_err, EXT4_FC_SNAP_ERR_ES_OTHER);\n>  \t\t\treturn -EAGAIN;\n>  \t\t}\n>  \n> @@ -1070,7 +1088,7 @@ static int ext4_fc_snapshot_inode_data(struct inode *inode,\n>  \n>  static int ext4_fc_snapshot_inode(struct inode *inode,\n>  \t\t\t\t  unsigned int nr_ranges_total,\n> -\t\t\t\t  unsigned int *nr_rangesp)\n> +\t\t\t\t  unsigned int *nr_rangesp, int *snap_err)\n>  {\n>  \tstruct ext4_inode_info *ei = EXT4_I(inode);\n>  \tstruct ext4_fc_inode_snap *snap;\n> @@ -1082,8 +1100,10 @@ static int ext4_fc_snapshot_inode(struct inode *inode,\n>  \tint alloc_ctx;\n>  \n>  \tret = ext4_get_inode_loc_noio(inode, &iloc);\n> -\tif (ret)\n> +\tif (ret) {\n> +\t\text4_fc_set_snap_err(snap_err, EXT4_FC_SNAP_ERR_INODE_LOC);\n>  \t\treturn ret;\n> +\t}\n>  \n>  \tif (ext4_test_inode_flag(inode, EXT4_INODE_INLINE_DATA))\n>  \t\tinode_len = EXT4_INODE_SIZE(inode->i_sb);\n> @@ -1092,6 +1112,7 @@ static int ext4_fc_snapshot_inode(struct inode *inode,\n>  \n>  \tsnap = kmalloc(struct_size(snap, inode_buf, inode_len), GFP_NOFS);\n>  \tif (!snap) {\n> +\t\text4_fc_set_snap_err(snap_err, EXT4_FC_SNAP_ERR_NOMEM);\n>  \t\tbrelse(iloc.bh);\n>  \t\treturn -ENOMEM;\n>  \t}\n> @@ -1102,7 +1123,7 @@ static int ext4_fc_snapshot_inode(struct inode *inode,\n>  \tbrelse(iloc.bh);\n>  \n>  \tret = ext4_fc_snapshot_inode_data(inode, &ranges, nr_ranges_total,\n> -\t\t\t\t\t  &nr_ranges);\n> +\t\t\t\t\t  &nr_ranges, snap_err);\n>  \tif (ret) {\n>  \t\tkfree(snap);\n>  \t\text4_fc_free_ranges(&ranges);\n> @@ -1203,7 +1224,10 @@ static int ext4_fc_alloc_snapshot_inodes(struct super_block *sb,\n>  \t\t\t\t\t unsigned int *nr_inodesp);\n>  \n>  static int ext4_fc_snapshot_inodes(journal_t *journal, struct inode **inodes,\n> -\t\t\t\t   unsigned int inodes_size)\n> +\t\t\t\t   unsigned int inodes_size,\n> +\t\t\t\t   unsigned int *nr_inodesp,\n> +\t\t\t\t   unsigned int *nr_rangesp,\n> +\t\t\t\t   int *snap_err)\n>  {\n>  \tstruct super_block *sb = journal->j_private;\n>  \tstruct ext4_sb_info *sbi = EXT4_SB(sb);\n> @@ -1221,6 +1245,8 @@ static int ext4_fc_snapshot_inodes(journal_t *journal, struct inode **inodes,\n>  \talloc_ctx = ext4_fc_lock(sb);\n>  \tlist_for_each_entry(iter, &sbi->s_fc_q[FC_Q_MAIN], i_fc_list) {\n>  \t\tif (i >= inodes_size) {\n> +\t\t\text4_fc_set_snap_err(snap_err,\n> +\t\t\t\t\t     EXT4_FC_SNAP_ERR_INODES_CAP);\n>  \t\t\tret = -E2BIG;\n>  \t\t\tgoto unlock;\n>  \t\t}\n> @@ -1244,6 +1270,8 @@ static int ext4_fc_snapshot_inodes(journal_t *journal, struct inode **inodes,\n>  \t\t\tcontinue;\n>  \n>  \t\tif (i >= inodes_size) {\n> +\t\t\text4_fc_set_snap_err(snap_err,\n> +\t\t\t\t\t     EXT4_FC_SNAP_ERR_INODES_CAP);\n>  \t\t\tret = -E2BIG;\n>  \t\t\tgoto unlock;\n>  \t\t}\n> @@ -1268,16 +1296,20 @@ static int ext4_fc_snapshot_inodes(journal_t *journal, struct inode **inodes,\n>  \t\tunsigned int inode_ranges = 0;\n>  \n>  \t\tret = ext4_fc_snapshot_inode(inodes[idx], nr_ranges,\n> -\t\t\t\t\t     &inode_ranges);\n> +\t\t\t\t\t     &inode_ranges, snap_err);\n>  \t\tif (ret)\n>  \t\t\tbreak;\n>  \t\tnr_ranges += inode_ranges;\n>  \t}\n>  \n> +\tif (nr_inodesp)\n> +\t\t*nr_inodesp = i;\n> +\tif (nr_rangesp)\n> +\t\t*nr_rangesp = nr_ranges;\n>  \treturn ret;\n>  }\n>  \n> -static int ext4_fc_perform_commit(journal_t *journal)\n> +static int ext4_fc_perform_commit(journal_t *journal, tid_t commit_tid)\n>  {\n>  \tstruct super_block *sb = journal->j_private;\n>  \tstruct ext4_sb_info *sbi = EXT4_SB(sb);\n> @@ -1286,10 +1318,15 @@ static int ext4_fc_perform_commit(journal_t *journal)\n>  \tstruct inode *inode;\n>  \tstruct inode **inodes;\n>  \tunsigned int inodes_size;\n> +\tunsigned int snap_inodes = 0;\n> +\tunsigned int snap_ranges = 0;\n> +\tint snap_err = EXT4_FC_SNAP_ERR_NONE;\n>  \tstruct blk_plug plug;\n>  \tint ret = 0;\n>  \tu32 crc = 0;\n>  \tint alloc_ctx;\n> +\tktime_t lock_start;\n> +\tu64 locked_ns;\n>  \n>  \t/*\n>  \t * Step 1: Mark all inodes on s_fc_q[MAIN] with\n> @@ -1337,13 +1374,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>  \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> @@ -1357,8 +1394,12 @@ 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> +\tlocked_ns = ktime_to_ns(ktime_sub(ktime_get(), lock_start));\n\nIf locked_ns is only used for the tracepoint, it should either be\ncalculated in the tracepoint, or add:\n\n\tif (trace_ext4_fc_lock_updates_enabled()) {\n\t\tlocked_ns = ktime_to_ns(ktime_sub(ktime_get(), lock_start));\n\n> +\ttrace_ext4_fc_lock_updates(sb, commit_tid, locked_ns, snap_inodes,\n> +\t\t\t\t   snap_ranges, ret, snap_err);\n\n\t}\n\nNote, we are going to also add a code to call the tracepoint directly, to\nremove the double static_branch.\n\n\thttps://lore.kernel.org/all/20260312150523.2054552-1-vineeth@bitbyteword.org/\n\nBut that code is still being worked on so you don't need to worry about it\nat the moment.\n\n-- Steve\n\n\n\n>  \tkvfree(inodes);\n>  \tif (ret)\n>  \t\treturn ret;\n> @@ -1563,7 +1604,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 fd76d14c2776e..dc084f39b74ad 100644\n> --- a/include/trace/events/ext4.h\n> +++ b/include/trace/events/ext4.h\n> @@ -104,6 +104,26 @@ TRACE_DEFINE_ENUM(EXT4_FC_REASON_INODE_JOURNAL_DATA);\n>  TRACE_DEFINE_ENUM(EXT4_FC_REASON_ENCRYPTED_FILENAME);\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> @@ -2812,6 +2832,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]","headers":{"Return-Path":"\n <SRS0=9VGP=BR=vger.kernel.org=linux-ext4+bounces-15117-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=2404:9400:2221:ea00::3; helo=mail.ozlabs.org;\n envelope-from=srs0=9vgp=br=vger.kernel.org=linux-ext4+bounces-15117-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)","gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=104.64.211.4 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=104.64.211.4; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15117-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=216.40.44.14","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 (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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fZyBb1XZTz1xqn\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 18 Mar 2026 03:31:03 +1100 (AEDT)","from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4fZyBb0xqgz4wCH\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 18 Mar 2026 03:31:03 +1100 (AEDT)","by gandalf.ozlabs.org (Postfix)\n\tid 4fZyBb0k1Sz4wD3; Wed, 18 Mar 2026 03:31:03 +1100 (AEDT)","from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])\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 4fZyBW06hzz4wCH\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 18 Mar 2026 03:30:58 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id AB11A3032A98\n\tfor <patchwork-incoming@ozlabs.org>; Tue, 17 Mar 2026 16:21:36 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id E557330DD1C;\n\tTue, 17 Mar 2026 16:21:34 +0000 (UTC)","from relay.hostedemail.com (smtprelay0014.hostedemail.com\n [216.40.44.14])\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 ECCFD20DD52;\n\tTue, 17 Mar 2026 16:21:32 +0000 (UTC)","from omf04.hostedemail.com (a10.router.float.18 [10.200.18.1])\n\tby unirelay09.hostedemail.com (Postfix) with ESMTP id 5A16889140;\n\tTue, 17 Mar 2026 16:21:25 +0000 (UTC)","from [HIDDEN] (Authenticated sender: rostedt@goodmis.org) by\n omf04.hostedemail.com (Postfix) with ESMTPA id 3E5B920023;\n\tTue, 17 Mar 2026 16:21:23 +0000 (UTC)"],"ARC-Seal":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1773765063; cv=pass;\n\tb=yaz0AvwnJtOzWXpixQsVnld2ohySpf7YgfjA9ZcI3YEZAwEKO88DiX+c5M3xVNneN3A/Atzl4LcZF/TX7BRXhBdu2Iak//alxaFptvwOjxCbZNVwePodNXOWuQWvq0ksbb57WkkO2jznBKf+1zFvCEVn8kYWNK+KySiWTLZU6Sv0sByLBXAliM8sZ1xalQZhpXX5Dasfl4xX5xQrJdXxfOCYsNiy4OCITReuD+VO/ClVw088MXed0ta/5KUM9VLjh739gMaOujPDpyfYjEa3Ygray2sclGW0Da4i0yg2tFSoD4hkae5Kx64H3FA55bNRbfJEhijy+3VKR5Z8nRAqTA==","i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1773764494; cv=none;\n b=DEzdFzAFXUneNBdNGr9UHlK6bWzDVHsrmFDIpNQiucomvDR0OIYGp2gLGMudH6PGnSOiSHzzwOjqNw9GxHH397LWfu+6oo+nAhb4mayg/Jam3UeR5BmQfgAwFLHizvKTVG0XC6rCfMGjVaqx9igAZGCBKlngGy6hPHb+C1jX194="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1773765063; c=relaxed/relaxed;\n\tbh=zTwVEDACaDUxrsKDaXmhJpD+gwD43wUGajEG82YUHaw=;\n\th=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=FNrYxmNBpWjdMff7PT3l7XUlDA1g9gT3B8nb2v8bZa3OI44/JPoLMx76I1ZZn125lIpfozZjkukqKYu7RZBg7GUoSW9HdTIQOHjltgP+5laBDT8m05EPCNM/mTuNHLFIl6dnHjQanpNKkzL1PyciN/ON0dR/tkMF1+y8WqIsp2VPvxp7q/VL7/ilq+pr2KCMq4PMvLnBmigDSD3DgJVGUMhQbeCzADM/H9l5udBMJusvL5vJKJqjrOSrIAOXnPqPOVuJhwBVUr7jBakYEEbAY6qodNFvCyCVU6/Y0boPPnpjT1DMWj85WNwAJ5NGxqYKE/42/iq7x/6UBmQaCpEVxA==","i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1773764494; c=relaxed/simple;\n\tbh=6r7G/4OTNvkQE+Rg5oVMsf4prm1UCgUkcDBXs3A5mZ8=;\n\th=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=dxbn8gUZaxqJOuxyJSHAr1YybvsgqEEfK0l1e9DHPuHgohHvcPMq5L4Fa6A2ZGwRo217ht1kjG3RWxpXv+4YEjxm8PCKm7F4ryfL7jV83s03Us54H04jJl7KVZSvC7Hm6knAAVZHx+2COv3V38vOIQpohNLL1K2UChPBUAOjT8Q="],"ARC-Authentication-Results":["i=2; gandalf.ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=goodmis.org;\n spf=pass (client-ip=104.64.211.4; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15117-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.14"],"Date":"Tue, 17 Mar 2026 12:21:49 -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>, Masami Hiramatsu\n <mhiramat@kernel.org>, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,\n linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,\n linux-trace-kernel@vger.kernel.org, Vineeth Remanan Pillai\n <vineeth@bitbyteword.org>","Subject":"Re: [RFC v5 6/7] ext4: fast commit: add lock_updates tracepoint","Message-ID":"<20260317122149.5d07132a@gandalf.local.home>","In-Reply-To":"<20260317084624.457185-7-me@linux.beauty>","References":"<20260317084624.457185-1-me@linux.beauty>\n\t<20260317084624.457185-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":"3E5B920023","X-Stat-Signature":"8wftqtjmkaz6x7engyczbi45seohm84i","X-Rspamd-Server":"rspamout03","X-Session-Marker":"726F737465647440676F6F646D69732E6F7267","X-Session-ID":"U2FsdGVkX18/vahWcqh0LeqN6Fii+Q5YS/YquRt+sr4=","X-HE-Tag":"1773764483-188773","X-HE-Meta":"\n U2FsdGVkX18MXY6zzIi/kwm+GVm1Q2PfzoCGwvYqWpdKJu0SpslaWaJ7BA2v/ZQUQbJxu7/z4q0wIBp2H5s/NZiouIhlDDKNA2ANMgCgTzFu77Pr/40mv/eEHbn4p8R9397FYjRWeSy5AKeMyAmlOHsVKvaoRn4f66rGprr0TprRYHC/7FNdSV+zw9ZPCYNwID1Kku9v9pZdVIGMJ5cdtP0ya9nPPkNTpojX6n1eUJ+JTr14VkvE6huktIYAYul1uzckPziUQo2cTUUuwArDlh4OLYHBtIxFfPsV2Shb3jbQAW1dSNYglT16yMRVYhgUdf+Olqdvx73TnMok7QILu44O6VCOu2qSApc3zmPxTf4xaICeRjCNX/IdM43z3PVxV+HQT115po9IhgbkXJgE6A==","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":3668832,"web_url":"http://patchwork.ozlabs.org/comment/3668832/","msgid":"<19d23a3a04c.34309de42984481.2847144293854414800@linux.beauty>","list_archive_url":null,"date":"2026-03-25T06:16:59","subject":"Re: [RFC v5 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\nThank you for your review, and I apologize for my delayed response.\n\n ---- On Wed, 18 Mar 2026 00:21:29 +0800  Steven Rostedt <rostedt@goodmis.org> wrote --- \n > On Tue, 17 Mar 2026 16:46:21 +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 > > Signed-off-by: Li Chen <me@linux.beauty>\n > > ---\n > >  fs/ext4/ext4.h              | 15 ++++++++\n > >  fs/ext4/fast_commit.c       | 71 +++++++++++++++++++++++++++++--------\n > >  include/trace/events/ext4.h | 61 +++++++++++++++++++++++++++++++\n > >  3 files changed, 132 insertions(+), 15 deletions(-)\n > > \n > > diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h\n > > index 68a64fa0be926..b9e146f3dd9e4 100644\n > > --- a/fs/ext4/ext4.h\n > > +++ b/fs/ext4/ext4.h\n > > @@ -1037,6 +1037,21 @@ enum {\n > >  \n > >  struct ext4_fc_inode_snap;\n > >  \n > > +/*\n > > + * Snapshot failure reasons for ext4_fc_lock_updates tracepoint.\n > > + * Keep these stable for tooling.\n > > + */\n > > +enum ext4_fc_snap_err {\n > > +    EXT4_FC_SNAP_ERR_NONE        = 0,\n > > +    EXT4_FC_SNAP_ERR_ES_MISS    = 1,\n > > +    EXT4_FC_SNAP_ERR_ES_DELAYED    = 2,\n > > +    EXT4_FC_SNAP_ERR_ES_OTHER    = 3,\n > > +    EXT4_FC_SNAP_ERR_INODES_CAP    = 4,\n > > +    EXT4_FC_SNAP_ERR_RANGES_CAP    = 5,\n > > +    EXT4_FC_SNAP_ERR_NOMEM        = 6,\n > > +    EXT4_FC_SNAP_ERR_INODE_LOC    = 7,\n > \n > You don't need to explicitly state the assignments, the enum will increment\n > them without them.\n\nAgree.\n\n > > +};\n > > +\n > >  /*\n > >   * fourth extended file system inode data in memory\n > >   */\n > > diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c\n > > index d1eefee609120..4929e2990b292 100644\n > > --- a/fs/ext4/fast_commit.c\n > > +++ b/fs/ext4/fast_commit.c\n > > @@ -193,6 +193,12 @@ static struct kmem_cache *ext4_fc_range_cachep;\n > >  #define EXT4_FC_SNAPSHOT_MAX_INODES    1024\n > >  #define EXT4_FC_SNAPSHOT_MAX_RANGES    2048\n > >  \n > > +static inline void ext4_fc_set_snap_err(int *snap_err, int err)\n > > +{\n > > +    if (snap_err && *snap_err == EXT4_FC_SNAP_ERR_NONE)\n > > +        *snap_err = err;\n > > +}\n > > +\n > >  static void ext4_end_buffer_io_sync(struct buffer_head *bh, int uptodate)\n > >  {\n > >      BUFFER_TRACE(bh, \"\");\n > > @@ -983,11 +989,12 @@ static void ext4_fc_free_inode_snap(struct inode *inode)\n > >  static int ext4_fc_snapshot_inode_data(struct inode *inode,\n > >                         struct list_head *ranges,\n > >                         unsigned int nr_ranges_total,\n > > -                       unsigned int *nr_rangesp)\n > > +                       unsigned int *nr_rangesp,\n > > +                       int *snap_err)\n > >  {\n > >      struct ext4_inode_info *ei = EXT4_I(inode);\n > > -    unsigned int nr_ranges = 0;\n > >      ext4_lblk_t start_lblk, end_lblk, cur_lblk;\n > > +    unsigned int nr_ranges = 0;\n > >  \n > >      spin_lock(&ei->i_fc_lock);\n > >      if (ei->i_fc_lblk_len == 0) {\n > > @@ -1010,11 +1017,16 @@ static int ext4_fc_snapshot_inode_data(struct inode *inode,\n > >          struct ext4_fc_range *range;\n > >          ext4_lblk_t len;\n > >  \n > > -        if (!ext4_es_lookup_extent(inode, cur_lblk, NULL, &es, NULL))\n > > +        if (!ext4_es_lookup_extent(inode, cur_lblk, NULL, &es, NULL)) {\n > > +            ext4_fc_set_snap_err(snap_err, EXT4_FC_SNAP_ERR_ES_MISS);\n > >              return -EAGAIN;\n > > +        }\n > >  \n > > -        if (ext4_es_is_delayed(&es))\n > > +        if (ext4_es_is_delayed(&es)) {\n > > +            ext4_fc_set_snap_err(snap_err,\n > > +                         EXT4_FC_SNAP_ERR_ES_DELAYED);\n > >              return -EAGAIN;\n > > +        }\n > >  \n > >          len = es.es_len - (cur_lblk - es.es_lblk);\n > >          if (len > end_lblk - cur_lblk + 1)\n > > @@ -1024,12 +1036,17 @@ static int ext4_fc_snapshot_inode_data(struct inode *inode,\n > >              continue;\n > >          }\n > >  \n > > -        if (nr_ranges_total + nr_ranges >= EXT4_FC_SNAPSHOT_MAX_RANGES)\n > > +        if (nr_ranges_total + nr_ranges >= EXT4_FC_SNAPSHOT_MAX_RANGES) {\n > > +            ext4_fc_set_snap_err(snap_err,\n > > +                         EXT4_FC_SNAP_ERR_RANGES_CAP);\n > >              return -E2BIG;\n > > +        }\n > >  \n > >          range = kmem_cache_alloc(ext4_fc_range_cachep, GFP_NOFS);\n > > -        if (!range)\n > > +        if (!range) {\n > > +            ext4_fc_set_snap_err(snap_err, EXT4_FC_SNAP_ERR_NOMEM);\n > >              return -ENOMEM;\n > > +        }\n > >          nr_ranges++;\n > >  \n > >          range->lblk = cur_lblk;\n > > @@ -1054,6 +1071,7 @@ static int ext4_fc_snapshot_inode_data(struct inode *inode,\n > >                  range->len = max;\n > >          } else {\n > >              kmem_cache_free(ext4_fc_range_cachep, range);\n > > +            ext4_fc_set_snap_err(snap_err, EXT4_FC_SNAP_ERR_ES_OTHER);\n > >              return -EAGAIN;\n > >          }\n > >  \n > > @@ -1070,7 +1088,7 @@ static int ext4_fc_snapshot_inode_data(struct inode *inode,\n > >  \n > >  static int ext4_fc_snapshot_inode(struct inode *inode,\n > >                    unsigned int nr_ranges_total,\n > > -                  unsigned int *nr_rangesp)\n > > +                  unsigned int *nr_rangesp, int *snap_err)\n > >  {\n > >      struct ext4_inode_info *ei = EXT4_I(inode);\n > >      struct ext4_fc_inode_snap *snap;\n > > @@ -1082,8 +1100,10 @@ static int ext4_fc_snapshot_inode(struct inode *inode,\n > >      int alloc_ctx;\n > >  \n > >      ret = ext4_get_inode_loc_noio(inode, &iloc);\n > > -    if (ret)\n > > +    if (ret) {\n > > +        ext4_fc_set_snap_err(snap_err, EXT4_FC_SNAP_ERR_INODE_LOC);\n > >          return ret;\n > > +    }\n > >  \n > >      if (ext4_test_inode_flag(inode, EXT4_INODE_INLINE_DATA))\n > >          inode_len = EXT4_INODE_SIZE(inode->i_sb);\n > > @@ -1092,6 +1112,7 @@ static int ext4_fc_snapshot_inode(struct inode *inode,\n > >  \n > >      snap = kmalloc(struct_size(snap, inode_buf, inode_len), GFP_NOFS);\n > >      if (!snap) {\n > > +        ext4_fc_set_snap_err(snap_err, EXT4_FC_SNAP_ERR_NOMEM);\n > >          brelse(iloc.bh);\n > >          return -ENOMEM;\n > >      }\n > > @@ -1102,7 +1123,7 @@ static int ext4_fc_snapshot_inode(struct inode *inode,\n > >      brelse(iloc.bh);\n > >  \n > >      ret = ext4_fc_snapshot_inode_data(inode, &ranges, nr_ranges_total,\n > > -                      &nr_ranges);\n > > +                      &nr_ranges, snap_err);\n > >      if (ret) {\n > >          kfree(snap);\n > >          ext4_fc_free_ranges(&ranges);\n > > @@ -1203,7 +1224,10 @@ static int ext4_fc_alloc_snapshot_inodes(struct super_block *sb,\n > >                       unsigned int *nr_inodesp);\n > >  \n > >  static int ext4_fc_snapshot_inodes(journal_t *journal, struct inode **inodes,\n > > -                   unsigned int inodes_size)\n > > +                   unsigned int inodes_size,\n > > +                   unsigned int *nr_inodesp,\n > > +                   unsigned int *nr_rangesp,\n > > +                   int *snap_err)\n > >  {\n > >      struct super_block *sb = journal->j_private;\n > >      struct ext4_sb_info *sbi = EXT4_SB(sb);\n > > @@ -1221,6 +1245,8 @@ static int ext4_fc_snapshot_inodes(journal_t *journal, struct inode **inodes,\n > >      alloc_ctx = ext4_fc_lock(sb);\n > >      list_for_each_entry(iter, &sbi->s_fc_q[FC_Q_MAIN], i_fc_list) {\n > >          if (i >= inodes_size) {\n > > +            ext4_fc_set_snap_err(snap_err,\n > > +                         EXT4_FC_SNAP_ERR_INODES_CAP);\n > >              ret = -E2BIG;\n > >              goto unlock;\n > >          }\n > > @@ -1244,6 +1270,8 @@ static int ext4_fc_snapshot_inodes(journal_t *journal, struct inode **inodes,\n > >              continue;\n > >  \n > >          if (i >= inodes_size) {\n > > +            ext4_fc_set_snap_err(snap_err,\n > > +                         EXT4_FC_SNAP_ERR_INODES_CAP);\n > >              ret = -E2BIG;\n > >              goto unlock;\n > >          }\n > > @@ -1268,16 +1296,20 @@ static int ext4_fc_snapshot_inodes(journal_t *journal, struct inode **inodes,\n > >          unsigned int inode_ranges = 0;\n > >  \n > >          ret = ext4_fc_snapshot_inode(inodes[idx], nr_ranges,\n > > -                         &inode_ranges);\n > > +                         &inode_ranges, snap_err);\n > >          if (ret)\n > >              break;\n > >          nr_ranges += inode_ranges;\n > >      }\n > >  \n > > +    if (nr_inodesp)\n > > +        *nr_inodesp = i;\n > > +    if (nr_rangesp)\n > > +        *nr_rangesp = nr_ranges;\n > >      return ret;\n > >  }\n > >  \n > > -static int ext4_fc_perform_commit(journal_t *journal)\n > > +static int ext4_fc_perform_commit(journal_t *journal, tid_t commit_tid)\n > >  {\n > >      struct super_block *sb = journal->j_private;\n > >      struct ext4_sb_info *sbi = EXT4_SB(sb);\n > > @@ -1286,10 +1318,15 @@ static int ext4_fc_perform_commit(journal_t *journal)\n > >      struct inode *inode;\n > >      struct inode **inodes;\n > >      unsigned int inodes_size;\n > > +    unsigned int snap_inodes = 0;\n > > +    unsigned int snap_ranges = 0;\n > > +    int snap_err = EXT4_FC_SNAP_ERR_NONE;\n > >      struct blk_plug plug;\n > >      int ret = 0;\n > >      u32 crc = 0;\n > >      int alloc_ctx;\n > > +    ktime_t lock_start;\n > > +    u64 locked_ns;\n > >  \n > >      /*\n > >       * Step 1: Mark all inodes on s_fc_q[MAIN] with\n > > @@ -1337,13 +1374,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 > >       * The journal is now locked. No more handles can start and all the\n > >       * previous handles are now drained. Snapshotting happens in this\n > > @@ -1357,8 +1394,12 @@ 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 > > +    locked_ns = ktime_to_ns(ktime_sub(ktime_get(), lock_start));\n > \n > If locked_ns is only used for the tracepoint, it should either be\n > calculated in the tracepoint, or add:\n > \n >     if (trace_ext4_fc_lock_updates_enabled()) {\n >         locked_ns = ktime_to_ns(ktime_sub(ktime_get(), lock_start));\n \nGood catch!\n\n > > +    trace_ext4_fc_lock_updates(sb, commit_tid, locked_ns, snap_inodes,\n > > +                   snap_ranges, ret, snap_err);\n > \n >     }\n > \n > Note, we are going to also add a code to call the tracepoint directly, to\n > remove the double static_branch.\n > \n >     https://lore.kernel.org/all/20260312150523.2054552-1-vineeth@bitbyteword.org/\n > \n > But that code is still being worked on so you don't need to worry about it\n > at the moment.\n\nThank you! I will monitor this patch set and incorporate it into future versions if possible.\n\n > \n > >      kvfree(inodes);\n > >      if (ret)\n > >          return ret;\n > > @@ -1563,7 +1604,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 fd76d14c2776e..dc084f39b74ad 100644\n > > --- a/include/trace/events/ext4.h\n > > +++ b/include/trace/events/ext4.h\n > > @@ -104,6 +104,26 @@ TRACE_DEFINE_ENUM(EXT4_FC_REASON_INODE_JOURNAL_DATA);\n > >  TRACE_DEFINE_ENUM(EXT4_FC_REASON_ENCRYPTED_FILENAME);\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 > > @@ -2812,6 +2832,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 > \n\nRegards,\nLi​","headers":{"Return-Path":"\n <SRS0=Somx=BZ=vger.kernel.org=linux-ext4+bounces-15326-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=cHIgIZvw;\n\tdkim-atps=neutral","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=somx=bz=vger.kernel.org=linux-ext4+bounces-15326-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=cHIgIZvw;\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-15326-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=\"cHIgIZvw\"","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 (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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgcBp25Rfz1xy3\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 17:17:22 +1100 (AEDT)","from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4fgcBp1WBtz4wB7\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 17:17:22 +1100 (AEDT)","by gandalf.ozlabs.org (Postfix)\n\tid 4fgcBp1Qphz4wBD; Wed, 25 Mar 2026 17:17:22 +1100 (AEDT)","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 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4fgcBk03XLz4wB7\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 25 Mar 2026 17:17:17 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id A645A302FA83\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 25 Mar 2026 06:17:14 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 8F87927466A;\n\tWed, 25 Mar 2026 06:17:13 +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 B7F0327453;\n\tWed, 25 Mar 2026 06:17:11 +0000 (UTC)","from mail.zoho.com by mx.zohomail.com\n\twith SMTP id 1774419419230354.88223286998016;\n Tue, 24 Mar 2026 23:16:59 -0700 (PDT)"],"ARC-Seal":["i=3; a=rsa-sha256; d=ozlabs.org; s=201707; t=1774419442; cv=pass;\n\tb=vNeW5Mllr9Xw02TOlfeLu1kHUf9/NI7eVkpJyWpAKR33LJXmhxYMHi/l+Jmu5XhT4mTw2oKJz0XIt+rRQTv9Yg5mPPUNijyNjwiPZVZumtulOA+mKAljgQSVAqhErjG/TR4D8vks4wUHi7OtjPp8+QR+ZaorcA+IEBRFxGL7sc5a0RHqbzJQTHDjWTVLzOfz6of4eJZJDB4VvP+E1b+hy9BjvvjT/nGdB9ue0OO9D0m6mpEB4ekeCmANaqxpWwyg8ophwxVfcswI2zwvdVr/7NYsugGhsi8qwkIdZMOtLBNwkRhB+yj08x23vNrcwrNuIJT1h3wpMtC7T1VDf3liMQ==","i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774419433; cv=pass;\n b=h/gbq/Omkxfigv9eVuvA2pJp7mRTjo3L5hLxVHmbRE2US6ERx0jyWWY909hLVQttALlBBTEbgHNHQV3W7k79Td3trSrJQJYsXqYRIa8LgGd7KndVu66niX1CpGAI4SQLXlPIRRHc25iXEGsWEZBJbn+k68aJuYnRoK4ZjUGqIuU=","i=1; a=rsa-sha256; t=1774419422; cv=none;\n\td=zohomail.com; s=zohoarc;\n\tb=P9RncUrfSgufWo8IGMxEcIq6SUx9ROOIHu3mzOjH27FyywJp1OeTtNE72697RUIxgvv9EbQUsRJxDgMDwiS0cen6734xKg4GqFwZ7Y5akPoHRohpa9WQVzQbDEuZU7x0UG7wBHlhJo0crs2rGbqOrA9JPmrppKQemXfXGMdzB0Q="],"ARC-Message-Signature":["i=3; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1774419442; c=relaxed/relaxed;\n\tbh=qhYG/KQSKxIEDR8YxQvocaPx3rUqa1Z8m8txWwCW8Vs=;\n\th=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject:\n\t MIME-Version:Content-Type;\n b=RtdxLxYp7jl0sYK7jABEz2tLRbMfqBHR84L/mXowVc+T0lGdKXT1QEvfJkeiaXkzalPGuU6ca+KqLKZlpjHZUjYmngEvNM/5tivjGmwdOJXNVuZjV1BmSOT9GnNhAnM0wzIWAkFdK5lDNfCmobZMJG4NRHq9bJ+uUwnw156CfMbuFK/eDNqOmX0Z8/y4NH/+VP9rbPAM9J25SzqOurE6UAv7DeLDd5Ui2ytBEV1OqO9yd3r43VUvyEw9J9PTz3FWtItXS2Xot1btur6pJc44uiIXCJ+FxjHPqOotS9wkcID0EkuClTYkiRvfbOP1umaZ/mncBK4GNwDotm7wQqf47w==","i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774419433; c=relaxed/simple;\n\tbh=fMgcaVu+9YkIHzMRkix9WHnVzSQ0fglslUoLUzlKwGg=;\n\th=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject:\n\t MIME-Version:Content-Type;\n b=W5l93kselq4KCpSHxNsTUe/vkI/vRfbuDmYeO4R4PceMwuk2W0XL4qY5FSRs3vNsEk1nDF6yzffkVVpLQFjISHdE2uoXrKB1wIooI2o7H/hWCcses+98KwOujM8+L9qEKgmmG+oHFGtmYWk4swY9ORGxoVmhLciaTpul6OjtYc4=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;\n s=zohoarc;\n\tt=1774419422;\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=qhYG/KQSKxIEDR8YxQvocaPx3rUqa1Z8m8txWwCW8Vs=;\n\tb=Rp/yRSUZkaQPRefiLGPT9TQYTLTUWh3RowBpGKj0E3wJIA5HVctnzD5QWdRjU/lbr9cqqT3iXIsy1bdQlEbu5jgtuf7MJ7M9ikZfWU2FKhDE2fTh8kqxhhibwPYc88boObdGckfS0pCWYKx4Abj6qvxA8erKxTBEX9SViqMa3S8="],"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=cHIgIZvw; dkim-atps=neutral;\n spf=pass (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15326-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=cHIgIZvw; 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=1774419422;\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=qhYG/KQSKxIEDR8YxQvocaPx3rUqa1Z8m8txWwCW8Vs=;\n\tb=cHIgIZvwkTjNMKDRIfhf/iB8ZYkPESpuYJAoZA1UR3XneR3XeF3xbGsg8bFCRXp1\n\te3qHxQ1mQHWkFIrD3eiPrGkGhuLeJBp8tS5QTfRyY6yGYYQOLBvNzsW2dMtrdBi2o5k\n\tD2+6WHk4RuNVesm1YpmtYEOP525uj3CZAP5ngY7s=","Date":"Wed, 25 Mar 2026 14:16:59 +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\"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>,\n\t\"Vineeth Remanan Pillai\" <vineeth@bitbyteword.org>","Message-ID":"<19d23a3a04c.34309de42984481.2847144293854414800@linux.beauty>","In-Reply-To":"<20260317122149.5d07132a@gandalf.local.home>","References":"<20260317084624.457185-1-me@linux.beauty>\n\t<20260317084624.457185-7-me@linux.beauty>\n <20260317122149.5d07132a@gandalf.local.home>","Subject":"Re: [RFC v5 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"}}]