From patchwork Thu Dec 28 06:58:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuezhang.Mo@sony.com" X-Patchwork-Id: 13505637 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EDE63C0B for ; Thu, 28 Dec 2023 06:59:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sony.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b="Yr3zY0cI" Received: from pps.filterd (m0209323.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BS5LcFp029839; Thu, 28 Dec 2023 06:59:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=S1; bh=VnZHycp6jI1p9faY8qa5WpUpWqERRAEfBqQ12r0k9mg=; b=Yr3zY0cIw8pr6srf8U3uLw56XYuZPUbnYCBIZk6o119LhK4XVabt9Jy7qId7xDK0fq0B QFeVExDWnhEJ4HAUagzBNnOuZ07sUj2qx4R9SmwaysS97dMBcj/A4yk4cqZl2QvUBCEX sT5z1JaBXraMsc0QlQmuEAwt9+G3X/XTA3JIWxeuY3JCGmkdhZBCmnOJx9Bts46PpkMn qQ2GlRAbhxwE3/cgO9XgfzX69j+96PIBndIc4qUu6OUwXmLwHLo8Ao0jOlwHBCnAw/qn d3LZQcVvRP4QFCRi6ifX35vDe3hJHQCCKSDkIylKzHzohirdohNq2V3zGsR3HpmgdOFP FA== Received: from apc01-psa-obe.outbound.protection.outlook.com (mail-psaapc01lp2040.outbound.protection.outlook.com [104.47.26.40]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3v5pw1ut2x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Dec 2023 06:59:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UA5Ncdt+noyTETU+55adRcKYCGOn5ByYxjUalbd+Udzqu6nf9OwfZMYb7n73mqHcnJT9TvW4gvZbHWhe6H8nNCXGoujWeFKWfA/XmFP3tgzf9woofrxOxMkmV3EM8gUGX4p4+nozO0mgywiRyFf0e78KKiQ4mIrwG8XNfViu+N7w9dtIERompx9Vae/iXX/34rJucVxO9TLzJVOe+YeyMx3CUDHO8lPOnORvnIg3F9pn4hoL0Pu18b4rrmolPOCGZ8pOWLcTxpLGwmFpT9X7lrV/f/cafzC+m1VyZy7X13q8j30zX36RqboE8q5ZfnmFwZXn4S09X9siEe/iO22ncQ== 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=VnZHycp6jI1p9faY8qa5WpUpWqERRAEfBqQ12r0k9mg=; b=lUxSWNajKXPfXYmku1NtTJ1D7+3ZEnunBXRxxpKE10Z6D3mdHhXeQP2qDuIJVpG0SCMdtoBWfZYIp4qfUUs4x4aABNH0VJz7msCHwo3OMEG8+32G1Fivo3kLGOlcnA+k2642AUUPtsV879xn2qiJosoLLrOnKXet+rEUSsZSvspwSOKEYsdG1yAS0oY58VSolPbGQUfPf7l7coH+/KYIYYuGadIK+AIutM8TPStVcn2CfeS7yu7qRnF1MdocDUvJwFBmzJz01jbui1VCKkfC7xf5c10ZSllHM4mm/FCiINcWN9NISCv3EnptMjkev8aitDdqc70aJkcSaBVGOPwQHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=sony.com; dmarc=pass action=none header.from=sony.com; dkim=pass header.d=sony.com; arc=none Received: from PUZPR04MB6316.apcprd04.prod.outlook.com (2603:1096:301:fc::7) by KL1PR04MB6878.apcprd04.prod.outlook.com (2603:1096:820:d5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.26; Thu, 28 Dec 2023 06:58:54 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::5914:6fc7:b79d:7e34]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::5914:6fc7:b79d:7e34%7]) with mapi id 15.20.7113.026; Thu, 28 Dec 2023 06:58:53 +0000 From: "Yuezhang.Mo@sony.com" To: "linkinjeon@kernel.org" , "sj1557.seo@samsung.com" CC: "linux-fsdevel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v2 00/10] exfat: improve sync dentry Thread-Topic: [PATCH v2 00/10] exfat: improve sync dentry Thread-Index: Ado5WJu71ggSUDvySECWBpSIgzEMmg== Date: Thu, 28 Dec 2023 06:58:53 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PUZPR04MB6316:EE_|KL1PR04MB6878:EE_ x-ms-office365-filtering-correlation-id: c9c20b82-968a-4c15-4ef5-08dc07727449 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ra5phT29KPolcCHdPLrXN+w/ixJ5hSUYkboDBcVkgW+v/vvF5anHbnRou/7vVmre23DXy+52jXL2EpdcY9chdUnWWJTck+zbyFYtRrB8WHyDxcM7f81U/yB0mDxV3rZF7PrzuwmbjYkPEwVwy1bc5LHqiimxv0M3R2BC8ALM6hobJqi98ryHfBa/WYe93N4ldm660QqugTsRQRRcwNwpCOXk9gwfaqHQ3dQ+nYfBD55KjlhPryfWpFj3chv7u3P6HEW6onjTaWZVIZDjcmLa61qxXWtv3ks6pbwGruQmJnw9+IVWxyKYySKMC74V83vqSibvE0L44H0IvogrSNsaJU8ICcsFOIwh9Vrl5FZJoKSVXjBzbMsM1pqBtZXPoxZFoy6uAnf6VQe2o4cbOzIJ6a0TzQOYw72eZjSi8+WPUfOIjkMLFPoLq5d/7+sxiqMLy3BpfsfdXfWc2YDmeNxWQtkPyDSjXHm7tZy9bl/vbpoqFdFT69vjEwC0oKbXaIHWnp+IqcgbMicDKXm/BR3mfIazjDMeYKZg9hPwd0yAOmIERcKNi+ejvECR5rn88dm4bTBzB6Kh7yCN+De5vNEeN4ag1D+XCevGdr/RyV3nZ4vbKLtOqPwZYVQlReBIiXTU x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR04MB6316.apcprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(136003)(376002)(346002)(396003)(366004)(230922051799003)(1800799012)(451199024)(186009)(64100799003)(33656002)(9686003)(6506007)(71200400001)(83380400001)(7696005)(478600001)(107886003)(26005)(38100700002)(122000001)(82960400001)(41300700001)(316002)(54906003)(110136005)(66556008)(66946007)(66446008)(66476007)(64756008)(4326008)(8676002)(8936002)(52536014)(5660300002)(76116006)(2906002)(38070700009)(55016003)(86362001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?PLVRJralN+DTaoszGNgbofABGfwJ?= =?utf-8?q?TLUO6L9Ueav+VnIfwrV1Eu/bdJKniltEcxNlWPqxquFlgi2bFcIvEUAfpAo0N/8Ys?= =?utf-8?q?UVtAvIA9kB8KuNTxB0HrtfvQk3lHWdfOJ5SJ5Djq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5jql3+QoSgXdtbzB9WixOuyH?= =?utf-8?q?3L7gebV1gHaIdKbniD4O83rZqOG9k+cAQOBswNLPvtMV74IlkWZJt16B+bIFKgQe+?= =?utf-8?q?22LqoU812/9Q2KV2IxFCCtjFrNqB/jQSPcf7ALTedmt7AeEj0POnYfsjwagcbNvbD?= =?utf-8?q?aC4aNy6W0Qq2imDm8o5ut16QgesQXtGC9pU4o5GQrvP/b5RMbliMnRP+yj2oSWxy/?= =?utf-8?q?WenEXd1jLHkBKOwGo+m7+MVfEgiqmOT3UA+rK4cPK26q+rxHav72lTDpLf8PCY3iU?= =?utf-8?q?gpb837qW2DpWMwvI8ExPFKgrUQk8iQ07QlREsLh7rvgeQiPLZeeSAr93Oox4a9Lmu?= =?utf-8?q?85NsdkDOkDw96mqRrNwPfZ3YuRkkbpOs7vYCMiyl6hAnfLS2MOxEQqbvz1RlVzCcb?= =?utf-8?q?hiqtjEzN39Bh/zbSnpNImVeHTzwrriRgPlD/aJ17CdrprAMphE0DVrPQTZdii6WX8?= =?utf-8?q?rTa3bWs06WT9e66Lx3kDfl67q+qg1iGOZnH9AHvRC2RVRF5oai/IQ3IZjnQDbXP8b?= =?utf-8?q?UmqdzN8tgE6w?= Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 30YRw9YmxMOHMD6T7ei2SwfYkjphOY8S2lCgobqqxsPGPbaeYYCFxjBGYZoJRQ8M3poI1wghLRM7gY7LGqXZksDQcZT16zYMg1lIr4zuj0M0qoKa9vX2kPhRDFU6H6QVDpgAs8FUFx6qn+Nm+i6Gk1qxme9Poshwr//YVLiGvJ+ud5/XOlhLGs9457VE/ezKlPfLkocGAiCzRFIZPhU7FzPN19iLzjxg84pBo16XM3uL9NElEW+5ZjTS01IqFCxydSly4ruhnxouJlNCXR88OetDaYcystFnNTZZ4HNLTqwlzIpnsRA3bGgyJlIKhnLIaa2arOMaTNLd83AyVsXkWFFPfYMNc/wWZ7i3hggaES7vwYQYYrarviQFqqmyvSObXaHZ8oV1gultGquCDG5IAU46fPaQNcjCvPvC8qRHT5mNCiKS/h3gt8zZHTVMg/wT1EoFPU4xUoORjCvc/Rs1jr/hVUy26bIM1i2/KsbAb7xhtZpcs+zHYrwMEoWSuJbZzRyCHGEV1NLfo8cWQ8glbyneGHIPunjP1wXhiF9Hg1QOW/9zv2Kq2SQC1NwxkhisTk2pU+Bxau5+J7G2I3q//uub3+vrsk1nLnBxlcnpZK8XzP0+pQSPcNGRzC9DrNvL X-OriginatorOrg: sony.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PUZPR04MB6316.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9c20b82-968a-4c15-4ef5-08dc07727449 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Dec 2023 06:58:53.7814 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 66c65d8a-9158-4521-a2d8-664963db48e4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: VOVjUEXCjydNdflrt3deiKPAWW7M+rgM5SNq8GV2rr4zAXJn36V+0j4VKyI4Of8CKUGdyVczUKynAgF0Jrp+AA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR04MB6878 X-Proofpoint-GUID: IL_hygE5ZiA8w6tDOgfKcu-6yrjinmdY X-Proofpoint-ORIG-GUID: IL_hygE5ZiA8w6tDOgfKcu-6yrjinmdY X-Sony-Outbound-GUID: IL_hygE5ZiA8w6tDOgfKcu-6yrjinmdY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-28_02,2023-12-27_01,2023-05-22_02 This patch set changes sync dentry-by-dentry to sync dentrySet-by-dentrySet, and remove some syncs that do not cause data loss. It not only improves the performance of sync dentry, but also reduces the consumption of storage device life. I used the following commands and blktrace to measure the improvements on a class 10 SDXC card. rm -fr $mnt/dir; mkdir $mnt/dir; sync time (for ((i=0;i<1000;i++));do touch $mnt/dir/${prefix}$i;done;sync $mnt) time (for ((i=0;i<1000;i++));do rm $mnt/dir/${prefix}$i;done;sync $mnt) | case | name len | create | unlink | | | | time | write size | time | write size | |------+----------+----------+------------+-----------+------------| | 1 | 15 | 10.260s | 191KiB | 9.829s | 96KiB | | 2 | 15 | 11.456s | 562KiB | 11.032s | 562KiB | | 3 | 15 | 30.637s | 3500KiB | 21.740s | 2000KiB | | 1 | 120 | 10.840s | 644KiB | 9.961s | 315KiB | | 2 | 120 | 13.282s | 1092KiB | 12.432s | 752KiB | | 3 | 120 | 45.393s | 7573KiB | 37.395s | 5500KiB | | 1 | 255 | 11.549s | 1028KiB | 9.994s | 594KiB | | 2 | 255 | 15.826s | 2170KiB | 13.387s | 1063KiB | | 3 | 255 | 1m7.211s | 12335KiB | 0m58.517s | 10004KiB | case 1. disable dirsync case 2. with this patch set and enable dirsync case 3. without this patch set and enable dirsync Changes for v2: - Fix typoes in patch subject - Merge [3/11] and [8/11] in v1 to [7/10] in v2 - Update some code comments - Avoid else{} in __exfat_get_dentry_set() - Rename the argument type of __exfat_get_dentry_set() to num_entries Yuezhang Mo (10): exfat: add __exfat_get_dentry_set() helper exfat: add exfat_get_empty_dentry_set() helper exfat: convert exfat_add_entry() to use dentry cache exfat: convert exfat_remove_entries() to use dentry cache exfat: move free cluster out of exfat_init_ext_entry() exfat: convert exfat_init_ext_entry() to use dentry cache exfat: convert exfat_find_empty_entry() to use dentry cache exfat: remove unused functions exfat: do not sync parent dir if just update timestamp exfat: remove duplicate update parent dir fs/exfat/dir.c | 286 ++++++++++++++++++----------------- fs/exfat/exfat_fs.h | 25 ++-- fs/exfat/inode.c | 2 +- fs/exfat/namei.c | 352 +++++++++++++++++--------------------------- 4 files changed, 289 insertions(+), 376 deletions(-)