From patchwork Fri Oct 21 09:24:35 2022 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: 6602 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp590393wrr; Fri, 21 Oct 2022 02:38:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7dnbxRozHAPhjcOSLf8b/vBL71Q0OsYLv94fPocleQT224UVQT4roOIwIbmegBp4kcN2Sp X-Received: by 2002:a17:90b:1b42:b0:20d:6ddd:9ed2 with SMTP id nv2-20020a17090b1b4200b0020d6ddd9ed2mr58205707pjb.232.1666345099204; Fri, 21 Oct 2022 02:38:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666345099; cv=pass; d=google.com; s=arc-20160816; b=Auio4y7fabw1PptTABn0fzbKAcqnsz3+W+ohheARyRBSEVvoOuymxoaCtV0piIadcb zRemK4dSyJh9pUxsyRfqpfpP22LtSlc57WS3yzwyqGcJCwj7F+9nePGw9SxspWeJOTDB eDdC9eGUkGZ/V8hLI4HN4OFy+qBxWOFbig/fFBXRbQtVebsYEs2M/4crpDmYArsD9vKi FsE6xggSs2bpPnki0PvexhUpdDz9dopAe9fokVWerPC+PKqq2WN3AlX4EziVJXNRDXFN NwyWqp0zB72oeMJ40v0CtQU3Kv0thC4qOvU5tVR+09w6oXd3oT78EaKTun3ZIqmv15ln HQWw== 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=MeL1sbpaN1tsh35yh7Cv9PYd8DA5oMBdnIsSRzp43xw=; b=xiOBib0Amy+9xsHPQQSgqKX4WczCe2FA0LEhroEL/rUS9mAstC0/PvuRXHdnXN5UMw 7iLwJCuJyaZD55r8wUZhlYRQ0cAYrpI4SeUWwNOxB56N3mlNDeo1ESXABz/qMGiLgpKd GxIqq/aEHM/OerccIDPvWTW3lS7F48NSg0vx1DZufQBWV0HFhVENIGXsZAoR+R/x6Yxo vze5QDDNf/NASBXh5hxpGFweJkYm1kFvqcVAgiXtyoJmVWe/iiIcVocVfGITA4vZCkac D1iu3RuEUWM5RduuXytVndvWawhIzSA7tG/BKKsRCDmoA1EVPhK4hbyFHq8m396a9rIJ EWVw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=NmUYkAIb; 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 b6-20020a639306000000b00461f10556b9si23998928pge.319.2022.10.21.02.38.06; Fri, 21 Oct 2022 02:38:19 -0700 (PDT) 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=NmUYkAIb; 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 S229995AbiJUJZA (ORCPT + 99 others); Fri, 21 Oct 2022 05:25:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbiJUJYw (ORCPT ); Fri, 21 Oct 2022 05:24:52 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2138.outbound.protection.outlook.com [40.107.117.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2104F31350 for ; Fri, 21 Oct 2022 02:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jUu5J6UGrFxvkVx53OBj8Hqw36xqCb5M8W/51+6q/G8f5/m6/V7zRsJlAwPRF0RM3jzSX1V0EmF8hKKraKVLGIAR6kVSSYUggCkAXmeJyz8CgXHJUhzJqYo1gNjOIzLl2r06nJ7/zLGr3JgiK3OJSZ1EbmaeWOtZhG4fuH8Xi61BNP0veM6ZNZlvLioIYHzQuaU2Qc+O+Iof+AOK6lPrnvPwWEf9bMIhclMp1RkcnyM5ozVdC6Uj07SHuHWiEFsl6UPuRd7csE49Fib+D83VLUUDBPgdl42c/RAS+ZbDkkZhDHJ4z3Zxeyyixg93j6PqWqb1buDpr5CbZuDeK7AesQ== 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=MeL1sbpaN1tsh35yh7Cv9PYd8DA5oMBdnIsSRzp43xw=; b=CXPZYRUtw9Xfx1AYAufAFKooIuCnbzwQwPGEpACGZ5fLWDSUUypxF/PHiR3/dQ0H5MW8QCnTFMC6YF/F4aMjrFsj9dOA59yT1S/VC1YNdFKUHzFOP1psASyJyPAx2GjUZlwn6v6Ey7XEswMo6sXY74w1i2WlaOpDd+ByhHxIPZjA9tMKDGBPF8EeHxESgTd/x3CmtcAr940Pwc2I+4GjOvyVjGyX6TShORZq1PPb2xBviU+wb+Uxo5i0MaanM/vgEkZ//2kvAWh6elColWL2Gn3hYhlWYwEpxkvrVJDDKhC3dQG1D+U51jlTfmM9MUYYdDTzEEP/X9KPoQOf85cukg== 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=MeL1sbpaN1tsh35yh7Cv9PYd8DA5oMBdnIsSRzp43xw=; b=NmUYkAIb2Bty8riIFT7Sj7WAQ0Pi2fEYmH1A8mUTaGuBHWdU+NWstsi8JaJcRhuNmzGaybn8xNZHoeLV2Vy6qcozdMTVxevJcpSi2q7KGWqGGX5TFeDjxtJPkSTlmMHIyjjPbGEu+tBwEY+wObZIwYia4AMpNTwdBrdI7VR+ZYqOilocj1hrlil5MSpZWz7lq+On/aeGY065EVpazi5dEyEsqRuguSHTyTARgaCiuODdT8yCJIhl5Ip/bBtTFv7acIbQx5M2fRh7HfROr7SoFjclJO2/C7iQQWONJa9VNVFYrCGxOqovyR3sF9imDVANTrsoQPGQKKCbZ1NhPMRoPg== 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 SEYPR06MB5860.apcprd06.prod.outlook.com (2603:1096:101:bf::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34; Fri, 21 Oct 2022 09:24:44 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::c84b:5a6c:d66f:c0fd]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::c84b:5a6c:d66f:c0fd%3]) with mapi id 15.20.5723.034; Fri, 21 Oct 2022 09:24:44 +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] f2fs: show more debug info for discard pend list Date: Fri, 21 Oct 2022 17:24:35 +0800 Message-Id: <20221021092435.17124-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SI2PR01CA0003.apcprd01.prod.exchangelabs.com (2603:1096:4:191::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_|SEYPR06MB5860:EE_ X-MS-Office365-Filtering-Correlation-Id: d4f29a73-d755-4fc4-8bc0-08dab346171b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O1AO8FZy4YU0H4VWZ8zGjl9UIhU3X7+c/l9LSBHv4FABDPhN13hbdgg9Ai4nQwHCNvuMzCgWDUVENOb4C2XtfrWzYeA1j2GI+2jb6NxN4wayZAMG648vnJWrqruIVXegqcEVDNcmgW4dRMYJZJKFZhQ3Q5wJ8FcGXMT+lr8K8aCoMTH96Aa+tUu4cPx+Y/f2G5JkYvDQIPIfsf1+6YLqp4IR3o6AUMxVtfzPMCXdBkANWv5rtMrI56vXxEL3uQiww7ymsfLaFl8dRkiu6FrewOFAj+n4Q/ilgzkQZeSPx0eGFOHZtXSwLvwdZoeNYVe2ARyZVQbwKITLsgw2pniqHaicFdgzfOTBWiHeTxJVrJlFvHQq8qtWAZ1mpCGAnKUjD8/Ipphfo9lxAPhdIYr+AOqzztLQbn6+SGm6743KewkzPYVLM0pxOuL3Csk9+Feab3NWc5OQzDNEQJVaiv/nv3SJHze+lSosTTk/ncGgmnkhBvQJ3hHsLFTWl6m5aMM5rfM39qyUfjdvPbSO/eYNnrAIS5uHMgYecurAtrRKePk0N5syMZF69HlwGAxJhXQThK+W0P1JUVESjTcZ2e8605UHc5ZQRMw70sNBxB6C62icRueKl41RwqFUOBgRNVNiBRbrP7zFH9iYzYzwtvNb2kHrHHNjyhYbYBC6vWHmZ9QFIr/PEMnITqAJ4FahkyeN9S+hHdfbYqFO4tPZWpPApw25IgAR9my5MjnYqlumC8iy2AoPYIUr3fjymr4Lf/NOxVVWI6v9Ejk5qJFAq220Lw== 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)(366004)(346002)(396003)(136003)(39860400002)(451199015)(41300700001)(316002)(186003)(8936002)(6512007)(6506007)(2616005)(26005)(6666004)(2906002)(66476007)(1076003)(5660300002)(4326008)(107886003)(86362001)(66946007)(83380400001)(52116002)(66556008)(36756003)(8676002)(478600001)(38100700002)(38350700002)(6486002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wNc2Yji/kbtrQGyLurBSpbf4qugLAMT6/avwOOSl/z+mnXSIRWlD66NGpvQOiAACseX0jInmP7u/i4/ve1hTujKGR0E8D7mNrxboFcREmywzgYOrfuAG7TfF1KQZOApKMht6rtysC3kNgZHHc19rYLIElKOa3inX+tl91nwtJYsyaOyq1ssJCdOR7jJ37IWuxv8bcNoipoPUa9XrJ9+xvqKX+LqIufVBLRFY+6yOZfHMl6KjM7Q0FT4bBNg2T15dzlgeSIsaJwRd6EU8E2aNheZZ9xlPi0UO4SJxdTd/P6NTCA+aKdIjCwl7ZKbfdzjdgoAV/wj4sBx/Z16uugR8GUNBSgbKYnyCI5hP6pC744wvdONg8GUhQZe1KGqbISHoX7X1rol8WPrYdrRWD5n1iYUTDXYRTGXSzUBKXKGw2+bvJsrdqkWRcJTQfnageF5CESOQK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kHyUBYJfCTSdm+JQvS//DgWK2TuZJUuAHJchvAPJYOIbifoTKcK79Px/d0/7d8XvhHvuNJhPR8 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4f29a73-d755-4fc4-8bc0-08dab346171b X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 09:24:44.4203 (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: 44NKpmeo+3EJaMmNYrNgxGma+kgKdk5YLlu+VZlLPCCP5s6S+CNfYNsTPgUuys7HuTBv/+gGFkl0k6fcg1JUBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5860 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,URIBL_BLOCKED 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?1747289478281616224?= X-GMAIL-MSGID: =?utf-8?q?1747289478281616224?= This patch shows the discard pend list information: Discard pend list(X:exist .:not exist): 0 X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X 32 X X X X . X X . X X X X X X X X X X X X . X X . X X . X X . X X 64 . . X X . X X . . X . . . X X . X . X . X X . X . X X . . . X . 96 . X . . . . X . . . . X . . . X X . . . . . . . . . X . . X X . 128 . X . . . X . . X X X . . . . . X X X . . X . . . . . . . X . X 160 . . X . . . . . X . . . . . . . . . X . . . X X . . . X . X . . 192 . . . . . . . . . . . . . . . . X . . . . . . . . . . . . . . . 224 . X . . . . X . . X . . . . . . . X . . . . . . . X . . . X . . 256 . . . . . . X . . . . . . . . . . . . . . . . . . . . . . . X . 288 . . . . . . . . . . X . . . . . . . X . . . . . . . . . . . . . 320 . . . . . . X X . . X . . . X X . . . . . . . X . . . . . . . . 352 . . . . . X . . . . . . . . . . . . . . X . . . . . . . . X . . 384 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 416 X . . . . X . . . . . . . . . . . . . . . . . . . . . . . . . . 448 . . . . . . . . X . . . . . . . . . . . . . . . . X . . . . . . 480 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Signed-off-by: Yangtao Li --- fs/f2fs/debug.c | 23 +++++++++++++++++++++++ fs/f2fs/f2fs.h | 1 + 2 files changed, 24 insertions(+) diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c index a216dcdf6941..343e0fa3b1be 100644 --- a/fs/f2fs/debug.c +++ b/fs/f2fs/debug.c @@ -109,6 +109,7 @@ static void update_general_status(struct f2fs_sb_info *sbi) llist_empty(&SM_I(sbi)->fcc_info->issue_list); } if (SM_I(sbi)->dcc_info) { + struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info; si->nr_discarded = atomic_read(&SM_I(sbi)->dcc_info->issued_discard); si->nr_discarding = @@ -116,6 +117,14 @@ static void update_general_status(struct f2fs_sb_info *sbi) si->nr_discard_cmd = atomic_read(&SM_I(sbi)->dcc_info->discard_cmd_cnt); si->undiscard_blks = SM_I(sbi)->dcc_info->undiscard_blks; + mutex_lock(&dcc->cmd_lock); + for (i = 0; i < MAX_PLIST_NUM; i++) { + if (!list_empty(&dcc->pend_list[i])) + si->discard_pend_list_exist[i] = true; + else + si->discard_pend_list_exist[i] = false; + } + mutex_unlock(&dcc->cmd_lock); } si->nr_issued_ckpt = atomic_read(&sbi->cprc_info.issued_ckpt); si->nr_total_ckpt = atomic_read(&sbi->cprc_info.total_ckpt); @@ -549,6 +558,20 @@ static int stat_show(struct seq_file *s, void *v) for (j = 0; j < si->util_free; j++) seq_putc(s, '-'); seq_puts(s, "]\n\n"); + + /* Discard pend list info */ + if (SM_I(si->sbi)->dcc_info) { + seq_puts(s, "Discard pend list(X:exist .:not exist):\n"); + for (j = 0; j < MAX_PLIST_NUM; j++) { + if (j % 32 == 0) + seq_printf(s, " %-3d", j); + seq_printf(s, " %c", si->discard_pend_list_exist[j] ? 'X' : '.'); + if (j % 32 == 31) + seq_putc(s, '\n'); + } + seq_putc(s, '\n'); + } + seq_printf(s, "IPU: %u blocks\n", si->inplace_count); seq_printf(s, "SSR: %u blocks in %u segments\n", si->block_count[SSR], si->segment_count[SSR]); diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 2f33d6f23a26..c444f3f86608 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3875,6 +3875,7 @@ struct f2fs_stat_info { int nr_discarding, nr_discarded; int nr_discard_cmd; unsigned int undiscard_blks; + bool discard_pend_list_exist[MAX_PLIST_NUM]; int nr_issued_ckpt, nr_total_ckpt, nr_queued_ckpt; unsigned int cur_ckpt_time, peak_ckpt_time; int inline_xattr, inline_inode, inline_dir, append, update, orphans;