From patchwork Tue Sep 10 14:39:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhiguojiang X-Patchwork-Id: 13798625 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1429EB64DE for ; Tue, 10 Sep 2024 14:40:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 394D48D0081; Tue, 10 Sep 2024 10:40:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3446F8D0002; Tue, 10 Sep 2024 10:40:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1BE448D0081; Tue, 10 Sep 2024 10:40:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id F322C8D0002 for ; Tue, 10 Sep 2024 10:40:07 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 9B97F12040C for ; Tue, 10 Sep 2024 14:40:07 +0000 (UTC) X-FDA: 82549088454.22.35A820D Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2073.outbound.protection.outlook.com [40.107.215.73]) by imf20.hostedemail.com (Postfix) with ESMTP id 4B7761C000F for ; Tue, 10 Sep 2024 14:40:02 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=U8vDYEu4; dmarc=pass (policy=quarantine) header.from=vivo.com; spf=pass (imf20.hostedemail.com: domain of justinjiang@vivo.com designates 40.107.215.73 as permitted sender) smtp.mailfrom=justinjiang@vivo.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1725979176; a=rsa-sha256; cv=pass; b=AWcj5/8sYuoRHwu2E9lInk3YUWwqiGH/6BY8JghHMRmgmJJVv2vIQgXztO7Ap+eVRHAQKc t7wKb3UA5QvDuN3OqBF0JOJ2Au3ZAAKWVr2EbPu1Z7eomMJCC2bhOmf38oX7DHsgXK/u98 dPvDiVHZoEK0iRmJNgPzC3lkHIC2LXA= ARC-Authentication-Results: i=2; imf20.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=U8vDYEu4; dmarc=pass (policy=quarantine) header.from=vivo.com; spf=pass (imf20.hostedemail.com: domain of justinjiang@vivo.com designates 40.107.215.73 as permitted sender) smtp.mailfrom=justinjiang@vivo.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725979176; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=MU7ULVMcdGr+iJVS88z4uqzCHo03adAPGF+Q86N6kvU=; b=qWrtO+DJ76HJoPGRSI8rnHLOuJsCnJF696ZLdfK81M2SI0Rb5MM84QFsfF/c1sjgyraeQ1 88cg40sd5OwRjyK0J5bawyoYE4URCOZqEET3u0bfiwhkFor/gGOd05k3a0IR1aZNHEludh j8+pfgLKVbTswy370swg424Of95+9cc= ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YmhiuBUdtvaCCBMLLPDHy47RnpN69meebLHR5FS0bh38SerfgK8Ofcpsi8vqBXSxkR+xg2bWOtR6q5syi7owlr4+wqXZnx1Vggyzt60q+0Gmn6MCIIqP1FqACmSzI/+Fr4X4cxCJHcoP5qbxFF0w2by0rrpzgliqoxmS3zF6Ctt7S3rtsNI3av2BnX5MNTxeXC0au3lUlmeMABE4aJRRdW8jZ1E2VBLNfi0U7dCjhvnp6h/Q6U/2ag/mGJtLo8EZgsUsDxWs4YkOy4d+6NQEoz3wx/kGNIL6S6ayMRIWLtWKxAKk6fMSyc6z8y8+eO1CSgEON9t4LNuqZ5VBNCc6Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=MU7ULVMcdGr+iJVS88z4uqzCHo03adAPGF+Q86N6kvU=; b=S8VklMGlnFZeiQ+wBh0UejD456IBfq78RJjiht2n+1+f+T8zZm8jHK9dDfEF5aTjCZhB/WdAzVCET/ksaW2avqJ+n0DUI1DYmnu8VmXCRwzwpKy48hyhFaepfimI73xMUsgvD/hO01ZhVPvmR5wqogHVE70ijVdRcopBx6Pdr/fn6UoQHPXAvhWlh+Cbgt7+KOVV32w5yr6fGI9PYIXLa1mLLFGdfmo7YDjwszpYE4aYVGh9A+5gkK2omHzsSEV85VBjFPP22ACGY6RiHYoKytr3gXNq/oqiVI5FLcMzLH6wKwlaBaJ275U21p/K1Lwu1c6mMPalbt72wPvsvaI3ig== 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=MU7ULVMcdGr+iJVS88z4uqzCHo03adAPGF+Q86N6kvU=; b=U8vDYEu4wMvGWa56EPfSDC05WhODZ1hB27IUs1xOQYbjuKccgVyYBZtBkqlwGMzOzWwt6j0LA2o9XxzW2lTELxQw7DwXa3C2APfgKgBU3jisLWel2CaZVvX3vAHMvJEo+CysG1nBhMqPAAJjkF9QjBmRlLUl0HUCfU2WuaDkYpRTTWNHP7yiJJO5KEoYLeTBXVQDRpLagRPVqNJqtISEVHcVgX7iEsHkXMJWHY69kl6dKMFIF4OK8SXOef91b7HMyNrLqWC0vU/Twx2tZfC94YDlx2VreLw/fi9dfKq/ZhoTl5JnuAaNI1ow8a4cE54nuIYsRh5CLcKNY7yq4K9DUQ== Received: from JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) by SEYPR06MB5768.apcprd06.prod.outlook.com (2603:1096:101:b3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.23; Tue, 10 Sep 2024 14:39:53 +0000 Received: from JH0PR06MB6849.apcprd06.prod.outlook.com ([fe80::ed24:a6cd:d489:c5ed]) by JH0PR06MB6849.apcprd06.prod.outlook.com ([fe80::ed24:a6cd:d489:c5ed%3]) with mapi id 15.20.7939.022; Tue, 10 Sep 2024 14:39:53 +0000 From: Zhiguo Jiang To: "Matthew Wilcox (Oracle)" , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Zhiguo Jiang Subject: [PATCH] mm: remove redundant if overhead Date: Tue, 10 Sep 2024 22:39:45 +0800 Message-ID: <20240910143945.1123-1-justinjiang@vivo.com> X-Mailer: git-send-email 2.41.0.windows.3 X-ClientProxiedBy: SG2PR01CA0152.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::32) To JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: JH0PR06MB6849:EE_|SEYPR06MB5768:EE_ X-MS-Office365-Filtering-Correlation-Id: 82a31517-36ab-44f3-8524-08dcd1a66f01 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|376014|366016|38350700014; X-Microsoft-Antispam-Message-Info: 8Pk26gwVc0Dlxp3WLDnjZ6WFFvZH3TYNgE7G9xRh9gm8i+OYGMSpnEulsz2FMvj3pulEpXrhHkffruZGCGJfUrpEw1ONt3UceJ6urO4AskVUtDpcj9YYevbbqXelkHddIEt+VkAwR6K3iDL6tehw1SdGOiVLAAH0k7pTrujfWupHxGOQXu3gUlzGHPZ0nuxrr6ay7nQy10hAj5giBVVCf8JdI61AIsvc6BxEijC4KMI7m/FjqnMqphq+Ne+BYEzr6aUDWCBANqyVUD1LkoOkZTLzKiJA8ngN+h3ZO3juypxy0vgGzEbwb4BjlYoSQBib7Fhla+9C7nEw3hOYGFACOE3Es+LVGRW0HYhp2yz8+fEg4wh0AKiVUnmlBXy8p9UEow7H4ClEIe1YtyGw2sPJunB6JmZWmz0lzFtwGblkQS4wJQEiuPeF8BRnWohFhYTNv2CPM1Wp+wvnVojWNu4PpwvPkYdogdYE9s45UHf0HgqEXOI4z6NsZeumd6FDOGMNdh9i7QedXAA/JpU4I9nWKwwapSfGcM+5bsZQsfHgU7/GFug649/h1cykBma6MP57zlt5QnSa3uD+6TtHtd5PaSSrh70kVRwRm9ZES6lWihQbTdNDmium4zBVe9ccTOcysbR8K80rvBkoZQ6KnEbxQLrMhwlqETDGGOX/GRmH4RvDV3WdLL9UVBmNDXtMiPlDVIm4NK5xCq0wiBip8rsjFPq8towlVL62aGHw6XRjIU62ZLKUarqZsud7YAa1ufC0jjctW8gPQrRMtd8JocSypfWJDgDAzg/Ah3T7kpwmffJtFJ/hd66AvX9muHN3PtOF1UtQinAGY/R1wQnx6EJmA1XyMi1aV5hli5ekekt8mTraS8+mos4USTVW2c2inJbYvnASpFDgPOkVEOo8HVqj1IoB+0h+Ee7USA3jHc3Wgj87DrxoLrhqxz480URG7GdHyKWuZoJY0sPz7MkgRSsU1uJwqjUp6OK9eye6UYFLyRjlaJjYWHWQh3m78CSgzDaHVzBp1p5sQKkgpjPn9HpLdmnFK5TC1BWZ30noBIW9gaAriQ7FY7eXmTX2t+iSk35juPKSHImn8O/UGadqwhxKeWMspQonTnd7UVKjMLsEvutx0dJh9bXNb2AdK2nTcsJQfFWJ2wzQf11ZuzYe+OD3RcNqAQfI1pNHViOwnJnPSw/nV0P/ajqKWY7cuDUKX2byoNNI0W/6yp5QgFJhwB/fxUIHdgnxOFOOUwLmLXlN4RiqY3LEH6mpr+dvuR7xoPfNBP53wGT1yTnM1qRj0nv7ByRVpLuSOX+7e7NmzoQp816rBJCVChGam4yVgKO6KwSNGlQGfaC3LloQxB/hNHHddjcfVA9P4RkbsRqAAJZ7SbzeMS/t3FogKOgHsyS/KNJXdZy1CeKw3pmiM/7LC+vo9w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:JH0PR06MB6849.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(52116014)(376014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: blm403xNbX1J+J3fsc6FTf6iJ96fCBSJyutFSepbyN4ea2r7PrHh/DuIAsIyEkPvWtHI2s9iKjnIQnnb27qmpaqgvXFKwvflaurVRBjiZic1q7/7YbMoeCRzYtRVVcb8Ho5QoyTIqH1sHYndjJ4dRXIKp5fKb3J07qa/SGYonUo4TIQivBKYyUNaLzTTls2cDnjGiSiqyRe8za9BiOjrngIO9VKE3MECJh9O8R0a9E2MHC6Ex3QnLeHsKEIUlIEdcle8d3osCeXZWdiP6Lkvvium446qecTyQ6iYae+ZeI7wZS1EnxOzgLWsiszLbq+Rg5ugFvThRGL49Blcw7mBXBkq2Rqs+ASDbdnFi/hJN0fDfjVIODta8dg3QHJ9Ee4eKSCkOBF4W/XsOv3pWxZn35pMpPIklnjp6fWq2RajakihQ39J3KjeKPIqFPKpI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Um6kCL8nWXRSwaGhUnpedQBcK3P/oHGrdsyYXacYossGbneggJv4jLz9bTuem511+/vMVWt7Pnju4E7V X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82a31517-36ab-44f3-8524-08dcd1a66f01 X-MS-Exchange-CrossTenant-AuthSource: JH0PR06MB6849.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2024 14:39:53.8429 (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: 6BeCuds7Sd+/Avqg6OF77zoeSfDN7ZOKoJF31FcMRM6uTLMKhG1us5X0plkZaS+M0g64SCB8Lw3yD+VJaPOXww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5768 X-Rspam-User: X-Rspamd-Queue-Id: 4B7761C000F X-Rspamd-Server: rspam01 X-Stat-Signature: 5wmhgdtrdskaa3yh8pyb7pon8dt8jqoo X-HE-Tag: 1725979202-853617 X-HE-Meta: U2FsdGVkX1/zBDrHE/06aBdtLwdK5A8Y/1kaAsiUCr+wkSc+SZGs3unl7v36Ozx0FVp0TrLDLUKM2CbUfOPtRj+C4rUYrqSHM79HSrtw3h5b0TKxYh/spghuXz90evGxKlWQLMCCusX8gjDPHz193MWCB7AMibpFRK4TeKDoPTBKVQGjIvc+I8cqDVIURnwLZ3KuvylU0c4RH5deijdNAh3RD3veVd/QUm5q+89LqqJCQ80KLb9Z7UdBckvTzHcOrD37yY8lAyNBhUyiPNVB0iJFesoa762YbG9bw5tqJF4XQv+AjUFlX8V/J4mOXsALw7Xi9flcsnt2UmtJt7mQbGSNb3wIuTfWTxQYFF2g/XzFjpx121Al/GXHHA3wDRkl0p4Z+ag3N0Y7nmJY3VbeOlwImWIbRhLhxXvKljRUgWbLTiQTfxQFneos7bZQTtl5T/E+M2/CApVa86OFGSUxy6Jszp6248auQsWjrtLs2wRKMNA92n6VlEM5sFNqNeIlEP7NwiDoFDBmfl/N2o571urInQl0N3khfXYii0/J5uSUEHK3tKU+ZqBuu8xuzZpmMZiTCi8lxH2WIwM7oojIr0spGTdEEJNytysVxXrUjKso0p3cgijEE6SWjk3Y+Onv3QPdaaSqWDprgf2XljFZYodBm8DKY01TyC1DChzSsZFPUwZLHBFMeZiY1yGhk2P5sp0fyb9tpDMRqNJRBct15m04IvS1pEOhatAZMofRR32RktmAyi2t8bZn+XU0vInkHCiTm77dYcQUd/Ngqs8h68HhtvZ3VprRvfU17YRPTxkymn3jG1i19CBrD+6qUUzWXW16S4eKacoY+UxCE2vslR1olIFB89nOQDr13h/48IGYH3wN/sFGIxB6FVksuobVk/PemoZBoDW/UganN4LUHpfe4U0HrJtdGHqyw4Iz/4zHRZBCvPNoHrit7Xq2LjVUOhYy/EMuxa5RgP4oAKh FyuWdwmh 1qOH0JC1J+Q5O1VZ//OsbDLyLYYLokKqs2x2WT9bcjE+RAY/w6OElp5rgmi1ENA3oeyIiJpFgYc+hW6Gd093HoxgI3YcykRrb8H/ETE/mq0LZq98wWOB0QpQkyFFeBgdTZ5uC95QwrlDdmG7LA3X0fFdUS++1EB+YGzUiuuBMD/XUxXVTnzsl9aTDawd1jk2aqp3SIVabyl8oviY2CzjlieoyVX+mQNQEHELodV2raE3H+ZDycdZ7/hCnwuy3gI0a4QnhW1LXqE/x3Ug8Ve/QxiIzLinKQE1Akxz5 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000843, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Remove redundant if judgment overhead. Signed-off-by: Zhiguo Jiang --- mm/page-writeback.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index fcd4c1439cb9..2d2c3f4e640d --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -2715,9 +2715,7 @@ int do_writepages(struct address_space *mapping, struct writeback_control *wbc) */ bool noop_dirty_folio(struct address_space *mapping, struct folio *folio) { - if (!folio_test_dirty(folio)) - return !folio_test_set_dirty(folio); - return false; + return !folio_test_set_dirty(folio); } EXPORT_SYMBOL(noop_dirty_folio);