From patchwork Mon Feb 6 14:43:08 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: 53328 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2278269wrn; Mon, 6 Feb 2023 06:55:49 -0800 (PST) X-Google-Smtp-Source: AK7set+Ha7GVNpCvsCuEhMhreTHkFvvga6l7QvtuU8ZJ6trhGXuWcIwtCXSIWQS9ed4qbYsPVlak X-Received: by 2002:a17:906:80cd:b0:87b:d400:e1df with SMTP id a13-20020a17090680cd00b0087bd400e1dfmr17440786ejx.72.1675695349073; Mon, 06 Feb 2023 06:55:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675695349; cv=pass; d=google.com; s=arc-20160816; b=X4gKSZ1Zd2Vz3m0Ruv2zkAazBMDPuKpCo3T65WzoRMtz2rHOxZF/qPQXQfjFfxmKyU ax6eIHRje4uGk/dzp5ugxesbFkcVz69EVhxgSPzd2u91g3jLd+zZkxqojvuPhu1S91YQ 9LOYYVbJEJdKd+SdB6Jss6kNGnkplC2bFyP2NZ0ENthfvaDDO0B9WHd5A2kHj4MaGQpe fUhUn81xzOaOmN6edW05tJWmnSuK1TQpAnMkqh86N2Ubik9FHlxUnREjZw84GE7LMMqz ihBnwfKh9apCXWscIs/7adzzNsTC0rfcyhH1A0jBMCsV0xcOQOGqR4pBzTS6V1/C1nH6 xhzA== 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=iikdIJXshUUDmQOlc2PXILnzDwFSNzD28AtS3qvMCXE=; b=AjU6eRpkgpwGbFGduwPMthQBwwXbJoZsAIUtgXmhK/SfeMVXD/PV8iEA7CHjGssMAR ieiqzYScTYYZ2MBSdpPccrdzisFfOCg3vSZKc3SZiwTOYv9s34Avud9pvxZVamgLKSVs woGYNv36Mddpok+5ieJ4qOYO5JlkhkqMvkzvijlechDsnikFeRNX2lZI7r8YMaEfsLl1 C+rYZ5Qyj/jMA2CgNaqZN/+5GumoHunQjnMnKKwtcH+ovXkfrJG9QDvr9tbTvL1EjCuF 2wcS7qd1Of6Dnb2aRdlzpCZy4Mt8Ec4iIN9us5bTFFL9iHK6HTBZxeEPZuvWT4zrVFCc 5sWQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=jZsYa8oG; 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 ep24-20020a1709069b5800b00878734ccb99si12533456ejc.616.2023.02.06.06.55.18; Mon, 06 Feb 2023 06:55:49 -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=jZsYa8oG; 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 S231544AbjBFOn3 (ORCPT + 99 others); Mon, 6 Feb 2023 09:43:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbjBFOn0 (ORCPT ); Mon, 6 Feb 2023 09:43:26 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2094.outbound.protection.outlook.com [40.107.255.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D519244AE for ; Mon, 6 Feb 2023 06:43:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GqFwXfauPHX6pA+/Q2VTc3erQYjSBApxXdZt4TFTnQD0ANA1oY5JItClFS3AhUbf95xpcfKt/VQ9yRTzTR+EfySKeVedXlL3Jfdm3E3WW1pfSmoLnWrqXy6jqTLeWs6v5NsKdn5YsIyJMLs52Xk8j2tBNmL4COqty7qFUaeDZMZhv69NMkNkCZ+rbp+n+6+x7wY1Z3NlEey7e48rErfn8H3jpvtvUHDftP8lUq/SIa5aALp7h9PmWuHJc/EYF9fpQACwB42RbvLfZi8mSpMRyTss5Ic0BhdNuU/xB90xnWiW4N/sqj08qfxQb5iFmCDug0EB1ZRwp0JNjfEWE7F5+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=iikdIJXshUUDmQOlc2PXILnzDwFSNzD28AtS3qvMCXE=; b=IfyJdgwrVdwzt2fqXmzVTF6caJUSMPao8O+gNJfdBea+2is+cNWrM4j5rZf8R0r98JIGo1CqlGztK6rHOutcMliaXaJwH8gUmGLdzgnMDVXbo7XwnsNthvsgyp+pcomqeJAuImfpNeLrO8ByrhobC93eiRhR52YwS//I3ydhjjMMn/NUapN6KfOqSkqTyOtPkV9cllcMPw/T7IAHjgIDD8lTCWiMhN0v0aC8NRgraqUdJWc/4L3JwzrVvOGFTtpj/PFg8XeersFeTNhXnMkhp/xgUzh4qeZR4vMtA7rh34y0mXSXVc4VTeG0PeQEyFE08EuPe+UiX4l7v4EOybvxqA== 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=iikdIJXshUUDmQOlc2PXILnzDwFSNzD28AtS3qvMCXE=; b=jZsYa8oGq0zuWRKZ4nNUJJUEFnFg1FY3kEELaD0h45dG+UadvTIWeZmcF2CaZJo4rRkGqDldPLSRttdqR4kbVcNEyqB3qquoZq2m1ybTgEdYNpAqDJPVwtU/368dQ82KwAOq4FFJNKU7IgGlkd6GqW32prgg8Uq+rAIJeqigaHlhREEX3qJATEbBpVK3CmfpA8D5ciyTeU9oBZAFhO48KlCj78GB7THpIqbI5l1yOuD8Tgby3pgwQqINAjCU99lVYqRh9vjbP8ZvMAqb2ynmCAWroLmLL2VXZoyFU9GzBX0XsUKSQma6trxrvqTZlsSQBOSRUjI5XvDWSGvGfvImnA== 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 SEYPR06MB5765.apcprd06.prod.outlook.com (2603:1096:101:ba::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22; Mon, 6 Feb 2023 14:43:21 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572%5]) with mapi id 15.20.6086.011; Mon, 6 Feb 2023 14:43:21 +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 v4 1/3] f2fs: fix to set ipu policy Date: Mon, 6 Feb 2023 22:43:08 +0800 Message-Id: <20230206144310.2344-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SI2PR04CA0005.apcprd04.prod.outlook.com (2603:1096:4:197::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_|SEYPR06MB5765:EE_ X-MS-Office365-Filtering-Correlation-Id: 1fbf435e-9d19-443f-0499-08db08507e0f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4RbrPXdgFfIZ7u8TU4AW2LdHe2zBP/5jAHRGC5676pvGo3S13c76EKwyScCwDcwude8QImKbRgSRLAwMK1otNwC9h4G2npm160hhfplxAOPkexSdNEvpJCkmv0j3lwn9o/OUJ6Uw/S4+iptVB9Ejz91NZMvRGWOJDIjQ1aRxhSG1AuuY27PRixtImEgGTWA0UhIPCwX+w/2xbogeodvfS1Fgn+en0kulMi133rSYxwaGN0eNKShi5m9MtVmbYxvUI3dX9vQUqr/ENxpAIl/2Ss3BRC30x5BW2PNqC5+KmF/dWBk1F9NetmcSqntUnMaBlUqdfMfK0JlX+scDpVU09aCTkiQtDFAylScF5LqHBXf3pV+gR7M3ZsNARBlvEZoj0Drb/IUsrf4Q+W62bQjCVgU83Jwf04NOJpRL4hHjQJjG2Ua3GIMvOo5C6xmOaf+RdJ9AuLWsm87K2490yb5llx7BlBJBit4bPv4Oqzc3lq3CZAVb01cUcvIhGv8TI9BCfwPPwAJDWaO0+mI1Z6BdOyCmX45MYwcvPLDpKDjPTaZs3pYgLPJSy1RNw0ZXpd0/dPyQrNgg/4Z1HKpIjisQc0AgcUXz0838Q4rtX7a02JXM8/oTRVnxL+WAHVzRQtbikt9GmjgSjd5NltjVdaDZOnb7CzukMFzCDVaIXjsrUntpJuX+zxLrNHTZQgKFXgD2mL5SFWspQVA9UVcY1SbKKaJnKfBbSBIri38c8NYpV80= 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:(13230025)(4636009)(376002)(136003)(396003)(346002)(366004)(39860400002)(451199018)(38100700002)(8936002)(86362001)(107886003)(6666004)(36756003)(2616005)(38350700002)(6486002)(2906002)(478600001)(52116002)(66946007)(66476007)(316002)(6512007)(41300700001)(4326008)(83380400001)(186003)(5660300002)(26005)(6506007)(1076003)(66556008)(8676002)(309714004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pAv3ivSXgTriOlWbKD6fWDtuwE+2reNNf31oO273DneqinmP2IKlmJ4RY+my582wkHx6ll3Qr2JnJBzbQX5v8WXKt21XP0f5MaTA39xh2iIjtfNylxeqo3zgkpaEZIslN8Oo2+0FH9K2t23Bgv7rCB4yygpQM3UyzxNpW6C+JILUojH4jcrePt/Zq3yd/o7Lkla7NgblhRDMcPwjd9xEQwpIt4O1gi7SNrU11jFXMKbrMFKQPGm/mDZ9Mlqlyp1JOxHht5XsSkrrA5t8KCNY+DIMphDvfvqgN9P1rgVa4qNthXYlZ+h+kNz36CkU/Yv6tnWPMxH/JgqC5FXWjvgTPUY/OU9H7fdVZS5cQCnqIw9cFU6FY1oRqAzYiefDuF3CO0M+n7l1LgTm852Wss6ohG7H8sKnp7Ts/1BGZ9qH9fflFVbaw+z0XZi9jNhDYsQ3vFqov/Wl8XW8VGo+rCCRyWwqbq7X3zXht9RH7LfHmstWSGU0hlRdYsTCXu73NLAUhPy+LF61g9JEUR897uZJQkAkRULFaQGDD5+4luoBDnVTiTcEyunx3ddKSq34xRH557dsCEUM5+DMYyu4Hu6sngJOvSewYznJ2RHJ3WrAhxofSmt7oSV3+9qBbgRY9qH1hwpzEZv4UEDkEU4FHu5O7YHL61pK17rBcF/dRJdmJEe3VVXai2H0G948nlu42FRHpCE9g5OlxQh3rB91QbuVfu3Fp3hdlwTJE8NVcKY/n4toJs8szgqCv5cyxqYfh4B2z1V6/7rHxBOn5IpLuXBGhb5QrqleSPaPQPJEkHGt22HFhAW3V3GafVXyktyn7No356I17IORI/VaWpSwaIj4OfScf4JwoWfhXM+8KKt8X9AE2yLaNailJI21zcCzh8oGZ6z9SrBcw0C2f48lpK/uYc1QWiU4OxfHUg43zq+dZoJ04Z2jyrPXn2PhK0ByKXG1126hYRB5MmM4BcGZbja+0VC6V0NP4e3Xu732N1f1zKWdikcRYlJZujQK0CzlthA0DZ22T1GgGZEhbiYiWQMFr1XReBXLk/uWjYA7xod3JXoLCMq9Z++gOrYj+WfD0fbJar9zBiK371m6ENqV+5M+fL/7ddzXfloQlRm1kGP+q4mtzm8saeitQGybldlzL2dIrxYbF1Vse/gyJmtb8G7NJFiWpc+PX8kr7P3MJ47Clbxepi87cRxnTxLTpIYMnYQaC8ASpv3sss8Qfq0um4BjtXd2/arnXqErFI8aabchgq1e9tEMgL79oxOuyzzZN+UiPMxvGPjb/LRpLiI3R7fcbZA7J6VnXeHAw1W8R1dCjSaPzqyLDOnwExw18GoVN8sPmVax+3vi1JFHBdOhJH86gYCFA0y+VZHdmzMeX9C1Yo1+j8pjX26fK5jZsBmZc6nzHeFi5Q/4yCLBAPPW5B6XmwvhVMeHrmnL9u17a9EYRNSYLaCK4DK56yIjxCqLsQzlLldTIBOT42rIdAcNdpDAFIIQOmXFZKBpqAMYEmazC/8uFHqb6qVIGwUhf+6ShlT45x6JhHLclz6cipBsOePbFEDf5mGXdY0NYmIi65Qnb/rD8AAZNNYxr3FGqftp40am X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1fbf435e-9d19-443f-0499-08db08507e0f X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2023 14:43:20.9938 (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: 7UDtFsB6deO1E6Rr+oNxo50XiZnJhBbYDLPBpmAlSEGgWjOsh4FA+D6ZqCqAk9haJiOzWCoZXsd55IidHGeAhw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5765 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?1757093926094110898?= X-GMAIL-MSGID: =?utf-8?q?1757093926094110898?= For LFS mode, it should update outplace and no need inplace update. When using LFS mode for small-volume devices, IPU will not be used, and the OPU writing method is actually used, but F2FS_IPU_FORCE can be read from the ipu_policy node, which is different from the actual situation. And remount to lfs mode should be disallowed when f2fs ipu is enabled, let's fix it. Fixes: 84b89e5d943d ("f2fs: add auto tuning for small devices") Signed-off-by: Yangtao Li Reviewed-by: Chao Yu --- v4: -allow set 0 in lfs mode for ipu_policy node fs/f2fs/segment.h | 10 +++++++++- fs/f2fs/super.c | 17 +++++++++++------ fs/f2fs/sysfs.c | 9 +++++++++ 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 0f3f05cb8c29..8ee5e5db9287 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -670,6 +670,8 @@ static inline int utilization(struct f2fs_sb_info *sbi) #define SMALL_VOLUME_SEGMENTS (16 * 512) /* 16GB */ +#define F2FS_IPU_DISABLE 0 + enum { F2FS_IPU_FORCE, F2FS_IPU_SSR, @@ -679,10 +681,16 @@ enum { F2FS_IPU_ASYNC, F2FS_IPU_NOCACHE, F2FS_IPU_HONOR_OPU_WRITE, + F2FS_IPU_MAX, }; +static inline bool IS_F2FS_IPU_DISABLE(struct f2fs_sb_info *sbi) +{ + return SM_I(sbi)->ipu_policy == F2FS_IPU_DISABLE; +} + #define F2FS_IPU_POLICY(name) \ -static inline int IS_##name(struct f2fs_sb_info *sbi) \ +static inline bool IS_##name(struct f2fs_sb_info *sbi) \ { \ return SM_I(sbi)->ipu_policy & BIT(name); \ } diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 4ec2cbbc47eb..09696fc844ab 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1346,12 +1346,12 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) } if (test_opt(sbi, DISABLE_CHECKPOINT) && f2fs_lfs_mode(sbi)) { - f2fs_err(sbi, "LFS not compatible with checkpoint=disable"); + f2fs_err(sbi, "LFS is not compatible with checkpoint=disable"); return -EINVAL; } if (test_opt(sbi, ATGC) && f2fs_lfs_mode(sbi)) { - f2fs_err(sbi, "LFS not compatible with ATGC"); + f2fs_err(sbi, "LFS is not compatible with ATGC"); return -EINVAL; } @@ -2304,6 +2304,12 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) } } #endif + if (f2fs_lfs_mode(sbi) && !IS_F2FS_IPU_DISABLE(sbi)) { + err = -EINVAL; + f2fs_warn(sbi, "LFS is not compatible with IPU"); + goto restore_opts; + } + /* disallow enable atgc dynamically */ if (no_atgc == !!test_opt(sbi, ATGC)) { err = -EINVAL; @@ -4083,10 +4089,9 @@ static void f2fs_tuning_parameters(struct f2fs_sb_info *sbi) /* adjust parameters according to the volume size */ if (MAIN_SEGS(sbi) <= SMALL_VOLUME_SEGMENTS) { if (f2fs_block_unit_discard(sbi)) - SM_I(sbi)->dcc_info->discard_granularity = - MIN_DISCARD_GRANULARITY; - SM_I(sbi)->ipu_policy = BIT(F2FS_IPU_FORCE) | - BIT(F2FS_IPU_HONOR_OPU_WRITE); + SM_I(sbi)->dcc_info->discard_granularity = MIN_DISCARD_GRANULARITY; + if (!f2fs_lfs_mode(sbi)) + SM_I(sbi)->ipu_policy = BIT(F2FS_IPU_FORCE) | BIT(F2FS_IPU_HONOR_OPU_WRITE); } sbi->readdir_ra = true; diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 575a5536c0e7..3c3dae3ce84e 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -706,6 +706,15 @@ static ssize_t __sbi_store(struct f2fs_attr *a, return count; } + if (!strcmp(a->attr.name, "ipu_policy")) { + if (t >= BIT(F2FS_IPU_MAX)) + return -EINVAL; + if (t && f2fs_lfs_mode(sbi)) + return -EINVAL; + SM_I(sbi)->ipu_policy = (unsigned int)t; + return count; + } + *ui = (unsigned int)t; return count; From patchwork Mon Feb 6 14:43:09 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: 53327 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2277277wrn; Mon, 6 Feb 2023 06:53:32 -0800 (PST) X-Google-Smtp-Source: AK7set8RfK/qbxjdw2lZxcj04cNJFRNcnvBcHEHw9HTbjnTVztZmPL6fsb/clCyLwxctC6Wevj2h X-Received: by 2002:a17:906:8921:b0:89f:aa50:22e with SMTP id fr33-20020a170906892100b0089faa50022emr3650417ejc.64.1675695212695; Mon, 06 Feb 2023 06:53:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675695212; cv=pass; d=google.com; s=arc-20160816; b=rcNvcbpNp+BKdWNn3v09bgBYzqHwls6XbfiK2M4Ip0dWNn0EzzxwhOfWab1o8cB0rw U2L/fz45e8K4tP8BChMg6s4VPWYU9FPVJM0eR/Od4rlUtb6nkPrIO39Z/j7C6mJkWwhH /qe7DhfIdKYUHh07xTCHLs/DOX04Y0nCq4e4TUcqmzIB78kypbu4p+3jvTmtt7Rd2hTs g+8g97+Het8dGd1wB/uEuFHPZrNgmxLb2kywPavig0D9J1MN/PhbERRfogrkkxnNGZeh unWOBZtJ73rbhdlJsMLV/hUUVsNWWpeIfJALVm9ZDewUUJo7g5FECAjfEJPCv7kVef7F Y4Ag== 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=677DgX9T9ucQdvZBk24jzXG9QZcn+e1Vom4MGRh5xlA=; b=pr1YmdKIiyskCwYbmTR2HMGihYSxvlF5h1WP06PFDnAV+qYAhl7IwwcUdToKCf4R7H SWDEMsKds25CLjpM+b8/FUgaOjJfyzI1bhv68z/0lNj7Mt4WI59f6KFcEniVs74gGmgg e3sPGu6Ebynscd+9zZ56g1h4VxfhaKNFlzCXZGBzeizPS6h6PXGvfdKaiDS9xrWneQI+ 4rR9XPlPjLFJ8ZXkmU4ytlGXf6C4xpoUwPVU2ktvkFHLTWfKWJv/kwvVhMkcz8tAV70o etcdbwH32vagH/3JYmxLO3E+2AwkbJFjq0wW8KOd5gMgekLoQxtjKOQVVlmKUXMp5gKm rvSg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=bMW2C74v; 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 c25-20020a17090620d900b007a2d966eeccsi12693531ejc.686.2023.02.06.06.53.09; Mon, 06 Feb 2023 06:53:32 -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=bMW2C74v; 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 S231556AbjBFOnb (ORCPT + 99 others); Mon, 6 Feb 2023 09:43:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231527AbjBFOn2 (ORCPT ); Mon, 6 Feb 2023 09:43:28 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2094.outbound.protection.outlook.com [40.107.255.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF0B416AF2 for ; Mon, 6 Feb 2023 06:43:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nTghQcWySFgmiXEi2GInAoqiESTb8R1l8/wJ8TxNu2V1696+g2ettDOnSFkee63Ed/2kcRqDhjRN6ZMdV7wFoS34FdF6BRbcZBtL/dtpCu3XCZr7p3qiNX9S8UJ38NdpZqMpuTwO3Q1sSVaRtXrdiQ9HCVca2HppTJtCmHZfmufLikgowOeGVj6W3qZ+4rT5ZoV7keqeirlOCOiOwEOPg+jAV+khNnNG3LHy3rFEUMPua/+mR9OzanigHX3iSgEX2IV2llLyYEadETjMQyfwlAXSMmx4UHvfnNLpmJdKsLNJu47U21P/2mN6L8xLrPUZjTL/x+3SP1IF6JPURp6jow== 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=677DgX9T9ucQdvZBk24jzXG9QZcn+e1Vom4MGRh5xlA=; b=Y5bRXzWj3TE5ZhKrPAaNTYnEFV/kmQfNzpyMktTZOucxqesC+nDkmwtLzulRsqSqXVWcO9phJhNzB5hD6OVjfHNQ79xHdB/9j5rIlS/Ja80fiUhn+wNPRkTFo8NAFJWGairs4M7E1tfzqjxLLReVUpfJT2dAZXdLz6y+s3eeshMmnynLdlu3x5lj+j8xmbXaAvulX8RbjoJT9Va2uj+9KisGNNi24ApH5tm8fAxm7CP7LUVFMXjlMNtxnF3ZhGfMjHhRz04n0ttoJGZzPJcKDOBKKEzslC/GrhtUpKDLd10Sd16UeTQs9RauFj5pP+SfVAGgfNBjTt4hKytvNvr/Mw== 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=677DgX9T9ucQdvZBk24jzXG9QZcn+e1Vom4MGRh5xlA=; b=bMW2C74vtOVafYhpSOH9u057N0zPf6+7/4JNjbAXI5SYtnvIASvPHltUcVXUY57wJJWIB3PjL4N13ZVZnuyQ8Ay+8l8YFFViXEaDfzW5H9sEuZjn0fcsmBLWsAHYkcG1r9wmUzkZw7Iji3uu4UzANoSPyolw1PTH1qgESUAf7YNoNlkd91n/0BVnzssGW50XvzpS5Dhhqp0V4k+abC4gqVRrofKAbT2BqRIgpoH19ms5lq1xh4dyz9Ero+IAx+sVvtTqqmuMG4pAyYKKBKfphwJnHbDhN9bTByEgCmCa7vSk5A5ESnbBvauwTSgDAfbzToQfruDyR3gCtP4M7n2Q9g== 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 SEYPR06MB5765.apcprd06.prod.outlook.com (2603:1096:101:ba::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22; Mon, 6 Feb 2023 14:43:22 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572%5]) with mapi id 15.20.6086.011; Mon, 6 Feb 2023 14:43: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 v4 2/3] f2fs: add missing description for ipu_policy node Date: Mon, 6 Feb 2023 22:43:09 +0800 Message-Id: <20230206144310.2344-2-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230206144310.2344-1-frank.li@vivo.com> References: <20230206144310.2344-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR04CA0005.apcprd04.prod.outlook.com (2603:1096:4:197::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_|SEYPR06MB5765:EE_ X-MS-Office365-Filtering-Correlation-Id: c8f41012-c6cc-4651-6612-08db08507f19 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z3E76/MGJvXeTE4tfPj0wuBs2lldMIL4ivSCet+UcjEveUdxNR4Uae6veknlb2GFjtYf2osDVVaYYd4gA1jjvyvPHe/6NqPLKG81uIc4xACpHereLIotKxNDk4TIDJpW5bT3wouXxlJCOTo/iEgaaTV3RyLc/tJuL4RUsb6UnqYwWsE6XeVBFoLe4CRWjUEx7AxhssFJy+0rot67wo6jUcUf11hTQt1N51JCWCH95+KIMatOdN/m71yqHWoGg0M12iRWKnUSqOrI4WhA+dHbsYJKdUJNlUJxYw+5QWIqfPnD+TdpHx5BiyQ68Gz+C4mg4Zu+HtgtKS6mPHNafzP1oaysixv2CNtE5r/btijI+rhFkJk2VEBxTPE5Wc/h+TDAmqiuo/4FqydO8OJzyn2D6loshzg9cHAszULkGOTDni5vB6QWAG2g6WioddoTPikes21UnQd/gMCCwOj/nI8bgSr7wo/1dQm43ZlkZvPLoJyYJIOtGiS5Uj19i/1hi37qn8ctoujo17UU9avt+mAgD+W/Tb9QnHiAeCorQYuf/UBTA0C17zFBjkDYT0FR3RuPQjAiG/qz2lkUBW4pBaT8g9fALulev1Dy5wUD/rTOOv0i/dbG7Fuqr8wvNl8u7zO0m5arIOJEZelxBORWnAOw95/H9o+ZQFdYNlKj8slPGLqXKaiSMPUhqnHFpqOjPHswGNCPCk67TzQiEaOpRmngig== 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:(13230025)(4636009)(376002)(136003)(396003)(346002)(366004)(39860400002)(451199018)(38100700002)(8936002)(86362001)(107886003)(6666004)(36756003)(2616005)(38350700002)(19627235002)(6486002)(2906002)(478600001)(52116002)(66946007)(66476007)(316002)(6512007)(41300700001)(4326008)(83380400001)(186003)(5660300002)(26005)(6506007)(1076003)(66556008)(8676002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FJzwUF8imPOoSS96JnJ8q0lU69cHYWh//35/8u0mDqcroi3WN8NknJEMS3yEvlaIMTs0J33B7Xaypa8sAuAIOst9oZN78+ggTel2Xi2G31OpvUefy5W/wmARphsEIWqz56DDBhwMxHL7EG9vSedKz/u0SkdmgpRnedk69mM0oFSX7B0ze/5QYKQUipaNUJcPwU1ymlsrI1a8DqtwtHO/UGACO6EsFIqX3uS2yyHgfTYMoZG4fss6qQSzDzQE6A+lcUwQYGSiQD3MIHp5wBYKTfdWAP1C52Sc9wjMu2z58pEUddiAzEdkfu8meq4kohb0QOKELYisw0+CbFVk8fKszjOgd/Hetp9JIcdh+4ijbLulzHm049uqB1AhTFfoMs1333GDTZp8iaR6mGz4WfeRqCFYZX0sbQaQEzg283xWq+JEx9xUkcoKgNVkwTEIuMZ2s1dGadwIm2ZzBVutuy+U6tkWiPGTE4be2CGqP1znlcU9YJ+urt5Xo6m8GwIcKteORLxrJUVSV9ZwC7/5PHH1ogeJW62ViGu3Xq4tBcLjRiCA2cvSb5tkIk8XFbJnEq5LhS4mjk8W2zeBwem2z+ITFKeiIhHNHAHp7LBp4tR39LeQMqK3v43qPvy4bs0oHYCOsA0cFICEBNBgKL+ZE8ITGzhw44y23dnmJ2o4nDm1n+KQRkn7jakwh8KwnYotL/QyEz5Uids9MyYit/V8+brcYSsQcgxYUNJieDAdiapbLWQiP3ZFpJaXzzoAl+LugHe2d/XLepmGQtCBLXldFX6lQCm3PUbwGuozeKjlCxf8v2HpEYbpgFL9qjfDgKxouTfBbE6gJlEGP6WobFwpITxKXPWlkmqlw78Pe5fT5NcVPkOSaM7BXRSydbZju2jmfM8IH/nhD+G6mzj34qX3MSIbv0OXCWur8y1Cd/vqwWmnyMAn+6Im/72lz90QtUYTNEhCw/vEgIafpaHRKhdk7ez83wJDuTv0vF8jDaQG0tVUG9YhcCo90hQezrwyG+vWq3zpBJYWFyD1pvcNSxMv/LIj5i1PhCZ4s635S76BFawMS9PclpQzow/3xeOs3A9WfRGQXI1C4jRoXcs2LHpFlFgMU4wxOjcoC9c1OXJVeSkWzhITfkB1/7OzEhm19RammnnXAU+QZ4dOH9Ql8xbLIk0fpEAxcYyGyQaLT1g06rJTI1NZldxh+dXMtjZNF/2bIxCkmxo8S/sihVmF5pOTnlwJdk015G0kzOQfljuzNJg/56IhjeoP9/TAAbpjYV+iICJifH+139YwBBDhJgME1b4rHMtaK8NkQ1oVzYkptWKyMG8M990XjE59qHI1z4ULzW+93CMxC8DHLo4ZSesLvVeOx5eHOpAfOFqMv/jAgwYHChD21l1iA/PMHmm4856uMOfDUC798BbT/nSUU2Ghpcqqx1tqcIbD+fvIl1lf8ikRvUQ2XXocF9EUUE98OQX8BhlDn8TCzDSz2ALXTyDapcixFnAfVS3FYHNC0rQhbipdOveETK13K6OGZylpHkNlQK/tx5hfKwUp+fX25X0iB1Vm+Sg+cGMtvS8Bu7Bu8IpcKwGN/tPr4POvcdHO2M3APkAX X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8f41012-c6cc-4651-6612-08db08507f19 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2023 14:43:22.7708 (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: 4++sl523c4ohZCLxbBVrBZX9WiBw1b2LJ2kojei4rwPxz4dGG46mlxcP11tEKGdtxzi0I1vv83jMwcfFbFILVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5765 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?1757093783297261544?= X-GMAIL-MSGID: =?utf-8?q?1757093783297261544?= IPU policy can be disabled, let's add description for it and other policy. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu --- v4: -add Reviewed-by tag Documentation/ABI/testing/sysfs-fs-f2fs | 27 ++++++++++++++++--------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs index 0f17adc80488..94132745ecbe 100644 --- a/Documentation/ABI/testing/sysfs-fs-f2fs +++ b/Documentation/ABI/testing/sysfs-fs-f2fs @@ -49,16 +49,23 @@ Contact: "Jaegeuk Kim" Description: Controls the in-place-update policy. updates in f2fs. User can set: - ==== ================= - 0x01 F2FS_IPU_FORCE - 0x02 F2FS_IPU_SSR - 0x04 F2FS_IPU_UTIL - 0x08 F2FS_IPU_SSR_UTIL - 0x10 F2FS_IPU_FSYNC - 0x20 F2FS_IPU_ASYNC - 0x40 F2FS_IPU_NOCACHE - 0x80 F2FS_IPU_HONOR_OPU_WRITE - ==== ================= + ===== =============== =================================================== + value policy description + 0x00 DISABLE disable IPU(=default option in LFS mode) + 0x01 FORCE all the time + 0x02 SSR if SSR mode is activated + 0x04 UTIL if FS utilization is over threashold + 0x08 SSR_UTIL if SSR mode is activated and FS utilization is over + threashold + 0x10 FSYNC activated in fsync path only for high performance + flash storages. IPU will be triggered only if the + # of dirty pages over min_fsync_blocks. + (=default option) + 0x20 ASYNC do IPU given by asynchronous write requests + 0x40 NOCACHE disable IPU bio cache + 0x80 HONOR_OPU_WRITE use OPU write prior to IPU write if inode has + FI_OPU_WRITE flag + ===== =============== =================================================== Refer segment.h for details. From patchwork Mon Feb 6 14:43:10 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: 53329 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2279436wrn; Mon, 6 Feb 2023 06:58:26 -0800 (PST) X-Google-Smtp-Source: AK7set/eZs6UH0WobrCZMKNwGGOOAeHc7gS0rxCGQAfMyi24ihX6xszL9ZqrrCb4tsq1xMzDtRg8 X-Received: by 2002:a05:6a21:78a1:b0:be:39b0:42de with SMTP id bf33-20020a056a2178a100b000be39b042demr25379540pzc.20.1675695506540; Mon, 06 Feb 2023 06:58:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675695506; cv=pass; d=google.com; s=arc-20160816; b=lkZMGjGL2H1v7Gh/Z3UDFadJpDiRLJp8ld+WQegFcA8YEmHyrHfqLmJtSarX7foCrG k5iWP2EjfuHCmEb+hib/hjndBvOdaa3ECvHYEblKg0Cq+u2O4QiMiFHcAl3WCkyn/qZ1 xpz/jjkpOsKhQ9FjTbLPXxK06yfqsZ3jtV5lKpjmh6GtnueesAEwHsB2KpsQXLBVgsgs 8Wi+KsHushrGmzWy2h2Nk9ddI1wIhX+V9e55JK1UGFzV7u63zBedjYt0bgMSz2m/AmyG qsGDG6wqsi/u9yFrnGz7xWHiax3Ru8vd5omtMLepCW7aGit7o1cyNnTgxfDWEd6tVCYC TNIQ== 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=cKDgtqNwjIKAF7DrCZY/KgODMwK1Cbj9cUdQIRJFGww=; b=OPveBMswlCtIrlnwwBWAb9wco4/RAv/MjnH0qraRyQBO3cAusgQe+XkmGDEIoh6NLS Uku3hTN7xIN2z3oc6QhX3o+jrmMI4ADfPID5RcBmR1NBclRlpwW44ZGhR26pAgHVoewf F7tBfNaM510FyKfZenkFrskeQZxHiZfbTA3k4u9dOXi9lJlI1fT0wLyb9/pTI2Rv8soD DiJxcJJDA5oGg/FHk5X7E6W9927n52a4FpzRWyOkOLxzyD+jMRBN4y2kfXJVtu0nwY2h Z256RikTPpBf+QYxLe13NGBuYC4X1BceKgSuf4qs0f2JRZRHsDs46sugg6rFViON+Gpo Ndng== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b="F38r7/DP"; 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 e5-20020a63aa05000000b004769f0faab8si10740572pgf.740.2023.02.06.06.58.13; Mon, 06 Feb 2023 06:58:26 -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="F38r7/DP"; 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 S231587AbjBFOnk (ORCPT + 99 others); Mon, 6 Feb 2023 09:43:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231566AbjBFOng (ORCPT ); Mon, 6 Feb 2023 09:43:36 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2111.outbound.protection.outlook.com [40.107.255.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4A3525B83 for ; Mon, 6 Feb 2023 06:43:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ajUfrzlqCqTv1/lbKpXmtFL9EtRi6KlPtkC1f2JOo269ViL6EE2x3Ooa4PYvE3NVlO0+9XQ2XeZn/MPQeFeXbQ6d4/mTV1zUD0cQZDkt7Sr4b07WaTH3f9yUqwZgG3JF14/cHQE0Bew7KpPXOigW91mG4XRdYmQG/AA8LMw6TsS399tBi7n+eKDasLkV1/2nNsEbFGqEBelXhtnisulGBjPueVKcXizAFvyZYddlqPyE7PiVrwN8Cc7+6n5NUr6KPYCVTLib6aEadEqQZpGd5z/yLQQEx9/80Y1ST9IQdQS+t3zFa5hNaxgsmdUErGO0GUdNCqIhB6L9RIfJ73pnaQ== 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=cKDgtqNwjIKAF7DrCZY/KgODMwK1Cbj9cUdQIRJFGww=; b=gVoQ/96AelaQfTNCGqdsIhBS40z6jMbstZX9DJvJ49hpspg2AO4Wcu7/Om3wIc8fFnFj2FWVd5NB4jDwOPWFS17MX2BqIq63V0Lo/GTL/1YG45dVOZqIVe1iBudE6zk7SXVBjYP6jIo1WY2urtWJQTQqOvQ9akBwxEPQsbhXiK9nywgc8ZEGYX3bpTdZjMej7UHTk16VR/DS4MZ1ADWy7nu9rRpJYjH6PKIA22LHDY/mD8Z/d4lOgJAx0cUSxDDfVQc29LYq73+BEV5BApd3MEhjOFo90gpZI7JLSE5E/DqVw5mxpn7n+bdVVrX9LylLNxxPoD0JLODreuEzxJMNtw== 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=cKDgtqNwjIKAF7DrCZY/KgODMwK1Cbj9cUdQIRJFGww=; b=F38r7/DPXyGRZPZPdTRn1uR4cnGyvMWvm7mqiKhSK5BH4AkzruvhvNWGdogkLsDURrzuzerazXBPdH/ztfAhsM+uU2BRoP9r9Ef367LCLnmO1aN9dkK1CZOJVY5CqiZZbaQt6gs3wt7IVAI9NZbG8qlZeA2vft/OaujI3Gv/7sv+3/j+zn4B0ycTLJc+mmN0/0/CH5pDxrta147hKYlGLNLNsdZ3iweGp4Rc4fL1wOFN5oZ8XvoDUg3x6ZqunViYhNe5Dp3Ni9UAazub3/CGSrfurKReDVy3ICYkuCNhklFCepHfmkLOzxOtym9AltNZX64qz+NXQtM0eWcWIKe0DQ== 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 SEYPR06MB5765.apcprd06.prod.outlook.com (2603:1096:101:ba::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22; Mon, 6 Feb 2023 14:43:30 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572%5]) with mapi id 15.20.6086.011; Mon, 6 Feb 2023 14:43:30 +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 v4 3/3] f2fs: introduce ipu_mode sysfs node Date: Mon, 6 Feb 2023 22:43:10 +0800 Message-Id: <20230206144310.2344-3-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230206144310.2344-1-frank.li@vivo.com> References: <20230206144310.2344-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR04CA0005.apcprd04.prod.outlook.com (2603:1096:4:197::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_|SEYPR06MB5765:EE_ X-MS-Office365-Filtering-Correlation-Id: a9effe59-6867-44cb-5a02-08db08508388 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qsWSSTUpDSABPWgq60TqPL3u+cbgQpl+m+SG6XFHQvgaxuvCX6bmDexO9jaExuJ0taDqeCbePUtcJoRMcHWa+jeZt2bOLcxr7iTGkortHSGWR5kgHBe5d3dci9ukFo4GeLavIHK0hiXyt9Bqz4lkcvKsm47lxeQpnuaRjv3XgatX2yC6XrEg+ynQ9nIDrsnQ+T2i+S7E8d0Jt2JnDqaBDSkM5UW/olCac/rQ+/d868grxcOfFnVDJaGOHD1t8b5asX+RMowSHe9b+FS9wbx3kkweOdMLLdLNtqW1z/IMcjD7PT7SpA0/qt+XC32nZc4zsEGL1SN6NyeODYVYXq49/xRU5mnqliAClXRTeeRfVRJEdU/AWzKyq/BaaRahxhdvxaJzg3P8cFeaagr7ILAjFVIIiULN+AMmP0lQoEFMAtK8OOJSIxjMyFsvvfQ4pgWxqbCvnfYc7BtL9/RQzcfrZHB+ew/LrpVhAeYwb7LsJmlFQ2cYgagdiveekdPHAa7gPYzsrTXg6VrUxM2m8GBzqmch+TOmsnL7lhTVr+eLHAKGf9jn/fLavLHFqzzw5MpcWyKLxOeSv+rkkfk1jFdCuAA9udnTzCVpQamNipuRsqAm2YvW5I6gKCX0hlqtLyRGHT78+AsXpPsjYR3hrpCm/5ZYF/nPM1tY8/rtCwlDm0TIp5GBGFVqHbvVIHDrAFqklLLfuXH++oDZw31yYKuLPg== 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:(13230025)(4636009)(376002)(136003)(396003)(346002)(366004)(39860400002)(451199018)(38100700002)(8936002)(86362001)(107886003)(6666004)(36756003)(2616005)(38350700002)(19627235002)(6486002)(2906002)(478600001)(52116002)(66946007)(66476007)(316002)(6512007)(41300700001)(4326008)(83380400001)(186003)(5660300002)(26005)(6506007)(1076003)(66556008)(8676002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: g4iKy3MLQ3MOKvpatH9vbn0dCXWd3E6xxEN7coPJI0ya7qvhG+UGnLNL+UPcK/1Q1whLuPm2rOfvnTwMn3ovJMsdS1tKwVsjnn/ORFtAZe1gdmOvQXRSDu+SLBVvB/Hvqo0mWHois8mskSCQQQ4Eu5j86rQIaIeozsaZgA8Y60TQJAwUTH4YljPfz1N0FcVGY9FR0Cg1vgM2AKAwgRRXRN5CvoxRYKBjuU4YGc18Itx2dKMANs80ax5expGMvgklau46A9yOfQH4x4+JfxEBos99ukumjz6tGs1oI2FIeY+RrljaVkWSliXiMHxRTyQWTW3cUDKq8uCdpnvgicNi9zw01NM033rsFoSXN+RbZ3pub+fiBg0BZedm2+D5xGc9BV1Bg/aiL1zd6JWtTOCWOfueRJJIabA2ZSl7CVbIoCX6KoO4faGwABgmhNYuLizt7gxmBnPvJs8Exf1diX2dcDq97MwwKNUAk894S1yT5HzI8m4+4ZPnwY86zhxZtv3GBRltq0ZFebtH/+TDS8VSz1qa6Cjrcuj6FMSD5WhDBWxzxebU3JjmWJ20C9GyIZ9FS5Ztw32YVmV/xv3FACVqAm1PtqdoUq0HIG97aaBV58U8bDciCmnkBBP2i2v9Jvt2DgQh6RdnmaqqhNV39gpIQk9TiYMXktxpfRwj1+STyCT7zceyZKSLv0fVnxHBRnqCL4mHU7pyjg8Safj4LmhirMMsF8FPugJSA2QKetpL/jv6lEvHoOuPjJFp37D+2MPsG6bCJvQC99SwPFWw3BYeJyLTpvETdQUNFMxc7uKgldSkU97Rprm2gTMYzmeU23ugu996W1xGlanf5mQfM+IAFCEvLy+K/DzzZTryzqQ8d+i42fUuQv6GpDgfhpeMkUtUrtCFiaf/URDc1Alu5ipc/W+U7inlZoCOPGS8fNH/hkjafyc0YSs7Yv3guSrih5lV5CHgEcAepggtxiBAMLer0VMR/iQ+fMnrFK7evHnUZwWJZ/sjqCqSFzqmRSkAvzR6RrXDNvVjEuDYGsx4pMpmJyqY/+HjbP2kvB59W4rh2aAdKSXp/PGADxH869CmZHeOO4DxHLmtDETsmXhcdbZ3RtTvkyxWutV4QzHRUQH36cis/0zK5PTtNwX4ALN+AijiiDmGtz4BneCFmj+I7Jf+jt43stJGcTZAy/uAQXOqoCuUQGdentErsD6G9X40bZuJdlERu4Z/crnN+WQABpcqL+hkgONQjL8kEX5K1wackDYCcUXAykyilm3kxQJFG9XiEA3eCCgKG0YC0JGBT9W0VWV5rZrCuCISmmYGT/ht8pLNhwxg0QRF45SjvHKD6KtTSJWBar2uZNiQNLxYojEZFNIlijWCWYi15sAKjrbcmg5Yugw7mA2pyvj9KaqenhISRkUA2CmITMY+7xHfYMO/v+Fhv/E3Gzsd6y/CU9dB3ifuRXe7+efRtRLwmv/jWg+izJP1jI0v1JXzcP445diy2Zn6V05NAgED5cRp50ClAvgVE3s7h/jO91Uqs0Huko1qmvpB4P5IHCPYy3+eXNVzqE4xv5H6B205e7bPOh2z6lHqi7ojtQiQixUztKDt6FPi X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9effe59-6867-44cb-5a02-08db08508388 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2023 14:43:30.1464 (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: b/4BZNhisKfdyvWaD4YeVHXzKYhRmWwVFhJVt7bJGsKYK0xwVlTvooMfkc7PF71bloB5UTi2kZSFxvjgBVZPkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5765 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?1757094091458073715?= X-GMAIL-MSGID: =?utf-8?q?1757094091458073715?= Add a ipu_mode sysfs node to show the current ipu policy as a string for readability, like we do in commit a3951cd199a5 ("f2fs: introduce gc_mode sysfs node"). Since we use ipu_policy as a bitmap, and the bitmap API parameter is unsigned long type data, let's change ipu_policy to unsigned long type. Signed-off-by: Yangtao Li --- v4: -rebase, no code change Documentation/ABI/testing/sysfs-fs-f2fs | 6 ++++++ fs/f2fs/f2fs.h | 4 ++-- fs/f2fs/segment.h | 1 + fs/f2fs/sysfs.c | 28 ++++++++++++++++++++++++- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs index 94132745ecbe..b2d8c1e84073 100644 --- a/Documentation/ABI/testing/sysfs-fs-f2fs +++ b/Documentation/ABI/testing/sysfs-fs-f2fs @@ -729,3 +729,9 @@ What: /sys/fs/f2fs//last_age_weight Date: January 2023 Contact: "Ping Xiong" Description: When DATA SEPARATION is on, it controls the weight of last data block age. + +What: /sys/fs/f2fs//ipu_mode +Date: February 2023 +Contact: "Yangtao Li" +Description: Show the current ipu policy as a string. + This is a read-only entry. diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 44f2d76525bf..b699ed74f438 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1070,7 +1070,7 @@ struct f2fs_sm_info { struct list_head sit_entry_set; /* sit entry set list */ - unsigned int ipu_policy; /* in-place-update policy */ + unsigned long ipu_policy; /* in-place-update policy */ unsigned int min_ipu_util; /* in-place-update threshold */ unsigned int min_fsync_blocks; /* threshold for fsync */ unsigned int min_seq_blocks; /* threshold for sequential blocks */ @@ -1322,7 +1322,7 @@ enum { MAX_TIME, }; -/* Note that you need to keep synchronization with this gc_mode_names array */ +/* Modification on enum should be synchronized with gc_mode_names array */ enum { GC_NORMAL, GC_IDLE_CB, diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 8ee5e5db9287..92c8be00d396 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -672,6 +672,7 @@ static inline int utilization(struct f2fs_sb_info *sbi) #define F2FS_IPU_DISABLE 0 +/* Modification on enum should be synchronized with ipu_mode_names array */ enum { F2FS_IPU_FORCE, F2FS_IPU_SSR, diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 3c3dae3ce84e..4a2d895cd52c 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -51,6 +51,17 @@ static const char *gc_mode_names[MAX_GC_MODE] = { "GC_URGENT_MID" }; +static const char *ipu_mode_names[F2FS_IPU_MAX] = { + "FORCE", + "SSR", + "UTIL", + "SSR_UTIL", + "FSYNC", + "ASYNC", + "NOCACHE", + "HONOR_OPU_WRITE", +}; + struct f2fs_attr { struct attribute attr; ssize_t (*show)(struct f2fs_attr *a, struct f2fs_sb_info *sbi, char *buf); @@ -149,6 +160,19 @@ static ssize_t gc_mode_show(struct f2fs_attr *a, return sysfs_emit(buf, "%s\n", gc_mode_names[sbi->gc_mode]); } +static ssize_t ipu_mode_show(struct f2fs_attr *a, + struct f2fs_sb_info *sbi, char *buf) +{ + int len = 0, i = 0; + + if (SM_I(sbi)->ipu_policy == F2FS_IPU_DISABLE) + return sysfs_emit(buf, "DISABLE\n"); + + for_each_set_bit(i, &SM_I(sbi)->ipu_policy, F2FS_IPU_MAX) + len += scnprintf(buf + len, PAGE_SIZE - len, "%s\n", ipu_mode_names[i]); + return len; +} + static ssize_t features_show(struct f2fs_attr *a, struct f2fs_sb_info *sbi, char *buf) { @@ -711,7 +735,7 @@ static ssize_t __sbi_store(struct f2fs_attr *a, return -EINVAL; if (t && f2fs_lfs_mode(sbi)) return -EINVAL; - SM_I(sbi)->ipu_policy = (unsigned int)t; + SM_I(sbi)->ipu_policy = t; return count; } @@ -907,6 +931,7 @@ F2FS_GENERAL_RO_ATTR(mounted_time_sec); F2FS_GENERAL_RO_ATTR(main_blkaddr); F2FS_GENERAL_RO_ATTR(pending_discard); F2FS_GENERAL_RO_ATTR(gc_mode); +F2FS_GENERAL_RO_ATTR(ipu_mode); #ifdef CONFIG_F2FS_STAT_FS F2FS_STAT_ATTR(STAT_INFO, f2fs_stat_info, cp_foreground_calls, cp_count); F2FS_STAT_ATTR(STAT_INFO, f2fs_stat_info, cp_background_calls, bg_cp_count); @@ -997,6 +1022,7 @@ static struct attribute *f2fs_attrs[] = { ATTR_LIST(max_ordered_discard), ATTR_LIST(pending_discard), ATTR_LIST(gc_mode), + ATTR_LIST(ipu_mode), ATTR_LIST(ipu_policy), ATTR_LIST(min_ipu_util), ATTR_LIST(min_fsync_blocks),