Received: by 2002:a05:6a10:ffa2:0:0:0:0 with SMTP id hs34csp4955397pxb; Tue, 22 Feb 2022 14:27:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxc7seLQV12iK9zA3kP6Yc1HVEnl4DJs47kLoNPqXpYLXAkjT+KHFK/VyEc3dxWaDVGLxi6 X-Received: by 2002:a17:902:b602:b0:14f:e42b:d547 with SMTP id b2-20020a170902b60200b0014fe42bd547mr3886200pls.91.1645568838339; Tue, 22 Feb 2022 14:27:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645568838; cv=none; d=google.com; s=arc-20160816; b=FkNwNbNYSsV+Na5tID/x1SxiiooX7VbRYqAuUMqblGQwrCcABuooweLkhIQY7K2p+Y qZg0RBzZjeHIbir04JzRMS63wSw7B8qmtViA5jak+wr6ew4iCB9enOz+ozDMx5O0zIfX A7nHLt0AOFwnGrWq6nh28MBtw+2yyHvciJcLo74r9FECV9gya9rb4XY8HSEReqEDAVCg o3Z5SnyLVTsIOr+dizt49tcCR/kkC3YruGBzHbn7rhPNa677OEpA3h7Wy73tFtgK+svj NhzBRVzIcUr723Wr0jm/WAzR76dsVDWhdyW9/qCEFXDIXjp1maQJQQcsSc8RdEFwM0p3 kPYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6NP+SqwknYxeB+r5zaqqZN0Yt1ExjQsEZddzFENEXd8=; b=ulD6pj8J2+HTKHPauFVXcupFpBvwTCnWXsu1uIb2mBGPNut7wZYm/lHf4/itoEzMxs yu4Xixe5ZDqkyJLVcUaOWq0tjrOleVFdRP9odRKG0AM4J4vVVo2QYRDaHZmpnQ/0UAYx ocjxjJt/1fTbe/YcgWrtG5IUC9YHljDui8PxRVINsgqzapeNEnprYLPsrv/70TcQ2CtG UXA2M0zWxDlcHEyJ2BAVrT6edCoKOzVz2JuYrpp4IcBN9yahOdjvY/1zCM7d8yMjRdwX s0MChinbXVCcSFY4LgZoHSIPKDQcCQ0Ox+7MXdgt3ZytgLsVi7bonzfb1lXKLtzL9y90 ngAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=EAJL3ZYi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f12si14275670pfj.324.2022.02.22.14.27.02; Tue, 22 Feb 2022 14:27:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@ibm.com header.s=pp1 header.b=EAJL3ZYi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235630AbiBVUfn (ORCPT + 99 others); Tue, 22 Feb 2022 15:35:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235574AbiBVUf3 (ORCPT ); Tue, 22 Feb 2022 15:35:29 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE3BF13D90B; Tue, 22 Feb 2022 12:35:00 -0800 (PST) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 21MHfdgA001571; Tue, 22 Feb 2022 20:34:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=6NP+SqwknYxeB+r5zaqqZN0Yt1ExjQsEZddzFENEXd8=; b=EAJL3ZYi48GoV82fHKXMiDXmg72yIcvlLvRVV9fQhNZsF4P9/qDJJZ0PHdzB9CBfkHdp IYJjOjg9KG/ItgqIbzm3gnO/+FS8E5XR0Ophtnw7qsXFcxuXOUCdEcRxp8mEDacsgcw1 Z5RDoKykofbxyjL/Jko8gBcBEeioLkVGoM4ZdUMjY9zelKQTIqhwDmOg4lf1WuMnmY6+ m3a/K8WxFqQ7a1LM3W8dDfSpIUhroHsBEcvYSWg6Y50kb4IJ49oKBMzQPFrlyY+RR/wS AOFZE8jpSKl/yI1VTHqu5XS2IwNwi9NH0AtPDvqTv241F66bzaxdK5KTd9GRDQ4XFbS6 Kw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ed4exv11k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Feb 2022 20:34:57 +0000 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 21MKLMw7030938; Tue, 22 Feb 2022 20:34:56 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ed4exv114-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Feb 2022 20:34:56 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 21MKJbmQ027516; Tue, 22 Feb 2022 20:34:54 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03ams.nl.ibm.com with ESMTP id 3ear695q0c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Feb 2022 20:34:54 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 21MKOE2Q48955890 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Feb 2022 20:24:14 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8A9D3AE056; Tue, 22 Feb 2022 20:34:52 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 87C2EAE051; Tue, 22 Feb 2022 20:34:49 +0000 (GMT) Received: from localhost (unknown [9.43.75.136]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 22 Feb 2022 20:34:48 +0000 (GMT) From: Ritesh Harjani To: linux-ext4@vger.kernel.org Cc: Harshad Shirwadkar , "Theodore Ts'o" , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Ritesh Harjani Subject: [RFC 5/9] ext4: Add commit_tid info in jbd debug log Date: Wed, 23 Feb 2022 02:04:13 +0530 Message-Id: <60daf324eec64f2be0b9ce0e240294d36411037c.1645558375.git.riteshh@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: tOKLBdk7diP1LGUC4Pv9mwynpvVUHuiv X-Proofpoint-GUID: W2K3CMZeSe6fpoIufOc1WwqVDGNXOkQE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-02-22_07,2022-02-21_02,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 suspectscore=0 clxscore=1015 adultscore=0 phishscore=0 lowpriorityscore=0 mlxscore=0 mlxlogscore=881 bulkscore=0 impostorscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202220126 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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-kernel@vger.kernel.org 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 --- 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