From patchwork Wed Jan 4 11:21:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 38870 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5090307wrt; Wed, 4 Jan 2023 03:23:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXvBTz9/FF/0ncxJZQAHjjdaK3NVIJCY5jBf9pi4VcZRk+8RG7ulRm6sxSZlLXwWj9a5wg4s X-Received: by 2002:a05:6a20:8b90:b0:9d:efbf:48f2 with SMTP id m16-20020a056a208b9000b0009defbf48f2mr52473063pzh.54.1672831411694; Wed, 04 Jan 2023 03:23:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672831411; cv=pass; d=google.com; s=arc-20160816; b=FYOupqCiZs2gfRSgvxjCWIxbvJcBTGvvJxYiNMtVVMEOqrWmRa9SEvv+otfwL97Ttd KEGhPAzkVcpxQ966EN99m27fM6/6gicr4bpitvphcRUndJbwmXoroQ3+jnspryU9s6y1 /LLQAxORmtFDWTslxvsY5Pcb+kqTEPcdmvAQ5zn66fi8biksLV2dfczT2PA7o9iKg3jU YFDbkBb65/9sBMVOx3PodGIzC2VPCC5qwNU17biU0jofnxVhr9dPWeBiw+3YJkp5wWdz I3htK1vgrVUViIzKTL9v3u4qJTIi6cLATc96AlDKBHtb631qlGD4bm20KeV5VQtreoBJ KHww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=71nsvQsvnmS4DY1mivaFbSp5zykYRpJPABqQ4hhf7Q0=; b=eNwfRKgjxSQb1CmxIBET9ZYxosYCdG1+lRVGglKJbpO/6x+aotAYUT1KplgrrPklDu +RcamdVcx/7G8+12mbs3QNMLv7DwHkkXwpxc3oShZ/C2w8lRFIkFrqchp+el2kJX+SCb xv946tU2oK50yxYmoJeIGcEhyyN8oO8j3IZ+6gdl1ijr2tzV6vWFk17OP7uGi5L0KTrq goh4Ugko+qAFn346jh94E8ygyvto81MR9iICDIUwVpZ2KAGMQtr5FmKqmfT03MZBUtzP oWVdwvJtWIrBpZf6oT7OKYiMFncyHubHTQvZ273i3Di7aaasoq1e5aAHQ3DB7W/zUK6f WfuA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=mieebBRt; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 78-20020a630451000000b0048e3356d9efsi35736277pge.817.2023.01.04.03.23.18; Wed, 04 Jan 2023 03:23:31 -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=@vivo.com header.s=selector2 header.b=mieebBRt; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233932AbjADLWX (ORCPT + 99 others); Wed, 4 Jan 2023 06:22:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234599AbjADLWT (ORCPT ); Wed, 4 Jan 2023 06:22:19 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2115.outbound.protection.outlook.com [40.107.255.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 888991B1CB for ; Wed, 4 Jan 2023 03:22:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZmX4pPpAjnJYPoiApretbi1LvnwCAaw6PGzZ5kOEfXhDa0yrzSWxdTjVVzPJ5LpKN4utOfOTrRg5RxYE2xz0ERg5GwXtTqxRZP2hTncaVRVqUWVw3A5wP/Hq7uwoT8ZxHy97pcmgUj1n4HRtyNjse12hthsJ29AeU0CfBDa/or2yo3F8IN4ZY67DVpRMRDtpeZ0Rgw5giHeLBHSGkRyJ9wM8EbKH2yeiye535cNMd/JTESLOgh62YObSo2I2XHWl9np0590pZqLSYcwzF2bYMmQQPzvPvzR3kTaW+o4ziJxGkNF5ZdOatDqTiL0sGmE4rgzY5Exz/ZDF4HJXrZlUnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=71nsvQsvnmS4DY1mivaFbSp5zykYRpJPABqQ4hhf7Q0=; b=XQ4E7w+yLafwZO2S/P2h3VCf+woror0Bfvy30JcVhdfZcK6YunL+gDZpCLmZ7kDx/xmi2u2zWkLGh399zNqg3HTZhMd3xLAYEPeVKsDL1RoR+3iyNWtVRkxpkOCPZC2wiJ7JOcEp/M/B36XH7jExvh1AnqJw45c+4F9Fd1w5SIhT08y+SKom1gbGQmtSRIGEexBFb0SEaGUlpHIUCqAB4RkMJMMfF/7g+WzieII/I3oHgh0uFFP737Oyi7/m6T+oyoTDz60kl4klq0JdBA7UJKTK+8aDs8Fr0wcLOdGDFyGuw+I317bV2fW799Gw1ZwXQleLoZIoeXKZ3GCR3//jWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=71nsvQsvnmS4DY1mivaFbSp5zykYRpJPABqQ4hhf7Q0=; b=mieebBRtYzM7lZeTb9iKiPEothINfnz1ydPW8mn/YJjZ5A0gZ46ndXHvk6HrhQOKYKGH/PrIMmvE5IUGk4kl2WeSQHan6d3HHpcJxR1fR3RzkvO1v7UVOSZbsmMVahISgFCRJszEggnbIO8Ukqv7fZrbwL/hMbqNVjdtm/o0sHGq3up9/hbFQvOGq3lOn02kWSfhMarRCkAq+oWTkUP6cooW5oRAWD1Uh3LIorKmRJoJ75fCkLrv4ravH5HGEvGCVvBAUh1uP9X/qOcTlxv4/vlp7EFt6ZLfkIEkSlAf2sP0p4C8x2cmCyIAVB2igyLiwYv1sd4KLZ1i3v95Cr6olg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by TYZPR06MB5844.apcprd06.prod.outlook.com (2603:1096:400:284::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Wed, 4 Jan 2023 11:22:15 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::7969:5a45:8509:7d80]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::7969:5a45:8509:7d80%4]) with mapi id 15.20.5944.019; Wed, 4 Jan 2023 11:22:15 +0000 From: Yangtao Li To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH 1/4] f2fs: reset iostat_count in f2fs_reset_iostat() Date: Wed, 4 Jan 2023 19:21:55 +0800 Message-Id: <20230104112158.15844-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SI1PR02CA0002.apcprd02.prod.outlook.com (2603:1096:4:1f7::16) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB5844:EE_ X-MS-Office365-Filtering-Correlation-Id: 81279f4c-cbf7-455b-b6c6-08daee45ee5a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SzRPpLJfn35lmAH+wsiT8w8kvZGb3TgVaw6z3V0h9lKROKdAmZaGVFLRfIgGMRjvs70AiIgLKi0ij9dN/4aRZ0MJPDD4NoSz0G17JU7xET36ErA1iLe+/u7HWGtkvJ2z7qBql5XAbPuPeSEUxikl4+0HOoZ1rGclzRVbMOB1RD/GKQxbS+CUy/ABQk81Q1v2RTuDR6qRf/VYYy28h45fXO/OwEG4Txx/kb9pRedh9MPIPOjNk/WlQWWrb7US1lcndAn00zBgV+1aprnk/Qi/B6FNnqlGop6HqPn3bgjNkmhgIfLZDG9UX544RIjR4l7hQLyhBjgaj+UNuid4ytOFpOOpPiJ+QViSDXRpSu7Zgtaosu9PDSv/2XtQyTl5baRrmyc6aZHcbYv9I7qxynglbMgkesmAZXeUZg/nlNZKmUwmnewfWBAg0Lvzsg6+hDuFZ2naIlmLV6iOaM75jD4+7nVY1/aQqDycvH2k75v91g5RRn+8DsFxFv+E83BL+zCP9K7NbOudImmDXmDyxbHOhFmFk2eLlKE0t/l0T63WmtEYkIZXbnRr/4W5AOWZ+jNdhUApaUzcxCINR27gNmemWcAtv70tBee7FA1eUkgJTmi68eTY+K+pbcWp3IA2STrC4nzfDbM9ePupdl+WM5iPfw2tteN8+5RkygKzEg2a0SeOs0pSt0FrzUDPVZGy2V0K X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(366004)(39860400002)(396003)(136003)(451199015)(2616005)(1076003)(83380400001)(186003)(26005)(6512007)(86362001)(36756003)(38100700002)(38350700002)(2906002)(5660300002)(316002)(8676002)(66556008)(66476007)(66946007)(4326008)(4744005)(8936002)(107886003)(6666004)(41300700001)(6506007)(478600001)(52116002)(6486002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rMy43p+ufMFGmGeBcoOrg6vbIJBdAKLQ7dDmu1LwZ3FXCWta5nrygEB0wTjOCGNq8fHFrxeCMq+JGKxqmvmMVNP3yo7Ib/v8bkwR0RPQ5sfvvMk7Qgyb8H5rpL/oS2hA6ptd82x3JkYXZwin6dAuBotGTMtlFu6wITwJoTj1v1W8Jh+m013UklmzkTXCCeFEKL4uPMndEGSSoaNcSS0rFEyUgs0MNDciJ0yWqwYcSS/pbmWyO9Onk9eUSKyH+KedShl3pFF2oxq4I6OpREN83YLviyeh9/yEdXPEaehnN2Qx4tEl8+8A+1tf278Uh8cR9L0jG+MLD/BWDvSFdLuh0t2a2hg/RKVa6+GzMfldJhB71nMCoq6iJFRhkqxnQsiEMm3c8jHJex6EB1PZpeyzrhKM0/R6mO8Dcb0fzhvoKbNQTZeDUmwfuQsoUtTYNPp4tqgu0U7CCmoDGnWoNz+Gr9kPdbqrYb5i9gtJr4MOBVlJt30c3FMLK0hibqFOeHbl5cEBrO14G5mnFcuTDm07VTJwS9lHRy2GlkdEtAr7hAq+3nZKIqmLvGIIpuBx3QdGPT7Zjju1iHZfD4RioNus0T90FPXSTZy6bRxWXGk5jZtNfY80m2SQjl9zIFSAohG80lYfoTUVGd44ZUBp8h831wZNpZR1mFXWuPx1c0sixHb9wSP3uw5AnTgeMijYEL2ZCoSnSxE1bajBKLgrCbomkzzDiolXv0qwQMPoMQ0MUVj7IQzg01f1KQ4RWYzaAmYv32Qb5l/5X+geGIzA5bGZfBUQ/1eZb7El5SVO14HZ8lwYrtoH2wR8m8kxOlSb7+2i+z/7SR1PJ2KC6A/SGs9IVR5kpt2IYL0m8LNC/798adSyTV0jI5jmLcBxadcu0JQgG0KQQdmJs2/cfBAs4kCMBxVVnavEOL5Nt7ndxWN/YRd2MA3hbR9n8iUPuxstjwCpcdDn7SAtYkf1Ysq9KAIg//tujIRqHkrhG/EZCm5SPTx0n5mXfiIh7Niv7AnfVXnop9QGf47JYwmh4pcI6AbDOtD8TfwkejJVMZUoVm9vlve3hULPqNw9YNR5SjPs9C78XClSuOWbw/NfTYpc4qc3zCcXfh5+h7OeZi/gdAxLFiVnyy5xTpP9yB9R37NE77BREZ0fV9flxXQB/DSaYDfdD2UrBaYyIDy9OFLQzSEUvfY5X5GFEjYwrGsmKhNnVrSVtwFU8OZ2nSGP80qO7cYKOf/lExa+xSvOo8KO0jV5UT3x3gGajA3fYYwfpyQ0lKNRsXGixRxOKt4GfPFefQVqtxWydSmHBhklpvoBDcyEZ4VXOqqG/tU7Dg80t7cND6pOctzCnYc2XHUCscbNQ96DhNOthtZF/FUDYQU2pfA/Pbgrnne0PGnq2q6cI5A9NwwM5ZQB/M5sIt+MTjPVGb0t53ATaXxKztUKDrBBoxiKh1GZvphzjtLI23d7J2VJ5Eg9joD+fINKUkFhaO0ZV5B8s1h+3qZdleimDLOrSq9qFMJdPCCdreN7LFH47c2tVeO7XUpgfOLkv76ttNctoklQTtYxrBICygEbq5SqWgVzL5JqdvmkN1wA6bnw0zamd+KX X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81279f4c-cbf7-455b-b6c6-08daee45ee5a X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2023 11:22:14.8405 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eMQWu53Ux8Cyomj2AyKD7iTIlmrUq4Rqo4igYx+D2JaYge3Q4JGh9Nx3STPHsFqHFXTEkB+bHRE15UqOlLS42Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5844 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754090870308708171?= X-GMAIL-MSGID: =?utf-8?q?1754090870308708171?= Commit 8754b465c249 ("f2fs: support accounting iostat count and avg_bytes") forgot to reset iostat count in f2fs_reset_iostat(), let's fix it. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu --- fs/f2fs/iostat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/iostat.c b/fs/f2fs/iostat.c index c53b62a7ca71..8460989e9bab 100644 --- a/fs/f2fs/iostat.c +++ b/fs/f2fs/iostat.c @@ -220,6 +220,7 @@ void f2fs_reset_iostat(struct f2fs_sb_info *sbi) spin_lock_irq(&sbi->iostat_lock); for (i = 0; i < NR_IO_TYPE; i++) { + sbi->iostat_count[i] = 0; sbi->rw_iostat[i] = 0; sbi->prev_rw_iostat[i] = 0; } From patchwork Wed Jan 4 11:21:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 38873 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5090549wrt; Wed, 4 Jan 2023 03:24:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXvxjV1ko+he/ya7F+DPPma0LSuhjSf3vodq4ndtg0EOVTnIKMrsisZdl0P00sHlrx9hF96W X-Received: by 2002:a17:902:e411:b0:18c:cde:fdda with SMTP id m17-20020a170902e41100b0018c0cdefddamr49490056ple.37.1672831456205; Wed, 04 Jan 2023 03:24:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672831456; cv=pass; d=google.com; s=arc-20160816; b=JCkIaneJb4njGF+o9eqMiiYm5A99buQblldrfi6v8Lu86Tp4OLob9L5PkC8I3jsPwY NhSaVCyTBH5B2niC9miyL83T5o15EbNT84K8CGAXbo0BuegTx13qh2RkDdUikMUEi7R1 46hMCy4LjOsRZtTOa5/5m4F03BFrJ/IvWouYHbA/KdHc6JPUMdhmCwBwoEsL5IeVh/dQ nryZOnykHstTPUNeYKjNU84KJvqjAwKL+CmfnlVnqzdD7XIHPzKGLqw7qBGtCk5hti2r DHJHemWc3ruI7IhyWtWO/d5ATEZ0Qu2iuI3tIkhyr7FdNynpisgw8UbTTD1fyr8np5fS 0+og== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ai+JopXKJvC1B6nBPtp1iRnXscgXjQpp2sOPErGoMD4=; b=IaAm+IHE7pB74viDperqP1+pRy+2EFZ9awfl8x+bkeEmxZDkVQJOxpcMjTHocsk/SK fhsl1qcHJ84bxCjdpZoDJFE2tvMCW8YPFEDrNJWachaxUeq84/C8HLi3RfvhzH2kCuxC hEMmquU8rHrDizhmAo7kl78EXvzviSUEOYZho229BtEJEh+l7hLhnwPf93kEwrmRlzeO 9igr1hohMYXsKm5S7RsoXQf9lG5ZWGV4nhdOg4yyF9R7JNiTFGyY7bvB9EYPH0dxPMNw bZoSWmw8jMtx1c3X7fgGA7WROuDkvLyp1/sAGcm50P7G7A5lPYKgH6GMtn7JzbwMFgNl xU8g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b="ZHLgbS/5"; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j7-20020a170903024700b00182c510591asi39311971plh.246.2023.01.04.03.24.04; Wed, 04 Jan 2023 03:24:16 -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=@vivo.com header.s=selector2 header.b="ZHLgbS/5"; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239095AbjADLWc (ORCPT + 99 others); Wed, 4 Jan 2023 06:22:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233067AbjADLWW (ORCPT ); Wed, 4 Jan 2023 06:22:22 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2112.outbound.protection.outlook.com [40.107.255.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ED4D1AA2C for ; Wed, 4 Jan 2023 03:22:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RhhwM1WabHbZ2fsq8iKNpD1LyWAr5PQ+VEJlaOBmzCtyg3fhmS/hLrVTkI98bMYdPHOE9NkEHT2Pz6WRJI3HJ5HGlGdHsQdmdE+1pg/NSBoy93+i31lgyZj/u5nKdJ7UbT39vCX5J5boC9oejRV6lcFgJHxvCf4lvH/5pfUOKdIUbNIcLBBGdcpf2udd5/KWHIHgMhGCSC4HZOko+NCbs9ez5Dumn2TuM7RmMZtjH6bR89z1qnJsAtR+4w7mJpRF9Nsm2eAYqsicpvBCcXJy8F2S206zjYTc+KbAcUDSkxbwdKDxt83SImQzUZRk5fJrBdFlmC4TpgSZOV5zvDqT/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ai+JopXKJvC1B6nBPtp1iRnXscgXjQpp2sOPErGoMD4=; b=LzDRiewMOfu2zrT6KBQuXCceyjxCLVqHmz/Xd1aJnQpUpQ0Ck49J6ihZ63MOUjVAENc95TlPBuhDp820ppcYd1LKux4Emtav0iYaL3t/xXI2fF2XWOsh5fZaNL3+2Xqt3JF+hxyhLRwEpIk/SmDaGeO/XAi8/UefpgEdvhkpPRsF2rMsQEPhJpP3yirerCUl6OUWhnsf5n03OZdiYKNC899TOw1duFJxoIuU51Kgku8FkN3LTMR0UkuL5ERiGH3zL74WWPI15LXEmUaJX7YhHCdNqd8wVZcDuKtf+wzAlT34pxQns20kYS3Y52bfsV9cqM8Hg4vQRSVkNiJAbL/LKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ai+JopXKJvC1B6nBPtp1iRnXscgXjQpp2sOPErGoMD4=; b=ZHLgbS/5djIg5/1heBGIHv6ncWGJcHEJCjOwrwLWCXsTHrUAY93vL4yFAYTtlVVKWQGDAKZUkwKKc3MFxaEhFmxNQvxkHlNQTXOUvJYF55EUaUvUsYMjFLI9MXhK37sH4UXUES+A10wsb+DKxN3qxpUahKlxeRmLfadrFedrQ7jeS0LENQTYoQKh11E/LftsA42j6KfBQtoeQ7IVvLCGlx1r9SEGtwH63EV0dR2QUspHO20fNzsCm9qOxEOlHulUSon5kTNyHe07djTxe4qqAzeIA6xrRzs539sESHxBOokZuRvBC5uGbgmwS1kAmC1YOtYy9oaE7pzWWJ8utWJLGg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by TYZPR06MB5844.apcprd06.prod.outlook.com (2603:1096:400:284::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Wed, 4 Jan 2023 11:22:18 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::7969:5a45:8509:7d80]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::7969:5a45:8509:7d80%4]) with mapi id 15.20.5944.019; Wed, 4 Jan 2023 11:22:18 +0000 From: Yangtao Li To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH 2/4] f2fs: no need to call ktime_get_real_seconds() if iostat is not enabled Date: Wed, 4 Jan 2023 19:21:56 +0800 Message-Id: <20230104112158.15844-2-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230104112158.15844-1-frank.li@vivo.com> References: <20230104112158.15844-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0002.apcprd02.prod.outlook.com (2603:1096:4:1f7::16) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB5844:EE_ X-MS-Office365-Filtering-Correlation-Id: dbdb3fc4-e1ae-45c1-3231-08daee45f0aa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Kca0+7/glkjNtOiJoauv85PRAIXvI6mMDIYIbq0YkDxd1hwpaFdG/DbImubhDGjT4ta6RScL9VOMFyGtOp92ElII6mdB24KWkN2d77kEyvUJAdrseAnlIkNA9C+kiaGAzBt6PVRtJz5d73v9tS7Bhj2ZMzXiM7UK5KZvQm3+NVU+iphRepoccif5HK7gxKIwZz7g7baB6b3sh219X1F6LG19uHw973BTaIuWaeRhVgJg6As/AgQJeJlqPsLWp4KfUvr85nYgs8hLrjdUurzSGm1w0MqkXii3e0KRptEL+LA1iBoZVd7tS0P2oUsoTcZjxlSuBlVWK5wJRWcbRdqYUPiJsl96WbcAlshEojM7A1O3N7ePfgXX0e009k0h+ynceK/0wexXIBqfV3FZlV/VACoS/3f2g3s+KAVzuTclVzgKBuTq+5eGZ51n1NCxTgnD9GGDicd5dqkFxBCR1ASC9M7U+XmpqlWBEkV2WyJEfNk6rBMPQXNmCqC+KnQlxFXY9sn/aFusogF70+Gv+yZnbvLLvW/hG+8RuJpFKkGUjbi8/Wmgyz8fhC7sCsu96wlhnrOAOFydAcgb6D+LP271AC3YBnGMv7U/l2s9uXo5vY6hAkRfNwDAuka969MslAI9LvprgIrwB6FGv0aJMCsqcL8l7JGQGDn5wgSZ/JzuJFgBth4m+XlDMA04/9K6U2W0 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(366004)(39860400002)(396003)(136003)(451199015)(2616005)(1076003)(83380400001)(186003)(26005)(6512007)(86362001)(36756003)(38100700002)(38350700002)(2906002)(5660300002)(316002)(8676002)(66556008)(66476007)(66946007)(4326008)(4744005)(8936002)(107886003)(6666004)(41300700001)(6506007)(478600001)(52116002)(6486002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3NpFpwLocz68LR/PWqTmKLHQmrmAx1HRzN9nNIW5QewrU4k+pkz17u017vX8IEh+Ui0tTLhymOf+GYjttCnWOpQe87sjB0lSnaFlskxkby8vdfj+svBJK2VPtXJX/9qEHfHtVQ+OMvng4cmZ6ZSeTrlI1tIkKInN+3zDJD+CpDz8UGzA04Q8dkD6ZJFhe9loLf9Ul54lhhRjTinksAbqTlDdp4vh6JwFkCdirDnJKPMI+DFo2vk91q1DfQAL7AQy88vJPFS+DldACZU1icPGGRkqgu2t+4tCuhVhLuq8Nwy4PhL/g2WIh8xWMEqv9dgSy8JaASAZbzUTAbHO/zPeNAScujkr6D0JuhJPCTnMt3lBtdhYt6Ot0DIrLCTmYpbr3ggwzX5wgEDy9QSiay/TQsO4cfe9GKSS+4k0fxLJlXjgz9dAwCAhLEJnsG92u9ZsJ+6JZp8ZarA2ER65CsHlhv9oAkW4+mfxSppafrbExSZRcS6fZHXr0yWStCyRgL8IdJ3ggxheTyeijnI/DdUosYXhI2CvKMIxtb2CMACBk8XK4eGBfkt3iJw3qGgiYcZhYOneYkQjZ2OzGarCFfzyygCpJv7NmHaMP8d2Izx7q1rLTx+VWvGJB7BAhhRAW2zB4NVr+yHGfTWlNTA0VmBLdqBkPR35sHGVgG8gwrW9KVPC4E1mZg1537QUBwMQDIMuMcKI/jbKHGEFYOxe47vsjr8tcl9HQ5G7HDrwCtwCrWYaySWxUnV2fhwIH7RohVHOqfaKGqMyYuiI6fW1tcAG3v1M5XluzGdp3c2ry6aIK0UIUZ8d89eudM833LrWQ7/MVAJyxjaYyHkuhUOpJGdEK8i5ccUFQGV8odCWiy8pEgp7TDBFNBiMYdJcT1cD2lxiBMDcMjjqxet54zGV2PQ8jfBUWg63G8cPhvdU+ma4mZW8RPfRy7r/pRFbEg/VIHt6Kuscm47Jnm3TPfCbZ9+u9MpSYjxDCZPHrDUQgdepEjzld9cMfndcXVfZEajcRJSmTe1HmxYloDhct71eEl+YzQmZiq0ZiR8PFcE3VxQ3aV0eDUwAResXFeuyQRkIOh9ROXNaau9+e6LHVYJuTQ7HOn+B56wHliSKcuDM8KWE2HB1194OXALZXi8IB/Fzt+kqMfuOY2p7Pr5FTl6zfcKtqzLBqjsxMmn3xOm0Acv8biuYaAwCv+xLAeLLV9JIHIlwX7uiGRtqU33BHsasz1Bjpbwt7UOOQZUgL4zz/R34G82hrIXHUVvsAN2z8Z4D8CPKxBbJWKAXYP3iSb2/crRH364XKm4IJImaZ7gj/PibvhCBpXVMAGO5Q+xamEGXPZLXBTyW4ZkgP/xWiPgQo3bPJBEnvsPtF8ISKhWmUuFYu5uBzB8RJlSD+ENBF5ZhiY3ilT55ofc4B5ol+qeec70xnUdYiOUY8gNhp2gWzakLyKsMQ2/+lP3WvVJTaBOs89QdqcZKnyllhMg6BCxgjacCcIP3J8n0S/Z0M6zcM7GpuAs+QSI1xvWaBrPzGZVDYGV561pXR6Rx9QKbZj6wL5gUhaxum3Zi4EEZzD45PKjIgVv6/aJ/nNAWC50lo27wRGYB X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbdb3fc4-e1ae-45c1-3231-08daee45f0aa X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2023 11:22:18.6529 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hO+6pAc/DeTQcLTZHX/WX0t/u/CUE5Oqe0LieDKqhGUh91lJy/dcBWCW0ntE78zh9HzgmtqfD5v6xh967eWCWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5844 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754090916800969665?= X-GMAIL-MSGID: =?utf-8?q?1754090916800969665?= When the iostat is not enabled, it is meaningless to call ktime_get_real_seconds() to assign values to variables. Let's put the call to the ktime_get_real_seconds() after iostat is enabled. Signed-off-by: Yangtao Li --- fs/f2fs/iostat.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/f2fs/iostat.c b/fs/f2fs/iostat.c index 8460989e9bab..e7d03c446994 100644 --- a/fs/f2fs/iostat.c +++ b/fs/f2fs/iostat.c @@ -29,12 +29,11 @@ int __maybe_unused iostat_info_seq_show(struct seq_file *seq, void *offset) { struct super_block *sb = seq->private; struct f2fs_sb_info *sbi = F2FS_SB(sb); - time64_t now = ktime_get_real_seconds(); if (!sbi->iostat_enable) return 0; - seq_printf(seq, "time: %-16llu\n", now); + seq_printf(seq, "time: %-16llu\n", ktime_get_real_seconds()); seq_printf(seq, "\t\t\t%-16s %-16s %-16s\n", "io_bytes", "count", "avg_bytes"); From patchwork Wed Jan 4 11:21:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 38874 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5090865wrt; Wed, 4 Jan 2023 03:25:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXspKhTHDeELmRWjWjfhOdWGdpM5ZnkdvSfFiQ/trClozwHRFvK/ywEUR+go8F/8tu9QzluO X-Received: by 2002:a17:90a:578b:b0:219:20b4:9a0e with SMTP id g11-20020a17090a578b00b0021920b49a0emr66081022pji.24.1672831505389; Wed, 04 Jan 2023 03:25:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672831505; cv=pass; d=google.com; s=arc-20160816; b=t2MmUzN21xnBNxDsTwOu8+ARBocfSqtjsV6vgu/fdKV5PtIsNNgFRlMzPYwhINIjws Cwr4m+HPNQ6MbR71al2Qkgqx2PRjdVnD6bRAnAJhqRU5BmaD+2c4oqnA2+1KsG1Exp83 M4gU5kWwdgVA42ZYnXUTYA01ezHXdilQ9/hDJN6/NnJrQ5JPVZXF2MTp+OavmS6D1Edz hidma/ZmlzMBp6LRuhxk5tpC7KmVnRyTvFE+RUeo3vy4LYugPGfGC+BYhqrRNosngiCo lZr7nVV9sPJoGj5gcVsTJqLHgLlF0nDKDc6Rf2wVVyfyaRVvTIcQSQIkMBvZprvIq/Pe mZzA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qjwULjQGIH4Cm97/TrUL4gWBgtTtG0b3tYrKJb7k6gA=; b=ipv2J3jcqTDVMlG4WfTAptO2cxP9oEr3LOwpL3mTPysBiQmXmEdYeWd2Q7CzPwfqU2 dw5OtWCVgMZrZEQfOCHRcyD1wd1jNqJHIE0D1i0J5mmRNmifCqFRcFmp4SL+Cj+8EkI0 NfbVdk/nqhPfMdKGBo2pAS6VgGy5OVgzxrvQl259CAHSRVdkh6AHe2wsiFCPemMa/7TN hylJRdWTRKjRQ0gosMXdkjkBOgCIokabT3Q8LcoLbqAglNVRLHVJ4m6VDgw9CXwFXvXL MQzQKRDceiEjIpHbKptxv/b3P5Pmrc5kwTdepotxIfJXdRlFD+YYnoKfVYegxRhDJRXc IO6Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=Cz25gLpm; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id np12-20020a17090b4c4c00b002194574db1csi42404491pjb.142.2023.01.04.03.24.52; Wed, 04 Jan 2023 03:25:05 -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=@vivo.com header.s=selector2 header.b=Cz25gLpm; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239116AbjADLWg (ORCPT + 99 others); Wed, 4 Jan 2023 06:22:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234790AbjADLWX (ORCPT ); Wed, 4 Jan 2023 06:22:23 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2112.outbound.protection.outlook.com [40.107.255.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A12C1E0DC for ; Wed, 4 Jan 2023 03:22:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N5D6rekwb1Izc0ZDhgWFDb636Z4R0AFYxWHw9ikHsMvNLViJNmVSNZVrIQPjmn8IwhNug8fsTm596ZVkZZ18HOYLgVelpxqiAa1q/HtuvtV5kQDdaTsHji7+SU2AtXhIsb4pl3wwK3fqASX10BdW1lmSZKWZjGf/sBfRo92UASYAVKdilSfFftfDDu6DA6ojPkg7sci1MbE1YkFm9m2i9pdiTSEzfPKwFzIGWO8nRw55lki5HT+sYhCvsEATFlZm5xzOzRORhs56gJwuFNk6oQvTgJi618UKlx+QXBn+Qk9GH005HXrwDw2sZUQEfOtzdt5/KBkqgjJxuTqABMcWMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qjwULjQGIH4Cm97/TrUL4gWBgtTtG0b3tYrKJb7k6gA=; b=dayw4tdeS+6VzpachutenCLfOHYn8U02H/64+zPC0vfU2INBbFr6OPlAI2lxx0eoZl2cyQyQcG+dx3J5HoA9yO2bhLEGompVYh/W8F0hJJ2EngWAgyhrcFWOocV6a1nQAZZG6pf4WP6kjg2vEuDUqW7TePXIIwjpBy4CJuRblq/FVt9B/jgRlM+2QiwOmKPg+HUGpquEjzG6xo6IR4IQPAseNpmGTrfRjCeuB3Y+0mwCTMqPtQ2Bnw0PMVqE7UMUkuBi3zgPpgVGUaLgWroQMtnv2KSlayrSczM2dPQq/4KUtPwkX2QCSqz2JzG2fgn5W/NhFg++m9hjHxDlQhbHrQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qjwULjQGIH4Cm97/TrUL4gWBgtTtG0b3tYrKJb7k6gA=; b=Cz25gLpmWqx6lm9Zc9icSwyMAr5N3JimMm1bQzDhAIbsOkQw4XhnrTYSNYImys7Cznv/ynUfNXxee5bcg/4O5pZHQ7xlxxKvSF/UCC4G1pgAlo4YPgDJW0nJlf2PP6Hyw9rBenRFC1Dcv8feC/bDH06L01luUJArzDkx9Up+9Ir4AdcP5NAlHP0DQoV8E0WB8kjjW0DIqce3uK0KxyQp7A1txyWD0Am7NB1Jzfurrdl7L/prK4iSMtEOno1V7BbRv6mJvgnF70hzfioVOejVC6HjuK3KUcfhGynEhwTY2pDUVY3ThtCe9EuaMCNA+om39xaM1Yc77hTFFbDcWkkSDw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by TYZPR06MB5844.apcprd06.prod.outlook.com (2603:1096:400:284::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Wed, 4 Jan 2023 11:22:20 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::7969:5a45:8509:7d80]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::7969:5a45:8509:7d80%4]) with mapi id 15.20.5944.019; Wed, 4 Jan 2023 11:22:20 +0000 From: Yangtao Li To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH 3/4] f2fs: introduce IOSTAT_INFO_SHOW macro Date: Wed, 4 Jan 2023 19:21:57 +0800 Message-Id: <20230104112158.15844-3-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230104112158.15844-1-frank.li@vivo.com> References: <20230104112158.15844-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0002.apcprd02.prod.outlook.com (2603:1096:4:1f7::16) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB5844:EE_ X-MS-Office365-Filtering-Correlation-Id: 8976b458-83e1-40d5-3174-08daee45f1ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AXyDrg/KqLFN/TzkJJ8Ncoo/TqowXvVeNEXcx8pyk/X5IY3oyqevyT7U0LcUNsyfcFxHiZGlwJr6esNvfQNdvGsttZ+vMs8TjdiHpKGmMxk3TLSLPZFHz6B4fG0BC8ZC107spkyVD2bPPYBDA76OM21rDQUfelCCtysWrlAFlsnexd6Pj673cARqg6ug40XBFaP1zgVesTT24udbcEsClMb9WGjqsuDYZ7qCf0DODVOGR0Km8qN9jzniOHNE5xVyFw9WD1DwC+kdZ6RFmplrwu1pgILFNIVsipBHVfR+UO6hJi8Zv0WyKmyZ4FbgKb7XCrrildCj4i8p6ONmnbkI3FrXaaVhrs2w5JuKsBARUSbKqQsJ1DwOEpf3egqAUNCDiESdqJrA71ArpIwjkNjPc+zXA16qoFAUyAJKyonZIAJSnJXOFI486vrlVPm5ywGBjxaio/DknQsNyiVLGbYqS8xO1wXO9ObmUax+CAcX1f5QsmdpQpP6Qr89zaEk5Yk3Uy8woh8vmAdWjoanxTYAZiL2qVbozQYYiWxRRaca+gP3y70KAx2QiEmfK/l7pzFZpGF7U8SkMetTdGXZhAY2zJV2WFc8rNPb2XrcCf24NsYFe/Vv2QuX1XBCHYJRilBY807Lg9wzzOs24YA18+JEN3v9XkJFA1gecG47B7S2XioJ8NZDtOxcmqP2TMMOaUsK X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(366004)(39860400002)(396003)(136003)(451199015)(2616005)(1076003)(83380400001)(186003)(26005)(6512007)(86362001)(36756003)(38100700002)(38350700002)(2906002)(5660300002)(316002)(8676002)(66556008)(66476007)(66946007)(4326008)(8936002)(107886003)(6666004)(41300700001)(6506007)(478600001)(52116002)(6486002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SOAbJv/ln+AkRoYmVHoZc07fYN+0F10Jfupb8uLfSz9kz8NkzfeZUz2T/jiF/YodQ9Li+Lvinibt+MsmaoZytZLz2HEXB/T4TctDLGnuA4Cv4eDw0f7ANqoE4N4tt1HIUIcItXx/p48CVgqggRnLMPIv7FfN2N5tbeGLUCquZlMwAqGxe5PhtxxT2K1wVZPNWxN5TiVxjRxZIt+qy2mAlyEWe2Ptw3/oOFrSa4AzkKeB5cgHmOCCBSZfv1aABlTuRUlu15pmIffQVfw/k8bKvKOZj7ayBf08PV3nmvPou8FgOehhXGrg0ase5l1BWSRX6MAmIr8E24WoqJVSHsEyiW+GJuqD5j2F4FOQCa9s+AhU+gzqb9xct6qCe1E2UflwfTLESEJwpc77gMPUB4II8n+KgTiQUKnMztr/rG036im9f9X8ASls3/Yt6Se/+0nEpZxvhU2HIL6K25F+Onyva7cJof4PnUh2Et7GaYL/CRS65BrjDO/3QCZlZtGEw9poxvqTzxvjoiZqghuA9XgEHT0a9DL0qmVOpBvX2H2b0e3z+htF31Qv56WnsmftyC719DB/730BcdmUjzzsfhBUSww8tAiKo47y8+f2GXpRtW5hkUhpo5ohSiSTmmY+kn/U6dsBQ/XwntbTcZm2FpvCh+woOXZl45QeIKwWJlKjnWnkTdpxjpLKpVjbxSMdRjNWXdSaRZtO5aqC8uJDHWFZv+Y5QyUOLjLb+TcJYI9r6cUTlMRKXEbu++89nPztwtcKCTDmfEtG64vW3hnK3iXjMobomGePdEmenkCgenNkrtXlnCgJh3rS+3g1ZK/AejwGHAseoJVnRZ8dSG7xwZGXCfsN0ZeptSM2OlxYB7/SANC/+0xf0amkGObM1LU0yUCKb2bC//AAby9Bso1R1zHRb8Pu4KRVDnOnFm3CPlY2KYOlxoQ2msXo8l+bZgdtLdDjDlQWv35KnMwMUYNu9Jdwye5Q/uTBIH7KfUNbEGAtA2saCOPgLKWRVVnDK7Oor4pil4pbZMmbd5HBFyejqNwiDWIm00s5slAAzQFRYYm9fqN6+bau1czBgsp2U7zTSfbkRVmbm0SR3FkzUPQkn29duYOr5xg14jSzBjOczq8/Xoo+MbDiaeemjEu9ce4SUGIuZTMwC953w5qyrrZKpV5WhQtX0mhuzqOnowpyyyInvNE3XTDtohdBLpyLy3GEXgZXuH7vwFTtPHpO772wWUsfGNsSdTsg4FQFAKVA3SPGoz6lZGc1m9rRNg6H2isZBYPu14dESSgXI0QJT/E/8GUBsGjB1V9QEUTdJ/50hhUxBu7oT2ucH9gD4j2h1iSo6g79kyyhpXTbQYkEUPSXfgzM+t+Hr8GvsaPRnmd8q5ieW0LSwX+ClPpmg8WDHqhq7DbjD+YpUYvPdpaDXuzCM8rMvM5Arxt4VtPXUn5TpiXuV7Qw5CwtmYOKpLT8PKcP2B5BpVDji3nHrRSGPmvr06JE4J6+EHPicJL96DWgHZEdFN6TaF8/9jX3HMNi5trfi4HLRvv9PCaH5yMXXfoLMTdGBK1M5kl5eCpZX2psDS3Wnd6NhMn1MlZsQKYTy858I+uK X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8976b458-83e1-40d5-3174-08daee45f1ec X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2023 11:22:20.6851 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: n/uB6MbSkSSb+vMtiX6pF7kIVCcPr1Ewp2NvgPg5txCVtn5MYqrRSBgMZfBxJGcL3r06f+5eZRuJBRUkP8l6Hw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5844 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754090968579781757?= X-GMAIL-MSGID: =?utf-8?q?1754090968579781757?= Define IOSTAT_INFO_SHOW macro and use it to simplify code. Signed-off-by: Yangtao Li --- fs/f2fs/iostat.c | 136 +++++++++++------------------------------------ 1 file changed, 32 insertions(+), 104 deletions(-) diff --git a/fs/f2fs/iostat.c b/fs/f2fs/iostat.c index e7d03c446994..991605fcfe0b 100644 --- a/fs/f2fs/iostat.c +++ b/fs/f2fs/iostat.c @@ -25,6 +25,12 @@ static inline unsigned long long iostat_get_avg_bytes(struct f2fs_sb_info *sbi, sbi->iostat_count[type]) : 0; } +#define IOSTAT_INFO_SHOW(name, type) \ + seq_printf(seq, "%-23s %-16llu %-16llu %-16llu\n", \ + name":", sbi->rw_iostat[type], \ + sbi->iostat_count[type], \ + iostat_get_avg_bytes(sbi, type)) \ + int __maybe_unused iostat_info_seq_show(struct seq_file *seq, void *offset) { struct super_block *sb = seq->private; @@ -39,120 +45,42 @@ int __maybe_unused iostat_info_seq_show(struct seq_file *seq, void *offset) /* print app write IOs */ seq_puts(seq, "[WRITE]\n"); - seq_printf(seq, "app buffered data: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[APP_BUFFERED_IO], - sbi->iostat_count[APP_BUFFERED_IO], - iostat_get_avg_bytes(sbi, APP_BUFFERED_IO)); - seq_printf(seq, "app direct data: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[APP_DIRECT_IO], - sbi->iostat_count[APP_DIRECT_IO], - iostat_get_avg_bytes(sbi, APP_DIRECT_IO)); - seq_printf(seq, "app mapped data: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[APP_MAPPED_IO], - sbi->iostat_count[APP_MAPPED_IO], - iostat_get_avg_bytes(sbi, APP_MAPPED_IO)); - seq_printf(seq, "app buffered cdata: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[APP_BUFFERED_CDATA_IO], - sbi->iostat_count[APP_BUFFERED_CDATA_IO], - iostat_get_avg_bytes(sbi, APP_BUFFERED_CDATA_IO)); - seq_printf(seq, "app mapped cdata: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[APP_MAPPED_CDATA_IO], - sbi->iostat_count[APP_MAPPED_CDATA_IO], - iostat_get_avg_bytes(sbi, APP_MAPPED_CDATA_IO)); + IOSTAT_INFO_SHOW("app buffered data", APP_BUFFERED_IO); + IOSTAT_INFO_SHOW("app direct data", APP_DIRECT_IO); + IOSTAT_INFO_SHOW("app mapped data", APP_MAPPED_IO); + IOSTAT_INFO_SHOW("app buffered cdata", APP_BUFFERED_CDATA_IO); + IOSTAT_INFO_SHOW("app mapped cdata", APP_MAPPED_CDATA_IO); /* print fs write IOs */ - seq_printf(seq, "fs data: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_DATA_IO], - sbi->iostat_count[FS_DATA_IO], - iostat_get_avg_bytes(sbi, FS_DATA_IO)); - seq_printf(seq, "fs cdata: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_CDATA_IO], - sbi->iostat_count[FS_CDATA_IO], - iostat_get_avg_bytes(sbi, FS_CDATA_IO)); - seq_printf(seq, "fs node: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_NODE_IO], - sbi->iostat_count[FS_NODE_IO], - iostat_get_avg_bytes(sbi, FS_NODE_IO)); - seq_printf(seq, "fs meta: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_META_IO], - sbi->iostat_count[FS_META_IO], - iostat_get_avg_bytes(sbi, FS_META_IO)); - seq_printf(seq, "fs gc data: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_GC_DATA_IO], - sbi->iostat_count[FS_GC_DATA_IO], - iostat_get_avg_bytes(sbi, FS_GC_DATA_IO)); - seq_printf(seq, "fs gc node: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_GC_NODE_IO], - sbi->iostat_count[FS_GC_NODE_IO], - iostat_get_avg_bytes(sbi, FS_GC_NODE_IO)); - seq_printf(seq, "fs cp data: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_CP_DATA_IO], - sbi->iostat_count[FS_CP_DATA_IO], - iostat_get_avg_bytes(sbi, FS_CP_DATA_IO)); - seq_printf(seq, "fs cp node: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_CP_NODE_IO], - sbi->iostat_count[FS_CP_NODE_IO], - iostat_get_avg_bytes(sbi, FS_CP_NODE_IO)); - seq_printf(seq, "fs cp meta: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_CP_META_IO], - sbi->iostat_count[FS_CP_META_IO], - iostat_get_avg_bytes(sbi, FS_CP_META_IO)); + IOSTAT_INFO_SHOW("fs data", FS_DATA_IO); + IOSTAT_INFO_SHOW("fs cdata", FS_CDATA_IO); + IOSTAT_INFO_SHOW("fs node", FS_NODE_IO); + IOSTAT_INFO_SHOW("fs meta", FS_META_IO); + IOSTAT_INFO_SHOW("fs gc data", FS_GC_DATA_IO); + IOSTAT_INFO_SHOW("fs gc node", FS_GC_NODE_IO); + IOSTAT_INFO_SHOW("fs cp data", FS_CP_DATA_IO); + IOSTAT_INFO_SHOW("fs cp node", FS_CP_NODE_IO); + IOSTAT_INFO_SHOW("fs cp meta", FS_CP_META_IO); /* print app read IOs */ seq_puts(seq, "[READ]\n"); - seq_printf(seq, "app buffered data: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[APP_BUFFERED_READ_IO], - sbi->iostat_count[APP_BUFFERED_READ_IO], - iostat_get_avg_bytes(sbi, APP_BUFFERED_READ_IO)); - seq_printf(seq, "app direct data: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[APP_DIRECT_READ_IO], - sbi->iostat_count[APP_DIRECT_READ_IO], - iostat_get_avg_bytes(sbi, APP_DIRECT_READ_IO)); - seq_printf(seq, "app mapped data: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[APP_MAPPED_READ_IO], - sbi->iostat_count[APP_MAPPED_READ_IO], - iostat_get_avg_bytes(sbi, APP_MAPPED_READ_IO)); - seq_printf(seq, "app buffered cdata: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[APP_BUFFERED_CDATA_READ_IO], - sbi->iostat_count[APP_BUFFERED_CDATA_READ_IO], - iostat_get_avg_bytes(sbi, APP_BUFFERED_CDATA_READ_IO)); - seq_printf(seq, "app mapped cdata: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[APP_MAPPED_CDATA_READ_IO], - sbi->iostat_count[APP_MAPPED_CDATA_READ_IO], - iostat_get_avg_bytes(sbi, APP_MAPPED_CDATA_READ_IO)); + IOSTAT_INFO_SHOW("app buffered data", APP_BUFFERED_READ_IO); + IOSTAT_INFO_SHOW("app direct data", APP_DIRECT_READ_IO); + IOSTAT_INFO_SHOW("app mapped data", APP_MAPPED_READ_IO); + IOSTAT_INFO_SHOW("app buffered cdata", APP_BUFFERED_CDATA_READ_IO); + IOSTAT_INFO_SHOW("app mapped cdata", APP_MAPPED_CDATA_READ_IO); /* print fs read IOs */ - seq_printf(seq, "fs data: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_DATA_READ_IO], - sbi->iostat_count[FS_DATA_READ_IO], - iostat_get_avg_bytes(sbi, FS_DATA_READ_IO)); - seq_printf(seq, "fs gc data: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_GDATA_READ_IO], - sbi->iostat_count[FS_GDATA_READ_IO], - iostat_get_avg_bytes(sbi, FS_GDATA_READ_IO)); - seq_printf(seq, "fs cdata: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_CDATA_READ_IO], - sbi->iostat_count[FS_CDATA_READ_IO], - iostat_get_avg_bytes(sbi, FS_CDATA_READ_IO)); - seq_printf(seq, "fs node: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_NODE_READ_IO], - sbi->iostat_count[FS_NODE_READ_IO], - iostat_get_avg_bytes(sbi, FS_NODE_READ_IO)); - seq_printf(seq, "fs meta: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_META_READ_IO], - sbi->iostat_count[FS_META_READ_IO], - iostat_get_avg_bytes(sbi, FS_META_READ_IO)); + IOSTAT_INFO_SHOW("fs data", FS_DATA_READ_IO); + IOSTAT_INFO_SHOW("fs gc data", FS_GDATA_READ_IO); + IOSTAT_INFO_SHOW("fs cdata", FS_CDATA_READ_IO); + IOSTAT_INFO_SHOW("fs node", FS_NODE_READ_IO); + IOSTAT_INFO_SHOW("fs meta", FS_META_READ_IO); /* print other IOs */ seq_puts(seq, "[OTHER]\n"); - seq_printf(seq, "fs discard: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_DISCARD], - sbi->iostat_count[FS_DISCARD], - iostat_get_avg_bytes(sbi, FS_DISCARD)); - seq_printf(seq, "fs flush: %-16llu %-16llu %-16llu\n", - sbi->rw_iostat[FS_FLUSH], - sbi->iostat_count[FS_FLUSH], - iostat_get_avg_bytes(sbi, FS_FLUSH)); + IOSTAT_INFO_SHOW("fs discard", FS_DISCARD); + IOSTAT_INFO_SHOW("fs flush", FS_FLUSH); return 0; } From patchwork Wed Jan 4 11:21:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 38875 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5091143wrt; Wed, 4 Jan 2023 03:25:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXsqnGk3mOH2ly+lnzOWnHaRQqWBwFDus3R/GSTyXRVbQ0FneVNufW/7wqYADoO0Bakbi+bZ X-Received: by 2002:aa7:8d4a:0:b0:578:333d:d6ab with SMTP id s10-20020aa78d4a000000b00578333dd6abmr48714781pfe.21.1672831550376; Wed, 04 Jan 2023 03:25:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672831550; cv=pass; d=google.com; s=arc-20160816; b=HViNI9zJTLcSJaaYWwCWCI9Nu8LgTmJgIO4NYk39MuqyVAGtQngezTcrow0FgPmQ1t wgV00a4PO9NMW8Q3LZP7xuyfb5euK8B3qyhg92m05WsygN+gdYYHLa/3KGDQT9LDiAWv RjiM264RRwhITA5JjyIrTw+GDOJc10Crpqc7kWWc4A/7B/JnKMLb/ghwsl8q2MmxJJnT RjOv+RHw7oKzk+xbFbiOHC2NxwIA4cbF4p2c6IkrcdG4tmWwpPpZl25M30nioRA7mVYB rKdx9kkKzA+ARvH/LfqOKthWTDdmaqTQIUpqoNuA+XUZmF0FCp29WqG8OhCbkTUn4/2X Nzqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aTwZm2+h36fEdJFVdOIECscrmn5oM/ndZ/c6/wSyopw=; b=OiY8MwfDOudwPFAiC27R543LKIHaP0xeCBl4Mj+4fhC28Zi0q1aDPSC6OPdE/yx5oj hnvhTE4Et79Z8yR4+g2MFm3MwIyviATZAEFnHoR6STHr7knXqxeK8CGxkKbjkfwkQbLe c5M8fF3FP9AtJH7iMmpLXfN0Uzu8PdwkaW/MJAKr+H9p2S89LCsEX5MP1V4V1JqtMR0y c22zbfFyxPqgZfXFpC5+LMBv6uQhDz9M1b2r5yzeHWqA0vqJIPGKKxRKB8W04HLDFn+j tcFTojvD28NeVZlQb3VExalKvRIX2HH9pHKHhN/X630yCKZMBbOB+qUhKRaeAoBT4BoZ cxRw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=dRe38ct9; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 78-20020a630451000000b0048e3356d9efsi35736277pge.817.2023.01.04.03.25.38; Wed, 04 Jan 2023 03:25:50 -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=@vivo.com header.s=selector2 header.b=dRe38ct9; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239124AbjADLWj (ORCPT + 99 others); Wed, 4 Jan 2023 06:22:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234599AbjADLWZ (ORCPT ); Wed, 4 Jan 2023 06:22:25 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2112.outbound.protection.outlook.com [40.107.255.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF50AE0FA for ; Wed, 4 Jan 2023 03:22:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iU2qA4BZGeMWZ1gWC9PlU7x6QYD5Y0lj78Bru1q/mkKESwRVx6Fjv+11pnq6ON/TQ+ZE/73bP4LBAMy4hhCasUbvtu0H9u/99b2oOOjf/9ica7fNfKxS4+7hURbvsmeUFJrsKXPP176vCB4a7LWGCaajOJguRvcrDBsXoqmTLEw0OjqaQrLmIOlxIUrGOP8N7IUPhUVoRxPIfX/v8rPEzE35n/oC1d9Nv+MZmZ3rcbaR/wQQdV+PhlXcdX6Oq31QBdAC1AJBBnRhYrwgaboHCqa0Swr9lcPRUtC7/b77VR9EWwcBLPzfMIg2sqjQcHYjMofgvt3XkvyAdtML5loIJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aTwZm2+h36fEdJFVdOIECscrmn5oM/ndZ/c6/wSyopw=; b=k94Fc4xCkIbKCtd6hxAtx9IjtE5akF+FUI+rZ+DmQ07tjhZI9LsR2g+BO/GKFl0UExW+eLGmFWIjerL+PFbAn0uUFBUtAfpCT0SnzjmQG+Ar7gPAOXhD4dXkN+McU0Zotz33wfjBThW1hfn1SjP0PiLkzKqAo3tIrt76Ek6ByLX1GeZKyCBEZGkF0pBuPhL0kGJ6IkO9TzAdlpoaRzvbFLe5rajt2hjDbUeQPMbwx32v0FS/2VP+SDTacXdHgJn9MhdFiqi7DG3N7LeyPldnevESTgmXQRWKtpf4k3beIEGOSLxv/fyTXt/zP/8xOofYqCOEJPx78NL4Z/c3GgNw3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aTwZm2+h36fEdJFVdOIECscrmn5oM/ndZ/c6/wSyopw=; b=dRe38ct97em4M7l0cfgrb4NGo1inpUVTioAtTYt0poavt8mqFf3fRTAvEpQEoZvdF6SzRuB+JQjq4nqNxA/hV5cK3jzqypCs+s+vI1LaDdBvZ1g+GZH5rd8ORQd01bZO1m/+9mi8egm28TCOdMphi19lKma/Yg6vMr0jcIq1RuZ6mEEP9OGeAUNaD65Yu12HwFfv4T4xYbDrtyY20y/jU0NcQzLLIqGelpqszqqAMgnn0aX2bv1QWAmbx80hf0s0eHFPWjqbmN2TQJNNDtvbOf/rm9ndy6CmS3oOC/I4eJpBxVRp22QiJilItHst90rWnJzrFjuIeXNe7oT/zvqH6g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by TYZPR06MB5844.apcprd06.prod.outlook.com (2603:1096:400:284::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Wed, 4 Jan 2023 11:22:22 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::7969:5a45:8509:7d80]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::7969:5a45:8509:7d80%4]) with mapi id 15.20.5944.019; Wed, 4 Jan 2023 11:22:22 +0000 From: Yangtao Li To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH 4/4] f2fs: rename rw_iostat to iostat_bytes Date: Wed, 4 Jan 2023 19:21:58 +0800 Message-Id: <20230104112158.15844-4-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230104112158.15844-1-frank.li@vivo.com> References: <20230104112158.15844-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0002.apcprd02.prod.outlook.com (2603:1096:4:1f7::16) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB5844:EE_ X-MS-Office365-Filtering-Correlation-Id: d24588b3-2ed3-4492-1f40-08daee45f30a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mp9fTtMY6lu5xh2d7fk5cInns8XG51nVJDTyOVx88LkARXBHvqZ+rge5AtPfKc3V/myLibbnzYVNAsHCwMeE6lTq9+Mud761x9pE+AS4t0OE4xx040ZtcZUPWKsEG05Zq/ax7yzAzK30I1zRC+SoxABftJfYpr9BXx/bFBzPp17ssI7C+fiH74uErirnME9HbAnBmTVbe9JPDUpUfuPDPwoBxiE/yuDdcCxwjo1AB+s9H4T83khFrjypnhF9MTyNdig4enAV9GHRvtTa9/gapm40TjaiCt2AbF1J1DdYwLZDVnOmz3G0vvGRO4pylmwSvN2r2TTuNPdL6BKu7OKE2GFj1iWqTs7X1caS9VRpZUPFMcV9SVi0HxfT1d6TjP9wV3AgE7Km+v3B4ELdz1QCP8k4fuUENMSSuvDPF1b8Ui3Yo5YobeduwTCeXNCnF5WaFKrUfwrpUK5DJUiGqKZKQvxlft3O+9FwqGTeJbGsFuG28MDsgEPHXjGST167pY5CbNT/GWNpHSqcZbxtY/FWbZxJch/4DBmfqNRwdAAm99TpoFbJmtHaZVSXu8X+Heau1yPbvTFdI2qYBX6bU+kHIdt8zh3ZysqqQ0vDsQZU7Tbt+RIv36Gflw6VKraiTBzYC0ZL/LWwNBC71frxV9Kh7HHQKrjiQ8nzxgIIZhsHa3rzGA88LjvpBJnPaq+hvqyU X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(366004)(39860400002)(396003)(136003)(451199015)(2616005)(1076003)(83380400001)(186003)(26005)(6512007)(86362001)(36756003)(38100700002)(38350700002)(2906002)(5660300002)(316002)(8676002)(66556008)(66476007)(66946007)(4326008)(8936002)(107886003)(6666004)(41300700001)(6506007)(478600001)(52116002)(6486002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: A44h1MyPUepfoCn29VAkrq/QRoPbNwNmcpQR2JfHYWcLs23B63rPsuTnE5CSt0YQPjAomEt+cd5thxOjcDBT2HZ9kzIFCSX6O16t9SMliqS4ufAtfE+ePuoSbjO6iXFoCoFMM5i4mLshct5leppuweCQh7SDcIUnUJ0V1rYTxDMyPHUsO6VE1TD0pE4fD+Liosln4YtmnV/tCqEB/Hc4TY27iaCbp71WBo2KYHQTd0GpxF7j2ZKMrlJswzPBXMDVheyRcvpzQdOFcfX8S/v5zC/aQdkbyTiqO0cU60oZECAOC+JFvTe78XJfNKwh+qdk70jiQWLRAH13m1Dw7EIOE56Se/EYPQDl+K1i3IQbXGqvMTibufwEVSINjta150PoKtLSUoANP5KZ/jjqCKU7/g1WMhgiDZebQ1AFz0fiUm/Ao3zN90Iey+ZYj9iJ2NjqqpgTUnq/Dv5MRRYrWFcm4BzZvar1DDDQ2yFZaMrKpJsAcTolCeWb0wvL4S/SGGShIvxUX1czZSaxIpqUn+a2udn2aS6883w011PWTwv92ma1KvMKjB1x7DEd7FZBTGjnfiAbBmDd8DwlXMuHPTUoQ0S41zD7t2xTHLg95opAufMwyXnsHIpuuCTHEZodbmC7HkuHjQKk+EyVxSMjiHxnmAI5aZFvh6mtE/EeodUN/NH2Dylx/zov04WNEq2VT4lyIoeKaJcBA0ozsK4K64r23Y59GGTiXszQd3GePQ0m6lfK7YgYYIoG9mtoOHY+4S+Qvq52Ik5LeH0aOepG/qVPcDG32eAA+stou7I9wDMuftaDRLTkhaqdg33kbeAyRAg4sMGKb6x3oQV5sO15oXQ1XKx7bHEj76dyUTQ6re1rzqRPi+x71IFPqOUpxiysU5M3JmcjbVy++ftJ9D79oirVR4y8D2/mnpJxAgsnLWwpM7ub77DVJxcA7tcGSyGM3PkMielaE30lYamCsCEkkAwN7MaqOZS6vEh29P43jr0FcW+XKJihNp2WHvlvxOmRxB3CnNUU5aezOAdxAnpeiLd00/vnZRNACcN+ZdDcp4txhvkcmEI4V9caG6IHsEGlybPAQ2kB2OLfHRd42+mJn3tZij53EYn6ijQOA5HWJ+zfIw5b3np/8mEGfP291OveqoBKpdO8EO3+mdNh6T54xfCeKVqJlx4ILtZXskhYiUO+vNYGIkSlzAzfTH82hc054FmbPsIQcYkYULrc4RyDW4lunm95AVczuo2EqUnR6SFQ4/ed9LRNfhillzZ87osvifiSX6MwZTpaJW46sNgTx3Es2mFpbF+Bh6I6o3i8UVyzXzxOSoE77uiTbdk+olr/0mvvWwgs4YwKC7GNKbgjFxqGvcQw4wajrkziRDLom2Vh/li51YqTgLQ/oFNvruMfNBr+SsDbQBa+RErApzG2l6hXmcAm3T40pSq7tJZw33EdDNyzngc8my44lWkuKADfLM4bacTY7lVCxnkWawMTmHU3rqMaRp2fPBO9xksWY2yv4Bw8GCXat107jFXK7jYqyR4kXqvuNt0LB8XsZrZS6mT2YZrLLJgFwW6USpwIqFCxiGk5GkBu3WrvJhFRaCgoV/+L X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d24588b3-2ed3-4492-1f40-08daee45f30a X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2023 11:22:22.5746 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Sp8VHFMUzicHRKoUzKuHb+Df9il9SOe9p9WBNmpyHwtKspsfohfcpsoqyxKxheL+bVkhq6bK9xo3ff7bbyKMyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5844 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754091015572277065?= X-GMAIL-MSGID: =?utf-8?q?1754091015572277065?= The contents stored in the rw_iostat and prev_rw_iostat arrays do not quite match the meaning of the names. In fact, array storage is not only read, write io, but also discard and flush. In addition, in order to better distinguish it from the iostat_count array, it is more accurate to say that io bytes are stored in it. Also, the FS_DISCARD and FS_FLUSH_IO names are less harmonious than others. Let's change to new names. Signed-off-by: Yangtao Li --- fs/f2fs/f2fs.h | 8 ++++---- fs/f2fs/iostat.c | 20 ++++++++++---------- fs/f2fs/segment.c | 4 ++-- include/trace/events/f2fs.h | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 0a24447472db..331c330ea31d 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1191,8 +1191,8 @@ enum iostat_type { FS_META_READ_IO, /* meta read IOs */ /* other */ - FS_DISCARD, /* discard */ - FS_FLUSH, /* flush */ + FS_DISCARD_IO, /* discard */ + FS_FLUSH_IO, /* flush */ NR_IO_TYPE, }; @@ -1856,8 +1856,8 @@ struct f2fs_sb_info { /* For app/fs IO statistics */ spinlock_t iostat_lock; unsigned long long iostat_count[NR_IO_TYPE]; - unsigned long long rw_iostat[NR_IO_TYPE]; - unsigned long long prev_rw_iostat[NR_IO_TYPE]; + unsigned long long iostat_bytes[NR_IO_TYPE]; + unsigned long long prev_iostat_bytes[NR_IO_TYPE]; bool iostat_enable; unsigned long iostat_next_period; unsigned int iostat_period_ms; diff --git a/fs/f2fs/iostat.c b/fs/f2fs/iostat.c index 991605fcfe0b..59c72f92191a 100644 --- a/fs/f2fs/iostat.c +++ b/fs/f2fs/iostat.c @@ -21,13 +21,13 @@ static mempool_t *bio_iostat_ctx_pool; static inline unsigned long long iostat_get_avg_bytes(struct f2fs_sb_info *sbi, enum iostat_type type) { - return sbi->iostat_count[type] ? div64_u64(sbi->rw_iostat[type], + return sbi->iostat_count[type] ? div64_u64(sbi->iostat_bytes[type], sbi->iostat_count[type]) : 0; } #define IOSTAT_INFO_SHOW(name, type) \ seq_printf(seq, "%-23s %-16llu %-16llu %-16llu\n", \ - name":", sbi->rw_iostat[type], \ + name":", sbi->iostat_bytes[type], \ sbi->iostat_count[type], \ iostat_get_avg_bytes(sbi, type)) \ @@ -79,8 +79,8 @@ int __maybe_unused iostat_info_seq_show(struct seq_file *seq, void *offset) /* print other IOs */ seq_puts(seq, "[OTHER]\n"); - IOSTAT_INFO_SHOW("fs discard", FS_DISCARD); - IOSTAT_INFO_SHOW("fs flush", FS_FLUSH); + IOSTAT_INFO_SHOW("fs discard", FS_DISCARD_IO); + IOSTAT_INFO_SHOW("fs flush", FS_FLUSH_IO); return 0; } @@ -129,9 +129,9 @@ static inline void f2fs_record_iostat(struct f2fs_sb_info *sbi) msecs_to_jiffies(sbi->iostat_period_ms); for (i = 0; i < NR_IO_TYPE; i++) { - iostat_diff[i] = sbi->rw_iostat[i] - - sbi->prev_rw_iostat[i]; - sbi->prev_rw_iostat[i] = sbi->rw_iostat[i]; + iostat_diff[i] = sbi->iostat_bytes[i] - + sbi->prev_iostat_bytes[i]; + sbi->prev_iostat_bytes[i] = sbi->iostat_bytes[i]; } spin_unlock_irqrestore(&sbi->iostat_lock, flags); @@ -148,8 +148,8 @@ void f2fs_reset_iostat(struct f2fs_sb_info *sbi) spin_lock_irq(&sbi->iostat_lock); for (i = 0; i < NR_IO_TYPE; i++) { sbi->iostat_count[i] = 0; - sbi->rw_iostat[i] = 0; - sbi->prev_rw_iostat[i] = 0; + sbi->iostat_bytes[i] = 0; + sbi->prev_iostat_bytes[i] = 0; } spin_unlock_irq(&sbi->iostat_lock); @@ -161,7 +161,7 @@ void f2fs_reset_iostat(struct f2fs_sb_info *sbi) static inline void __f2fs_update_iostat(struct f2fs_sb_info *sbi, enum iostat_type type, unsigned long long io_bytes) { - sbi->rw_iostat[type] += io_bytes; + sbi->iostat_bytes[type] += io_bytes; sbi->iostat_count[type]++; } diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 34e9dc4df5bb..38bae9107a3b 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -504,7 +504,7 @@ static int __submit_flush_wait(struct f2fs_sb_info *sbi, { int ret = blkdev_issue_flush(bdev); if (!ret) - f2fs_update_iostat(sbi, NULL, FS_FLUSH, 0); + f2fs_update_iostat(sbi, NULL, FS_FLUSH_IO, 0); trace_f2fs_issue_flush(bdev, test_opt(sbi, NOBARRIER), test_opt(sbi, FLUSH_MERGE), ret); @@ -1184,7 +1184,7 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi, atomic_inc(&dcc->issued_discard); - f2fs_update_iostat(sbi, NULL, FS_DISCARD, len * F2FS_BLKSIZE); + f2fs_update_iostat(sbi, NULL, FS_DISCARD_IO, len * F2FS_BLKSIZE); lstart += len; start += len; diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index 9183a0a11e26..3852085198fb 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h @@ -1972,7 +1972,7 @@ TRACE_EVENT(f2fs_iostat, __entry->fs_cdrio = iostat[FS_CDATA_READ_IO]; __entry->fs_nrio = iostat[FS_NODE_READ_IO]; __entry->fs_mrio = iostat[FS_META_READ_IO]; - __entry->fs_discard = iostat[FS_DISCARD]; + __entry->fs_discard = iostat[FS_DISCARD_IO]; ), TP_printk("dev = (%d,%d), "