From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3485DC433FE for ; Sun, 27 Feb 2022 18:31:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230495AbiB0ScL (ORCPT ); Sun, 27 Feb 2022 13:32:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbiB0ScJ (ORCPT ); Sun, 27 Feb 2022 13:32:09 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AFFD6CA4F; Sun, 27 Feb 2022 10:31:32 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id gb39so20681530ejc.1; Sun, 27 Feb 2022 10:31:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=c9NiXmxRqD1wbfEvhmJu7XXQT8V6DVwCm34Rrre6qno=; b=XfaQflcXKyxbp1i57U8x3PBlfTwwGkpDeP/H16PvWGKj307jSzC3puUuhHeJ9/7rF6 3XYer/UW3ZuKn6soW7bo8v5STlp0u6ZwUbki0AYO4rClVvlasxpUaBf8W50svrPsvYm2 WqjLjSHwiNFZBtHFqb9gJSabMML8C+aDryzuEV4izfw1c8SS9PwOjh+DYikPYUDPVa6K cwPhT7vmVImZ1P+N/ygj1tTMx3jCrhbT6SNjm/HRF5vTozRxI7+GKSmPxrHcSZpXQ9Of H/8Sz6KUcRv26hH078a9SIC7UY3QGZ4q/kf4plIXo+pQLiwHg51DY/WE0poef61UfIUD /Cfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=c9NiXmxRqD1wbfEvhmJu7XXQT8V6DVwCm34Rrre6qno=; b=JBk3Vx38fSjuZf6PGiMzjKNZ7zvo0yTnsfssEjrWzQntHKMAa90PocpZGGI5wvaeJA E/Vetvfkfnz+wujQTUWJ/1d4+TrCOaS051ORq14hjmBq5f9Mp7vf9zIZE+cEZMc3ZbOa jIUBxlF7/0GZ5e4UrA3NTax85IBntcSeMVitIx74nteY/yNi6W2wkNVgLKfgXjBT/Nx1 4lpatH69wDrHoGmz2yTyEx4mWhffEXIVi0PRg/fWiYKqqRlfhhZVZoRbO8i636nWYZfx znXkYf+Kr3lS4xpRqbIC4hbNEdhYX0Wgb7Uf9bDHjqld0NXeOaRTK1zYbwBdAEGGAGDC SPug== X-Gm-Message-State: AOAM53030S2m4iHz5+vVU4PMwEdfywtd0BLLd8YmzRV6zJID+RQLwp9j +7/mMDgpehPsiKDyHMYBUBKwu7D+I66OUh2wzLo= X-Google-Smtp-Source: ABdhPJwTEIZEUHV3lDwF05oQowbv9I+xLF13ZfXfk238rNNctQr5qyZpy3Ktkmt91KHIGSp3MsOIWgmkR+RGsxX0vh0= X-Received: by 2002:a17:906:bc46:b0:6ce:3d41:f87e with SMTP id s6-20020a170906bc4600b006ce3d41f87emr12562814ejv.283.1645986691022; Sun, 27 Feb 2022 10:31:31 -0800 (PST) MIME-Version: 1.0 References: <60daf324eec64f2be0b9ce0e240294d36411037c.1645558375.git.riteshh@linux.ibm.com> <20220223094254.fmowjdq4dbig5elz@quack3.lan> In-Reply-To: <20220223094254.fmowjdq4dbig5elz@quack3.lan> From: harshad shirwadkar Date: Sun, 27 Feb 2022 10:31:19 -0800 Message-ID: Subject: Re: [RFC 5/9] ext4: Add commit_tid info in jbd debug log To: Jan Kara Cc: Ritesh Harjani , Ext4 Developers List , "Theodore Ts'o" , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Looks good. Reviewed-by: Harshad Shirwadkar - Harshad On Wed, 23 Feb 2022 at 01:42, Jan Kara wrote: > > On Wed 23-02-22 02:04:13, Ritesh Harjani wrote: > > This adds commit_tid argument in ext4_fc_update_stats() > > so that we can add this information too in jbd_debug logs. > > This is also required in a later patch to pass the commit_tid info in > > ext4_fc_commit_start/stop() trace events. > > > > Signed-off-by: Ritesh Harjani > > Looks good. Feel free to add: > > Reviewed-by: Jan Kara > > Honza > > > --- > > fs/ext4/fast_commit.c | 15 +++++++++------ > > 1 file changed, 9 insertions(+), 6 deletions(-) > > > > diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c > > index 7fb1eceef30c..ee32aac0cbbf 100644 > > --- a/fs/ext4/fast_commit.c > > +++ b/fs/ext4/fast_commit.c > > @@ -1127,11 +1127,12 @@ static int ext4_fc_perform_commit(journal_t *journal) > > } > > > > static void ext4_fc_update_stats(struct super_block *sb, int status, > > - u64 commit_time, int nblks) > > + u64 commit_time, int nblks, tid_t commit_tid) > > { > > struct ext4_fc_stats *stats = &EXT4_SB(sb)->s_fc_stats; > > > > - jbd_debug(1, "Fast commit ended with status = %d", status); > > + jbd_debug(1, "Fast commit ended with status = %d for tid %u", > > + status, commit_tid); > > if (status == EXT4_FC_STATUS_OK) { > > stats->fc_num_commits++; > > stats->fc_numblks += nblks; > > @@ -1181,14 +1182,16 @@ int ext4_fc_commit(journal_t *journal, tid_t commit_tid) > > if (atomic_read(&sbi->s_fc_subtid) <= subtid && > > commit_tid > journal->j_commit_sequence) > > goto restart_fc; > > - ext4_fc_update_stats(sb, EXT4_FC_STATUS_SKIPPED, 0, 0); > > + ext4_fc_update_stats(sb, EXT4_FC_STATUS_SKIPPED, 0, 0, > > + commit_tid); > > return 0; > > } else if (ret) { > > /* > > * Commit couldn't start. Just update stats and perform a > > * full commit. > > */ > > - ext4_fc_update_stats(sb, EXT4_FC_STATUS_FAILED, 0, 0); > > + ext4_fc_update_stats(sb, EXT4_FC_STATUS_FAILED, 0, 0, > > + commit_tid); > > return jbd2_complete_transaction(journal, commit_tid); > > } > > > > @@ -1220,12 +1223,12 @@ int ext4_fc_commit(journal_t *journal, tid_t commit_tid) > > * don't react too strongly to vast changes in the commit time > > */ > > commit_time = ktime_to_ns(ktime_sub(ktime_get(), start_time)); > > - ext4_fc_update_stats(sb, status, commit_time, nblks); > > + ext4_fc_update_stats(sb, status, commit_time, nblks, commit_tid); > > return ret; > > > > fallback: > > ret = jbd2_fc_end_commit_fallback(journal); > > - ext4_fc_update_stats(sb, status, 0, 0); > > + ext4_fc_update_stats(sb, status, 0, 0, commit_tid); > > return ret; > > } > > > > -- > > 2.31.1 > > > -- > Jan Kara > SUSE Labs, CR