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: 13798624 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2083.outbound.protection.outlook.com [40.107.215.83]) (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 0A8B7197A9F; Tue, 10 Sep 2024 14:40:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725979203; cv=fail; b=YgjPtbDQ3ErTmzeP3tXDAEjY4CDgQqRoyxEiVBrRoaL+EcLgJeVSAmGF+q2CU6joESlRzj1EUPHeTVrjnEVwjEsTu46H3ShFdq1l0H89hVZql3epf5dFgRAaIdW/fIDUweBDMTUm6mogKMCWs44lKaBNqgF/mQP8Cr6QScZRRaY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725979203; c=relaxed/simple; bh=eQfBWRnpoa96UL/4xVMrGHPlGQ9e7BgCWan4GOMjKGg=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=SwSoONwzeTIe4mCEGGkwtDEqbTvGr4pgI/F1LDr9S7NUf0ijvgGhSd2e0VZFZahfQRmo51ByfFrzTpbTdfQDEpNJwNEdrEUKzJjgBbfOD2l+pCuZiAZwbngGIc1PYFzEyf+HZPLO2t11TmKUsaGfNm2luUYpx4r7ZmKev4mIgM0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com; spf=pass smtp.mailfrom=vivo.com; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b=U8vDYEu4; arc=fail smtp.client-ip=40.107.215.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="U8vDYEu4" 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== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; 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) Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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);D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/ej02z64M5akeymWT3TaJJnoQgjL7Ih0pXOlDpq1K4UiWCBypP13iKAV7nR/ON7KdJzsso6Q8LW6b1GM7LLv/Lr8McbsplAVY4bjYgXW2hj7AYtZZz+xQOeUPDnGv7M6pL5itZP2TTyMbuw3hJMnFmdOelOlpML1SE7Ft9aho0bHzGnUo8D45rtCdhD/EHidg+WOacHBHeLRRm+IJsEALxxRpOfYbukYtsy3nBfgyW4MA83odcjBXAJudTsFbFDoVoX08YiLva5PdmmMjFCQtb2Qa+vT5GuBlstQpRsIEbfNmigRWTeh4S6JKuW1k7LOEIx4yOVsDEeYkz5IF3kQKbyIV4cK01Rq0xtMub0UDVAotDIMHZtZNR8JMeqzlSpJy6MmT8ch8k1x3hBdlGbNRvubXJuFnNx3O4q837pqOW4paeae+pg8Trsn9/X8I7qAtOWIcRuWTse+Xqg5aWHPbc8OSijLlFm1eDWZ1AToLFOBYhlVY7hppN4sqZKwdXllWeG+/PA8Um6kCL8nWXRSwaGhUnpedQBcK3P/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 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);