From patchwork Thu Feb 2 08:48:13 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: 51802 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp120962wrn; Thu, 2 Feb 2023 00:55:39 -0800 (PST) X-Google-Smtp-Source: AK7set/jwntflodk59zvIJ84nvLm63bsxDnJ/V6CnFTLoELArTBiILl/P6HYxeWGfvfwuKkq1xL4 X-Received: by 2002:a17:90a:1a11:b0:22b:b76b:5043 with SMTP id 17-20020a17090a1a1100b0022bb76b5043mr5859287pjk.9.1675328138418; Thu, 02 Feb 2023 00:55:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675328138; cv=pass; d=google.com; s=arc-20160816; b=GYjWHjcXz3wrdvt5nctD5gTxOh0vZMlvsF4p2DPbuvP4nJBHq492ADAnATYB1kZGgX MPpMdmkGvyLvRS+plU3C5Ha2HoKUxe8UCHkYI48QwrVK2HHrL5fpwT3R86Y6aQVeo3vv 3Sm72E8qMu3FtWQt2jT1WPNm0IBjBxswPS10Zme+WRWE6Hsl3qHYjY6of86xwavO0GXk M0QUJ6UB8bOMUjmT00Wx0UcvNz2mfdgVB7du0M94erZ99bO5KMId3oTHcNWez2M26AOH BU4ztxDtaAat54hBtjVDjZn0NAzCSdKPfPq8I+IF8Odg7KzQxSer+kacOeBZd+vONmfn uweQ== 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=wMsmnbmNXYRUEU5YT/7odIoE+ovaE20i3kq0sGhW1Ks=; b=Id9URoUwkaSSOp7V3//CnroGlMthlNkP/UU2Npnq9yGKciEyNZupU5KNOgGlI3vJ9H eH0Vkr8lQIrmHSV6qywBQ6z6rmFop3l+CSZxYVSgRX0HdeKZhSS1Xl823c1AzLByJUqm JUHdVkO2Ap6/3q+CGAwHujwud9lNvCYNpg4XvUmp3dITPWxSH0t76Z09w2+RJTr243zN X0vzgPewdaN/ORJnfu8n4lgLDkLgUc/vnk450LRl6Dp8LVtQn35tF+U7znMOlVKD72IE 2RXyUJGs+7vmxvuj8UwrN0KwPmlIGpj8u/6iaECdr9xftlAMbn1CHWGdMOaLrvDkOJac r3Tw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=fUbgVoRQ; 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 mu7-20020a17090b388700b0022960cd9da1si5169073pjb.63.2023.02.02.00.55.25; Thu, 02 Feb 2023 00:55:38 -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=fUbgVoRQ; 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 S231903AbjBBIsu (ORCPT + 99 others); Thu, 2 Feb 2023 03:48:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231737AbjBBIsi (ORCPT ); Thu, 2 Feb 2023 03:48:38 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2092.outbound.protection.outlook.com [40.107.255.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 065C845220 for ; Thu, 2 Feb 2023 00:48:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lTq2GRRHt6FKJivm8ojbN/I4KT4gqQYHuTdcKddMqCui8IoRFw4QpTolqCLtKcOG9BTKGRMPAjHie9jrnJPHTNxK35FNMh/YXLISc5g4iv7350a9i7n9ON10nT2uBleSGweh4kfbVpow/HNP0Yl1HRnBmwnRK4XsGMp6Jdc9tcvjb7ijL327kzUU6L8qiwU0GrigcQ6sS/M0sgqcXPHr3BYkyL5hjZpxBuDFTITg+6DcEC5RNnhRMLt3SFugorxJtuXP5swiQU+Z6Q6j4536YvGplAEcdEJAbwIMUC2rt5nVxGtGBru8n1Sw/DU3QZ20HYEpiddQyKkGn1abwOT4Og== 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=wMsmnbmNXYRUEU5YT/7odIoE+ovaE20i3kq0sGhW1Ks=; b=LXB8Gt0LBCfWp1bHJjApcJEpNcT2W+Js2AQzxeCBqwkYQNZYEaxPdqdCuCpmqBLfgUV4MIuXqzwhWh67zpRaWLWx8RfJs0SUekvLAhMfwDy+ZBFC0wdPc0RS11BPu1fDDHEC/QHbRh27A90yYSZpYefSa/Fh4M4SpGXDtpEwdpL8cCze9rDdi80ptQGI56NUXGlH8nCf8Jzg9NZoxQ3uIsn1iCnH8vo3M67qGFuDYZVtGN1tWakTzNJWVQq6RpdEzb8guq8ZKc/zjFCWMnoIiWEoUrccsqbaLgJ9mNMLT3q228HsxkVLYC4GLt490mb+bnGzYovr9gY3zs1BS7yFiQ== 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=wMsmnbmNXYRUEU5YT/7odIoE+ovaE20i3kq0sGhW1Ks=; b=fUbgVoRQAPyW/PI4I+Z4bGopNLs28xgP+dgc9ctFjcudP2k23P09j3f2QBIGWJ1VY6ZV8kWuCkTirYUpYEq9M7suZ6Q3K/t3TFO0NTv6QRrvlCxcTAEHW+vYewEh5HGvBbHUIYYQl2/wlQguaxpPlRjJhXZ0rnt6a4N+bvziCpNZ33BzDslVWD5pGzZ+5ytKAvYSq0Py/8Rkfu7Ha+v7akdUVXrZtgXFO/Y42yoJv6eGaZXfro+wAYm3zz2cBz0DqFbNwwP+EHX6nBk2tTY9P28OLTikkRzbIgtdYg0698EK6NzfoIQFWqm1ntyjiLqG3d0YGQxSTvngqF5u8b4OZA== 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 KL1PR0601MB4514.apcprd06.prod.outlook.com (2603:1096:820:72::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22; Thu, 2 Feb 2023 08:48:29 +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.6064.022; Thu, 2 Feb 2023 08:48:29 +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 v3 1/3] f2fs: fix to set ipu policy Date: Thu, 2 Feb 2023 16:48:13 +0800 Message-Id: <20230202084815.70791-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|KL1PR0601MB4514:EE_ X-MS-Office365-Filtering-Correlation-Id: 412cf13c-a36f-4882-6127-08db04fa4194 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /3T1XnvRo/RiKTXFf5akE3u7AoQvbzg/rIzgV4sp9i15Dj2mwS8sc5eR+fr0GEqePTqMhVfjO15wYxzuYLnJyGP625Juu3p3fTsJjOeH3Ld1KHCrMDFvhi5bKC+ku2/v+o5qiPzHM/Nc9Y8abU0Ljp8RDjpHHHqtybQt4HNFaTt4exQUylIfJHcu21GpmJDSHPKslX/fl2nDbl8NOs3dYILdApliI5cc2buP2Z2Wbwr4CLFY3VrvbLWR1/RNQVEirnXVxB+fVKuOlfpnpYGn7rJY9KmJnwoYait/4q3JrvJsZDnHccS5y+UM6j+sShJuOUqdxM05GknHoAmlcJpHBpqbBkNM8Q14xFc/vUyrSdf81QGUQfE1RKx8IvvtR+mCeCt3rW8dU3q3aNcB0sGCjwSTSYNqShhJ98WSZMlZntXO495+fAX4uCX+3q560pc8BxlO7e5zYE1URTwr9oTvLE2QHwQAiZiJyAqIRGCgmQCE5N4ATOndBiHdNDnS5UneaMYaiy52ESaga0zdnvXjyRuWoSikaqr99RT0lj3fCwq1ipXdJPf8n17eIYySaPDRgDxXgu1k0T2pWQZ386xh1YUKcoZntH+bQc+4XZu5zK3vEkL3icNSOCycFz0NXAp9oZD4JK/dsA5eXjUXXrQNbdYT6maGBU7OPPdmHcXECgkpyfmQjkV68ZBqi3IDpr0ju5/pVassF+Vaubn+iFOgLy7uSzXfcdNY22nlI49eFvw= 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)(396003)(346002)(39860400002)(136003)(366004)(451199018)(6512007)(1076003)(478600001)(8936002)(186003)(2906002)(107886003)(26005)(6666004)(52116002)(6506007)(2616005)(6486002)(86362001)(8676002)(5660300002)(83380400001)(4326008)(41300700001)(38350700002)(38100700002)(316002)(66556008)(66946007)(66476007)(36756003)(309714004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BWscXEltD3M9kLIRp3NAg2+tFE2p0KvkNwzTPWGhFr4Z1vxVXAkU0X0tZ4rAoSOh2bz8wdLRp9sFQT9yNmgmHZSGGkgGgOBU0/mNd9kU055H4A2D4XQECFB4KASE9VlYb9V/QQkmwP0ECjM4QgXAwLpWk1L5dxqlXsLuwN+Fz/+Tw0eN3ckfqNfmD4mBN2Dck1J5vk84G//q9zLhA6qYU+IxdhCQ9XcvPnjGueGwlZshl5xEYa+gH1F/38F6/ogtxsfLiPx4QP4Y3JwHrkrIby/paXDy6NkMcaRy1cXpHCHq2+MSNbhHHKJKhzxv4N3SH3yJqwybt0CFwbbGJIIWwhVBCgXzet58BJxPxSGmxSnMjPyRyA8S8LPUiCqXnFuO4fvOjyU7FnxnanobuVqO6nfx/zPIHig73BJnYqJGk4WkfKnZHJJdUAg1zsU3wWUcgRKvkAnfDZoV56oUeCBhDCpTncIvkmDdnPEkzUSaEx6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5AJL7ka6+QeApotSaBpuvo X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 412cf13c-a36f-4882-6127-08db04fa4194 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 08:48:29.3197 (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: lvuXBKEKSb8RatGj+o3ykjlUz+Kv2blpEy6PptcENTyMHiVmGfSWl5CsmfoUab+Q099ZgkmneKS8M1+Awd7I2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB4514 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?1756708878212959185?= X-GMAIL-MSGID: =?utf-8?q?1756708878212959185?= 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 --- v3: -add check in __sbi_store() -introduce IS_F2FS_IPU_DISABLE() -convert to f2fs_lfs_mode() fs/f2fs/segment.h | 10 +++++++++- fs/f2fs/super.c | 13 +++++++++---- fs/f2fs/sysfs.c | 9 +++++++++ 3 files changed, 27 insertions(+), 5 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 fddff5deaed2..f06af2af215f 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2302,6 +2302,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 not compatible with IPU"); + goto restore_opts; + } + /* disallow enable atgc dynamically */ if (no_atgc == !!test_opt(sbi, ATGC)) { err = -EINVAL; @@ -4081,10 +4087,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 3c6425f9ed0a..e1f1ebfa59d6 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -697,6 +697,15 @@ static ssize_t __sbi_store(struct f2fs_attr *a, return count; } + if (!strcmp(a->attr.name, "ipu_policy")) { + if (f2fs_lfs_mode(sbi)) + return -EINVAL; + if (t >= BIT(F2FS_IPU_MAX)) + return -EINVAL; + SM_I(sbi)->ipu_policy = (unsigned int)t; + return count; + } + *ui = (unsigned int)t; return count; From patchwork Thu Feb 2 08:48:14 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: 51804 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp121834wrn; Thu, 2 Feb 2023 00:58:10 -0800 (PST) X-Google-Smtp-Source: AK7set/XF+EMVp6kx+2F1zVAn1MJlm0EcfcTwkHE9kqNSe6eAyov/R3B81qTFL/WUBakIioZOwPw X-Received: by 2002:a05:6402:1d4d:b0:4a3:43c1:8433 with SMTP id dz13-20020a0564021d4d00b004a343c18433mr1766477edb.7.1675328290684; Thu, 02 Feb 2023 00:58:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675328290; cv=pass; d=google.com; s=arc-20160816; b=SHJppFmn19VfLOawFdEZtw7iY1PrUzSVrxXHVXykzjR59iTMZKsMT1z2PedA0oEoHj GeQSKcfODhs3J7/DkD1YJGifm84n2sFmAo94G4DfNglkd1THf3/BPPpKNwNo/DLSdyJ5 d1MLq7GpCjZ5FkDRKAi/104gVsZ5iaYTlEyUNJgNEsOs1Y2Xv2FIu9uxUokP7KJKFev9 wHQr+U9C8g5k723Ggi3wFV5khaDBKCLW5PbnJnAiT0lcwgLzZ2+4VZA5Sxj/SKzaLcjZ BbI9+DS2nkuQ/u71rKBNgSlt8D/VCNDhzzsJbIQvKHJg/NseQmfY+iW5SCf1aQg2hSHS lLhw== 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=5LC7c2CJAzq6tVlXVGuvpQutyrfREL0OZTedO1ndBto=; b=JodkQvpXdkYnWs06ZSxNM3ph6xPe/D+4a/7FO0nzE1FrFQfb6PB+tmcO6Z3ocGnWts N2FkMl+Wcq37QTzjdLe+QtUe8gsTEEO3Io/JwayV6NpZXdfzcMl62BlSO1nMTmNx4jBM O8IIZuxg7z2vmPx5wh9JSTBLJjv6KdAYgy6woh+BdGkeOuS9l/W+sM7Xk1hFOVPULcXb 3e++/35GpveyW5T39WGAOWAmL5U0g84sMO7xQYQ/Mz++ea+TxMY+hb3IFVQ1UvOk7+ly uYMRPq8Xq3pJcqhHgF18IMhxjQU/CLl+bO5qvo5eMUqZRjy6sFc7b+/ppo+JSYmVsHYm iH9A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=BEIkwtKP; 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 fg15-20020a056402548f00b0046c8d52c79asi22757295edb.357.2023.02.02.00.57.19; Thu, 02 Feb 2023 00:58:10 -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=BEIkwtKP; 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 S231862AbjBBIso (ORCPT + 99 others); Thu, 2 Feb 2023 03:48:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231653AbjBBIsh (ORCPT ); Thu, 2 Feb 2023 03:48:37 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2092.outbound.protection.outlook.com [40.107.255.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71CC26E41A for ; Thu, 2 Feb 2023 00:48:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TADMVfXAJ8I870nxZtu2+X3RGR5IvoAO/MCjlUOcHxm/6YffgckqU5zS7uAIo68odT/3a/hJVSJeYyXP8376EDzgOTKz485zOauqrrjWCzXdKwvFCmEGR0Zldiyb/OR5j/WzOaBbEpWiPkrtVBWq7Hsx98N2RWG1Yyvp+i0N7SBqjJ+ghAzlh/YM3fEDm8MDmfkT5IB1nG+zaaBwk5T6YnwPLCPBLrVlbUepPqqajEC+79/HgpElEgJauFAbqpW9RJFG/7ISV+UlODyKB0skIy/shE22Bz9RlSmG1KTXJhS4JUPMdFuUuO+vuo+uiKF6oOoQ8sHxBYOfTW6D5kkMiA== 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=5LC7c2CJAzq6tVlXVGuvpQutyrfREL0OZTedO1ndBto=; b=ZmF0xrbOgPKNUZ08GcVFtX6cFBYpk5gUGn6SSKEjNWFK3yOGeEuYnyYVRt4abvLStuEZEACLqPIKf4dmYzx5Me1KW8ZuVX2s9dNlBjhmil+PcGBz4YqjYgY9nhABekphLvDnj7sqtDVNU+k8ROB+2SotYFPiAzTTyGt5ZpVeCj5JBFvskXp1IkPxI2p9wGjC4AHh0wU830YIt59hdNDnM+Pkchkhkib5GRfPjH+Z/jqK5LaGqiP17gtE71D3oqsVAJPBhnxgLQY8RlUy1qazRKK//1SgRr58A/eORXHUWXC/mpilpzJ5doZtRZH/Y47R2hlDPSzhU48oXz0L3DaCzA== 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=5LC7c2CJAzq6tVlXVGuvpQutyrfREL0OZTedO1ndBto=; b=BEIkwtKPi2alK2jUsoBACU2uoODscHYD9JaR3ZFqTLm2LHMFCD+9YZbZJ25dbbTAVVseTOcJeo9stXDU4+32PE0H8ClYAHwWmu2ylS6IAt34CfOJl5erOIpv+zCrEFN3MREwFvnN26gZNeXu1siUFYMULdqyvbh7dOWUZuhpCV8Cm58/EXcsx+CZIW2XCmw6tL+w6lB/o+yE4MacOrcVrAiGHl+WNb3skSpdPIt4VNzGU0am5mtoCkhaOp2LYXb28ag6dMy5zNPj+c9vd6MCMOgnQxrIDZ9mF0Crq5X6/A4o2VdhPg/ofuBqnFelwoYojvTY3Q19Nt/BnEYKdiE4uA== 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 KL1PR0601MB4514.apcprd06.prod.outlook.com (2603:1096:820:72::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22; Thu, 2 Feb 2023 08:48:31 +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.6064.022; Thu, 2 Feb 2023 08:48:31 +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 v3 2/3] f2fs: add missing description for ipu_policy node Date: Thu, 2 Feb 2023 16:48:14 +0800 Message-Id: <20230202084815.70791-2-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230202084815.70791-1-frank.li@vivo.com> References: <20230202084815.70791-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|KL1PR0601MB4514:EE_ X-MS-Office365-Filtering-Correlation-Id: a2bc3ae4-314a-4eed-630c-08db04fa42b2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iMtuVnziWyaLDZXm+nGI0C8Z/cm2GW2PKCx+kYGSJxYuvTg7mrZePDli925seF9zg8Wue/0BBIUCPPcSs3cLICllL1pAn3M1qtgpmFyOZwpXjt7Z7jW4CPeXcpa/SjgctRs9TkzXc+KqFPcwHOvdL/fKTODX3LYErTXQ4QAtCGtYkHzhmYvlrX82bn8Ryqth3aXhv7+RCpIQAm9cYuQkv39fyrueRSDJij0RNHWZ3gtsBrTrjiR9rGJ8RtpwO8xAExg6fWQ73rNAZSW2TV8sn/9xrMmR63TGtMdc2ORr4YuCn8OkSEeAFT1qxj0tXHPcNFEnd/fhogC9IeSFEu1i9km73iEBoy9307LcYvKLQk0tlt78DzSiCjoKVYDUIgfoCiznCGPAY6NbYdb6a1kM9DS/n0QkRofAREPbrKP/uP6tOYam39Y3vAB6Fyyw7UY22WOcIMVgvupjPP8QoJdtpUK/cRsTHeg9P6xhvJpPbRTZNWZtZ39VsfyZPyK9RtLYJSQFpZczju4+iPXLq7ADVnqzzsEzAadhEA1jent8SScAimgu//CSRIkLhW4aWB9ktGJeiM4QN/gNqIQZ/c2qKB8wud+cpjNJCgmeRAnjvX/5emdNxxD25erGa8lVuBxypC7Xq/K+/RzExXpA9At6pFbrqqUm0lAcs/QOv0wV/30xWCdhPmDaGxABCQ32Hkvg3IYqnjS8IBSJQGnEDT2L4g== 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)(396003)(346002)(39860400002)(136003)(366004)(451199018)(6512007)(1076003)(478600001)(8936002)(186003)(2906002)(107886003)(26005)(6666004)(52116002)(6506007)(2616005)(6486002)(86362001)(8676002)(5660300002)(83380400001)(4326008)(41300700001)(38350700002)(38100700002)(316002)(19627235002)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LhHIfqSGL+D8pimxXzN04lajRLErzoW420XUWeYPlv0hJ/X+RhqUHqBwgVjluqgZjHZAK5g9tZ9NVfbSf08qiiR6dQ7AHr6BhnJDJFLg8dfCt4WtcF6TGioF1RgDdYJjy+lQoA17qXKbGugEQM8LwS0lGEFGLmIMTlL45mM8y/+WJOotYwqtZCfWQSrdvSruLTLTsVOhzva0aYd4K5PANY0UxWzOBJKDJPKXVtGyB001SdbsSFhaWVNqgTnsVUECw+SALlakdS/Dur6X4VZE34njfbi8bWnwwXvWRjOVyOeewf7z9L+lnH0iSh5ZRrCZdW4qaeBejjrSPMWD4QngxG5aBkuhRh4SbR34P8whUySBdxGsvQHFYQKNUbH09mvhNPSShXQIStKB6zsirjRDNtT6sahJXh3yKLPw+IzFDoQG8m4onGaOLwMV+XFGbNR80VSCIqLKTRLVKm7S/69YNal3Tm8hgqY2BfV0Kfc/tsL7eGKUyEpNlchcV9R7qKDGtdiu1RKhK33rcaTNiaT6+G7/6zxSPm56qpQXzsdTFR3001yfrn5gEZErGtB5ze0dG0/4Meew8uvPAyVGehxlee3YtNfvd1X1Pu7Kk1wej3H0R X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a2bc3ae4-314a-4eed-630c-08db04fa42b2 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 08:48:31.1785 (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: PcJNfPctUHhfyQnPLovz0Q2ip47wl+RHNwZ70NmXEOKs4aIeBbu7Ys+XFeT3l8q6PY6moygtb4z9hqzjyf5HjA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB4514 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?1756709037705250612?= X-GMAIL-MSGID: =?utf-8?q?1756709037705250612?= IPU policy can be disabled, let's add description for it and other policy. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu --- 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 75420c242cc4..8a71397fa060 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 Thu Feb 2 08:48:15 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: 51803 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp121045wrn; Thu, 2 Feb 2023 00:55:53 -0800 (PST) X-Google-Smtp-Source: AK7set/nxkKkvwbu02oLvRlkRX+nm7Clw0wX6TqHr/Lik+aLqTjVg5OlXtcoc1z0sA0Bn4gk478I X-Received: by 2002:a05:6402:1504:b0:499:70a8:f91a with SMTP id f4-20020a056402150400b0049970a8f91amr5280754edw.19.1675328153354; Thu, 02 Feb 2023 00:55:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675328153; cv=pass; d=google.com; s=arc-20160816; b=cpqdJM33XE+O+u7gb3w9GU4rMALOzTTo69fTtxtDZdFkBSFvvxciVkjqHSeJhnsy35 u+lmKdC4T6brKUwTvRS1ddJbK2oVz08wTCmy28UI4vg6zRwd6dejr6zJCflXMkMmDXJv G0/+DPePGw5YU2+Sf5nTh0jffVBFCLlzuGk7d7XTn+CdrZt5fQ1VVzlVFM/sRs+dS9Hz 2OtXe775IAx8RY4vEd2ZnoJrCXdRb/UUCUoR9vz6r2DrbpBu4HtC5jZLWBrSxWbVWT1D QZOc9nzQnAqwq5vJJ6xtDbZiAHtlJ/ekjJQTqJuIQqoN//EpKvJOnEQezSrx25Wp660n HjXA== 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=abLHHZnqlBGrE6ZQZAOui0eS8X7sxC4va+1/7fk9Eug=; b=BkovYMzvGAXJY2W0uqpm78JGlCeN4DFkmxCFrHWVYomB12HOWJi0PEfT41Oi9/Xvcm Nj+d40zc7B1vMf9vR5K60G4nZRKHXsZpyCVMr8zCwIwYuQCmJOuP/EdSfltLaiQg45hZ E0sUJiW0iAdQHqYHTImNAOzIUG2efZvFUJh/3ccgNbLY2KT6d63BBy9TmkdawsrqhGd6 2Pkud725TbkyMRfbxr/BlBoBkt/D6p03Z5eFW4zKzKnEf85QBoElsU9jDeX77zHFOnj7 EYun0QqruUXgsE2JfN8gwVsna6ltnvBDZdlJbHrq2HZoXz4sviww0wTRsiEmbriaGTkP rvDQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=J+97mL1e; 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 d24-20020a50fe98000000b004a26b74ffe7si7379598edt.242.2023.02.02.00.55.28; Thu, 02 Feb 2023 00:55:53 -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=J+97mL1e; 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 S232075AbjBBIs7 (ORCPT + 99 others); Thu, 2 Feb 2023 03:48:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231751AbjBBIsj (ORCPT ); Thu, 2 Feb 2023 03:48:39 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2092.outbound.protection.outlook.com [40.107.255.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C8826DB3C for ; Thu, 2 Feb 2023 00:48:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OroH9k1OT77WW6Zumz1GMKapm2IE+YaNHvWVHTQBhpLgTLrvQdP/fgDIk0UqFDSBzW3xQis8WPHOJwEHFaZfTgM/W0YLvyZhWSzq5oFvca4BUDgzy2s4kGdMG7I0GkKHovnXJQ9NbCOsOHtmQo0KxCKdkAgjtakIubIWsV95/dg62bG30vpMJVrrsIp4IQuSfC1SRKT1ZEfKpYrwuUun3dgyYsTrJd/rqCt26zSM60+FQNHBwMicHthXMjgJT/Kdf2QmN0tHmJXES0rkUFgdU5mIPTB/rEmebp0u9AnU6oTNCxB91qoAfCouJC6zbB5mpP1BxPy4naEmERXPdw7JrQ== 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=abLHHZnqlBGrE6ZQZAOui0eS8X7sxC4va+1/7fk9Eug=; b=VORg3+fl/u12xBsc10pzRfe/zB6uTeGs8jvD5UBb9roRzvzirLH8YQJxgmg0xusu4pFFdB9Zh4gZ6gjemOSqe7oy/2s5+iSj4ufkWDlnclwnK8CCT/NqHVx8ddwA9o1Z/78UjeViP9urEU9ddQ1huQ9x0JeqLZ0+3+n+xA8PKn3Je982bTn79KXkWHgbvQdjAac40o7qnbJgoC6GAAOPGTy5TnzklYTOurKjZYdT+OCZDp6ljkqOy6D7nz+srinCw3VbVhtGCcyjn8NLZAEHLtXl5bzvcHKfGF5iTkAdqXYagtIZ6WNLmu9Isywn973+nvgQdVN0euKHFY0S8OcXHQ== 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=abLHHZnqlBGrE6ZQZAOui0eS8X7sxC4va+1/7fk9Eug=; b=J+97mL1ePNQ5f9XieEmlD+xuJqBgTgaQDulGE04DvLTuR2jJXw1UveBV3l8R9EfsUpJp1nJkgjWo237moiDdgba5xpjUJpqVWS7EgLk985bLPR6w7Lk5ujaZyO+ixbRqaeAEYTN52fQsTKdt2YdYftsCfFCzu29Tn7vM9euPoM5S2FHVbB3Zq+dkaRJoqk5hpi0oeRHU2VywPQ6m0gFQWlpG9zK55tjUHI1yTwT/5zXRdivfE6cBZA+ti/UyuJJvXk43FhxJSysyfa7/rjAksOk9AfqHFnXxg5Xf+DD5zYnsFFnadvemd1lf4dCSNIE+xrNpNvLL0L1ZCJW8ME59Zg== 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 KL1PR0601MB4514.apcprd06.prod.outlook.com (2603:1096:820:72::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22; Thu, 2 Feb 2023 08:48:32 +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.6064.022; Thu, 2 Feb 2023 08:48:32 +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 v3 3/3] f2fs: introduce ipu_mode sysfs node Date: Thu, 2 Feb 2023 16:48:15 +0800 Message-Id: <20230202084815.70791-3-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230202084815.70791-1-frank.li@vivo.com> References: <20230202084815.70791-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|KL1PR0601MB4514:EE_ X-MS-Office365-Filtering-Correlation-Id: ea3e8357-23d9-4e21-a0b5-08db04fa43b6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KPwc9QVnCJgOmmyXW0gLMvoZOLCuQDSxdKzufQ5p1SI5myRQlM2uy9NZ9BOkpfXbbQK48J9iME67jxgn81GXD/Fmy3WiZ5LsQo9tcHUfsWUV+F9yUna/uJlEQB0R3WyCGGX+VhKxlhtjwMFwgAEv0WemvcC802OPmjAySQq6po65Veox4FFMqrq7AqjWXLVHOOgKw3Gj8DpkTugvpiRY/GffhCOh3U+Q0JupzehJiueirIiktfSuwNCAfwuD80J4tYB0AU64eEKiOrDIiEvrth0+PILv/7j+s3I7RNZUM3DHIn88sYDAUYZfG689DjuKK3PEXmfwPls6n9tQXTOqf9OJS5JUZCt6WFW9zYqpSbBj238cLGWqi7TK9dSEyU8dcU5wDGZGePowSvNED9YcVVvOE2Il0v8DKSKqVUcEfWKlvfpyp0uo+DjH5E9RDH9CpDi6MkVEEhQDzi/B1nB/UFJdSoQyVwjkWvrwBpbQfG82sInBtRei5WE0vKbNNy6og2kQDS12XxhMEFDu5CgLI3UIK/iE8XHQgXl8mDN6pKmjKq0MUKJIXykQFJ8pgKIwMisWb2P0aPN+Qjj/IGW5jb5tlyBKeGp+4lyppH22tIw86OiMrgTWKT+SiDbea9McqM67fGGd5D0Llpu3JKmJqR8ufLhIb4gggoGzOmzg0RELBdaazXrq6X0+gEFr1+liKDAEMxjGNUL6IVqPiOy+5Q== 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)(396003)(346002)(39860400002)(136003)(366004)(451199018)(6512007)(1076003)(478600001)(8936002)(186003)(2906002)(107886003)(26005)(6666004)(52116002)(6506007)(2616005)(6486002)(86362001)(8676002)(5660300002)(83380400001)(4326008)(41300700001)(38350700002)(38100700002)(316002)(19627235002)(66556008)(66946007)(66476007)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0ZW58v8Bx1DpDrPS8UlzVzgCk6m0VQ1imj8pYVSJkz+9E2OVWQTi2Y8SR0DiSCHIROo9DI/xDe+NRZrI9O7sSdYNE1ysGnlmrRjrqwvSkvCX0HVfFkFKdvXIcJnz0ly7DqUBed85n5m8aynW10m7MpIPJjjrTTM4zshFYfKI0vrVlH5paFkRj0L5mnythz6gKzhwbLq3ScVlTjOdqILqG6pUTc6Krv5IPUQdECzVeQsk1EUoyys+oAFdIYWBvQ5oU48W17FBB7GL+QFbTTludEiAAC47WJbX4aGC9lbuZMRniarkiLY4Kzfd5iyI01f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r5xrVsN6019W09k5btLZcyQQgsEhve4xJMmn8if7MuGFpraRVd+UIuF2PdZBML4vaKMSfWSjyHz2uf+xDp85pAcM3QairwUAwJ2uZ7C6Oqy/AFku8b84veJZoKdjeqvwSSjcLqgqhBbpjyBEAfvg/aDWrzNzoeciayyfVXB6aaMZS8j8R9KWkTssua5FfLwfMngBNUgbt X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea3e8357-23d9-4e21-a0b5-08db04fa43b6 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 08:48:32.8840 (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: WfwH8791XEUTaq+Zp4VShho2qHc9G0MnOX+cjzIaT/1NurgVfptLHiQABU83253fTFDAkWb8osEtr5dyyRpNAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB4514 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?1756708893501695892?= X-GMAIL-MSGID: =?utf-8?q?1756708893501695892?= 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 --- v3: -drop old_ipu_policy type conversion 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 8a71397fa060..10e34753d246 100644 --- a/Documentation/ABI/testing/sysfs-fs-f2fs +++ b/Documentation/ABI/testing/sysfs-fs-f2fs @@ -724,3 +724,9 @@ Description: Controls background discard granularity of inner discard thread is smaller than granularity. The unit size is one block(4KB), now only support configuring in range of [0, 512]. Default: 512 + +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 08dc64c5050e..066cd497be09 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 e1f1ebfa59d6..2a95545b2938 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) { @@ -702,7 +726,7 @@ static ssize_t __sbi_store(struct f2fs_attr *a, return -EINVAL; if (t >= BIT(F2FS_IPU_MAX)) return -EINVAL; - SM_I(sbi)->ipu_policy = (unsigned int)t; + SM_I(sbi)->ipu_policy = t; return count; } @@ -898,6 +922,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); @@ -987,6 +1012,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),