From patchwork Wed May 31 14:40:06 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: 101499 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2947497vqr; Wed, 31 May 2023 08:05:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4yeaxihbAqIFdy68cct627a9XHTtCdjp9TNYbLKpeGKHIZyG1HBfdlLxmPXZr6a5I++nsg X-Received: by 2002:a17:902:8684:b0:1af:c6d2:287 with SMTP id g4-20020a170902868400b001afc6d20287mr5414850plo.53.1685545502266; Wed, 31 May 2023 08:05:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685545502; cv=pass; d=google.com; s=arc-20160816; b=lLtuA76VNDx82o55MXRiK9AQiOqMmVxV94wkwqq1B2cgaNnVM1UI3jewJxI4BRbQfb dHk5GzghMn8NwiKgMnYaR1jmm2IX3ukTTewCx06O3zUxPmmNesNWv6RpyR79utkDq7Ek 1TV+fdvOdZvDtG64HE/4YH8zhR0q2A7cD208zZMYB3liBgoEuDd6cjLpvbM0+12eYLZw ODf5iMeA8Vw9D9FRytBQvbxT/KZeocphra71JcY4lnhzPyW5y9L14QQD6On6ZULxGXl3 klvQz4AAh0pTcMjzXOepG4MMIge9Sah7fLeGUPQcf4n30TIvNnsxbb85p0EwJaNzar0l RTZQ== 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=mjOCgHIG1448Buvp+x7QYy9EYRlMqziddbNIa/zVseo=; b=ZcVe9YYWbJBnLVdlCpUXvwnNs6ONfKXlyAKmMZSk3JQ1JTnL9DuHa4VST6HuknBKZ8 xoKbUka+lnsIIs+cIcSo4aJkX6sVnYRw+KnyTR6Gs9W+r5pWt28I1eJSheseFcGEG2wa 5K6u+u2v9MQPa2OMKr2PfCn9l5FZZlR8U56L5cxoXoNukCrf1EiYJyHPLD7tSeSEnUrh 5cv9aNhxJ/JtjRhREOZOefpuLNj4VoOXlq4gxgxROpgG9fJHRWM11c8zGZskcSuTHciE I80xQTjS2B8wL2hERAgPRAVLuAAxEklTzeT0kOIFyyOZsTNS+XZd2afS/jqxhhxLl2K+ MMyQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=WwDzSIkr; 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 ij13-20020a170902ab4d00b001b18c3ee3fasi391157plb.225.2023.05.31.08.04.48; Wed, 31 May 2023 08:05:02 -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=WwDzSIkr; 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 S236786AbjEaOk3 (ORCPT + 99 others); Wed, 31 May 2023 10:40:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231603AbjEaOk1 (ORCPT ); Wed, 31 May 2023 10:40:27 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2112.outbound.protection.outlook.com [40.107.215.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D177FB2 for ; Wed, 31 May 2023 07:40:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TPtvZ3x0wZL4N61HW3mpxeP+aZiO5p7usofAwh/jl+GGlsSBPSInzBsWHCFIQPM21OhqSPdC2Bt23c/n6Zutc35NjRW0Bdc3hYNIQKb569H7eystpNZfG4Dzy3S1DOlXb1FSBUsCZvCUeCNhsrFN0RMOJcgfgTpABkM3Bi6PlrKzgzYAVbfCeiLOWZOhwlSa4j24WdEXpfGaTYzJd3JzuAcqM6znjm2wCaRL8pB7+jEiQfJwSz36ib6OX0fYMNKoJ6Dtp5GGFwypWU+U03eBPThw7HI5+DVSmEwt0wvwDfYIqbkLxxQOpRP8iP2TCy/HIWk77s4/v+46LvibUQ3sGg== 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=mjOCgHIG1448Buvp+x7QYy9EYRlMqziddbNIa/zVseo=; b=ccLDL5ni3SfP92+OOgPFLDRGfLVPSH9d4wIU4RDgQcc8iLDTV7bYnVY+fpdcx7yjVlBtyEF3NEsJHFW9qQzYUnhDsFBkufosWZUVWsR0wjBbHDA/4FWt4X0GhFU/bavXQeZHCYXHEGeMn7FaJx91S4mqBBwpuZIoVEz/1FpJDqmqMOOB0VCM4kebUPd3c4YglBnt2CHmFZ+tkvUyV24OU/cMh3RQKH9JiwXsr30nmEm4jcPPOmRB1sU0lFChkC5CZMGON3nGl9HjV7ewB5zv4b/qUAvMLCVCN92RFLDTwdF/HquCqHlYkYXiIpuJ6oRX+ooRfllr9umkuI33cUok0w== 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=mjOCgHIG1448Buvp+x7QYy9EYRlMqziddbNIa/zVseo=; b=WwDzSIkr2nXE0vwIOer4eZ8EcEs11NzObI+/jzWzcuiLh5XqGrK3O4nHTkq5ak+6tfRYqDqslDgDYinQ4EUhYpJpuE5D09puhreCDuWhLE4ihdjQe5Z3hje+SYeWUtf2jYKmisvmzISf9BiL9ds1It13k7MtQ5ZSoCq8m0d5QWHUCfS3L7wXpIhjwHaB7NV/QjO524MbAR+04/B7I+jHHNcMlSmGMjHZc5DMJ/vxRWTeyVQNKZT9/9GVKcXjjxGdNapUE01dG3Aab3iNYocxmA76XFGI8qj1WOXis1u/10ygRp28ruIZihT/Nh4EC2kqIgW3a06ZpVl8ZQtxl1AXVQ== 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 SI2PR06MB4380.apcprd06.prod.outlook.com (2603:1096:4:13a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15; Wed, 31 May 2023 14:40:20 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::76d6:4828:7e80:2965]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::76d6:4828:7e80:2965%3]) with mapi id 15.20.6455.020; Wed, 31 May 2023 14:40:19 +0000 From: Yangtao Li To: Jaegeuk Kim , Chao Yu Cc: Yangtao Li , Lu Hongfei , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] f2fs: enable nowait async buffered writes Date: Wed, 31 May 2023 22:40:06 +0800 Message-Id: <20230531144006.7307-1-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 X-ClientProxiedBy: SI2P153CA0021.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::20) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4380:EE_ X-MS-Office365-Filtering-Correlation-Id: 55a01ab8-806f-486b-379f-08db61e4f4a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bm1aAe2amkRR8TGOzDLbcbq/Rlm8Iqg9TcedMUU7Gs41JgGXT6CZLmLyxjrsDwF3+xVlEjE8pj/pYHou8xQio7DWXxyercYrZp+7gf//nHQX7sGThhl1wsxjJF/JVp6hbujGpKnR9NnutD6mX/Y5flC9oQdcc2ORQ60z+N6LADp+ZRAaE5mJn816o6kv81rJC5BYBfT6E/QJIesia3mgPQJE/j+qkusurURf7XBRCpdBB7JTnnvXrrgo5KNSCZPGQnIBOeu4p0561kQtZ5v8Evy55DUj5sHcfsd/BrEqogVul/6TH+qKVo/4fdynkgMCMLDdIJtITD3c2YucNphzyOWIoj1DHN4sSCElqZ0UxeqhQSRQGsmB/190PtHI9NREann/odrSWxy3ZfDPPnpJztzR9zFfHqOt22em60cqUovlaMC2OZvJhFgOFLy/eC5BdwxwEoJoED3Y/wB2mQQuIFHfhlFp5Mduda/SBKG4tmsbTGOmW5GtEsgtDI6YRng3liDL8lSWRLfiJITsOHgD+TyKH43ElF8YfLDeJgujgMbpod4kwUpJ5GLODJiUyh6kYmno8+vii7H9nQKw1PJUUl7R+WGmt882w5UbadS4nGn80LSbiXFdFNGY/1fX4aiI 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:(13230028)(4636009)(366004)(39860400002)(376002)(396003)(346002)(136003)(451199021)(2906002)(54906003)(5660300002)(8676002)(8936002)(110136005)(316002)(26005)(41300700001)(6666004)(4326008)(66476007)(66946007)(478600001)(6486002)(36756003)(52116002)(66556008)(38350700002)(86362001)(6512007)(38100700002)(6506007)(186003)(1076003)(83380400001)(2616005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qzh6XUA2B8T2if74+PDHqI4Z+oXcJsB07xOhxS+5I/6SVmcRVMy5rcRXIg1oby/NWW+At0nAgSjyTADTPGRWsdGQQpfx0fhzqIT98B/ZZy8oY3ibNQExTrYtnOlHIEE4Ih/OSaoiQemCSa78ziG5ldIqTLDUbKeKMftVStiHLDW/HF3OxMGLcOhDuVVsjYeX05x9LvLAVFO0YPUmQglA3Pa8iy+dORReQh5lLOuBfvQ2qC8ahyFBySBoEPQ+4cyNR7EvMpJZfnOZr5vC/Pu4CRszPknRMvVyOKjGAoit7e1xp2lUX1O3n1bUmYXSek8byrw1IxvqIfQBJzx7+0L1dxDPwARUANkWLvFiiHwM6YEeeyaVOHfzbjiPrJuBbbLQjcwo73nzVE+KflZyCLto9RgfX60BkPdYvZNAP/n/3kZAiBrGCacNhEiOoCIRg/b1/3Jyo9bMgJ95MHqhcCo5+mTmrf3sB3vt9MCQwo6bzgyYhtj/WP+B5KU1UIBMmgwQNeZ2jYu58uGlR/xkgnlKLH+vm10yTIqeiQ7lHxLPcbrBodvLx/lVk9Stmmd3oEStOoOm7AFusv1rx+fapb5dpDuBf9FuTiWbCFab22ZPlPsUYZvKuyxtFKIocCzE9CGgxV/NGF5sMkbFCexrb9pY9//8Ty+lSJC1tyABJSgg+39QochUpx1OJYfuJgK/ns1Xg+RbUVJfffBU4rBGgbKOnhJVi01fj0YKHLF/CeRWRgTXuo0zsk425Ht4lan2miUsQhKGmXARPV/8UiUEDGlpN1P5jaz1fDvfzeR838H9J3MKGPE4Yvu9EMgFL429guh0qQwBMs8FdsWul/FvRPjeawaKFlzjHElU/s0qf5orPSngsUnRjYxPVxsbjZXkKFt54tsUFgDrafDF09l/IErLwOJxoSpJUILanJgYyaJiAKE1alN+g0yDQguW5q7aFQyfJPZu5K88gEvMsmN2SJakvjVSFv7jV9xpYvdqIsHXz/Fn6KKifFmCv5B4AZeiP+90cLeyiRHInG4Usu7kg4CR40Yo3Y/PkNL3w7qBrVyOR7jZl9iMjqdP9Id0e++RPjSDQf5fOBwn49MWfrECmuh6KNWP2X0DRLCAcS90fQjzRxIZGN0gAy9thv4HOFoANsVbpPcxEk1z2B5MtkahRUKmDyd9LmPPhwZ1YFB4SVQNRcQkDDStI6q8tIAkPdNQxDulSYBhM3iGvKCRodzcpG/E4nHd0W7g0U2vUBV9nFCUGLRmAEVWRu/hFLZNq2tu8RTdSOfWuLV+9TJYLJ6p34NnDRcKHJD9WEWQXCs6llYkdVeW9Se/GIUFdKfsy9NTwtuK0OOmICx1ChYWhSBIvzhXTmCZXuF83XYu+DsxOJcGOBcm96zx9h3xvjeSuiOcM1qgDoKzhv+Hxk59Q0srciovDkmaj7Cm93dBebfhzxzxNdoekNzRnxM2dGG1O8T/qltF9FyE0kEVhzx6cDXNUwonmAsx5SjdidJoXdkyI25Js3wwnSYUDbceVsSWqIcZ+2KMw0WpTlKAKPGCPNMkCsIYjHOPiglxd6+O2HjVnUhu60dz406kVbrFrjm+G1UH4GeM X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55a01ab8-806f-486b-379f-08db61e4f4a1 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2023 14:40:19.3317 (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: jjjXIXs4IsgMXEL+Ni2l7jE1pSQoak5KIv14gERHNGaL8S6OoMwS6GP1EGkC8xSMGV8zcZuAK5YvGI8K01H5nQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4380 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,T_SCC_BODY_TEXT_LINE, 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?1767422560836785822?= X-GMAIL-MSGID: =?utf-8?q?1767422560836785822?= This adds the async buffered write support to f2fs, the following is the relevant test data. iodepth | 1 | 2 | 4 | 8 | 16 | before(M/s) | 1012 | 1133 | 894 | 981 | 866 | after(M/s) | 1488 | 1896 | 2081 | 2188 | 2207 | Signed-off-by: Lu Hongfei Signed-off-by: Yangtao Li --- fs/f2fs/file.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 23c68ee946e5..4faf2c04e325 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -546,7 +546,7 @@ static int f2fs_file_open(struct inode *inode, struct file *filp) if (err) return err; - filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC; + filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC | FMODE_BUF_WASYNC; return dquot_file_open(inode, filp); } @@ -4515,9 +4515,6 @@ static ssize_t f2fs_buffered_write_iter(struct kiocb *iocb, struct inode *inode = file_inode(file); ssize_t ret; - if (iocb->ki_flags & IOCB_NOWAIT) - return -EOPNOTSUPP; - current->backing_dev_info = inode_to_bdi(inode); ret = generic_perform_write(iocb, from); current->backing_dev_info = NULL;