From patchwork Thu Jul 6 16:38:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13304007 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 B48DFEB64DD for ; Thu, 6 Jul 2023 16:39:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 157388D0002; Thu, 6 Jul 2023 12:39:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E1058D0001; Thu, 6 Jul 2023 12:39:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E742F8D0002; Thu, 6 Jul 2023 12:39:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D1FA48D0001 for ; Thu, 6 Jul 2023 12:39:13 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 8E88A803BB for ; Thu, 6 Jul 2023 16:39:13 +0000 (UTC) X-FDA: 80981746986.30.34C1896 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf09.hostedemail.com (Postfix) with ESMTP id 1FE4C140007 for ; Thu, 6 Jul 2023 16:39:09 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=s9OeMNGO; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=fIIHc9qu; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688661550; 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:in-reply-to:references:references:dkim-signature; bh=La4Z+lKIizNK9+LMU6kCP/9Il0w9pgqeFSQkREsDHrk=; b=0bV8ED9qmXROfoS5GLNP8Z1oMlP9sgzFrD5gYYzK3jdGNTgXzII6SJ84IE12PFt5QObTJV gu3/VHm06iNFIofx/NRQmT3kmE2HdwJH7Qu9vpzahRH2IyBI+kFWF4e7QG2duQB9q2osc4 tOyXtjkp9w7nqPNZD3fArAM9dKQ0oLU= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=s9OeMNGO; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=fIIHc9qu; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1688661550; a=rsa-sha256; cv=pass; b=u/gS0UEriQG4ILmUgdlhkpEqoKp+MA+5czby7ntWoWCqWrZUdWiipqem1VviQaupJeekeP c7kgHJ19Vx/P3OT0qTBnK6a0Zk/sjz3NSlyfEqwfXe4MLWWqeeC/VIFAw6X+RgBVcxAnUa RdIvk/C917iO00AiMgWi/73ob9VbsHg= Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 366FwsIw014172; Thu, 6 Jul 2023 16:39:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=La4Z+lKIizNK9+LMU6kCP/9Il0w9pgqeFSQkREsDHrk=; b=s9OeMNGOdkBzISh76Oc+Qx2yth+NcVeysr9qqQ/28+dXo8Fvio6eVRYiEXBH9Q9F852x 9RK3IoId5453w6poqLYqt/QHFJtefML3NdH4KhorSsCMLsF3HiBEH9d52+Q91g2gfwjK 14HohvwFE1rHUZZNsh44mKp2RsUYVCpiwFFu3iTrC9VyvLrOQYTDhm4LdV9dObn3zrJp s+W5fWqEkL71xd8mvd7tE3rL1xexJQL6TzNtVU7aZzdwjFJqe3N4J6zL77u9n99rdQQg GKxdTyK3OBpm0vbqlMP/PQqpeTyaJDYFZAw7IYLNj1Qh8wRXPlU6ugPk9WvYTTm1Fsd6 ug== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rp0nw03mj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Jul 2023 16:39:00 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 366GYVLg010307; Thu, 6 Jul 2023 16:38:59 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2176.outbound.protection.outlook.com [104.47.56.176]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rjak79pue-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Jul 2023 16:38:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GNkMpMpbsQgomKgO/2T4nfVhJqXN+IVTpA2aelX8rKqPxrn5f1Ptc0+SJ1bqvRsc3idfSJvNk0jZx9fE/gQAWTan/t2uBWwwC21z/Qh5tTpVG0fEgdi2HxCxqd+x2Gm/8ZmPKgh9CwT5CrvVFxJDt5P+7Z3QU+0Y8zEVBMIWPWXCgMsy5RnxQhIa4TOV/iAlXOHVINbLdFPgNLaKUARrCdGbD1JZ/rxqr+cQsWhBMj8TrBpmWLGvdrD3M7rPmsdJyz1TrzUNpRgB4VYcA9QqR0bJUbcJhB0Kk8vVrzBDkb542K/M/3E2RlxB7MXmEk3n7MbB6Gz2dpSI9WbyY/9dHQ== 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=La4Z+lKIizNK9+LMU6kCP/9Il0w9pgqeFSQkREsDHrk=; b=mpeL6WyrQ+5Mbf+qtUXd6AakX2vvyCP1F0viUHatXxbY1hZwlUR1BAqU3vg3ZBNxUnrflDefNq7Jvl+So/8Zn9JXx0QU6Io88rhvqc/tc0Ys2+1QOQcehM48K3RJ3f0VPJDPd664Ta/ghaSUON9lsuYwe6WQixORyIYJRYWBScidUeuuRPd0bc9nganbzlnVEfrhoCHs93cc/cGa6V2GoyzZ7JViT4Wi+4Ck0cLcYrqiJgYGmrmuK+5YhW1R4fCBmvpJAiU1g63zSrVuaPT7eGwiFwHoB1fmpPTa+CS45TELCeV6xNors/wim2H/48UmultmKWpIExvQZZTVOpv+eQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=La4Z+lKIizNK9+LMU6kCP/9Il0w9pgqeFSQkREsDHrk=; b=fIIHc9quLk8cQxTFKlECYBOWG35cK53Z/nfsDk78w7An5hMVloKMkwB8zg8gRStYPr1ryRxtjBac/zRiGmzhtMTW5HnOoTXrv0rHILbJiJtHPaewfohopqtpBaBPW9XHPiBRisAYHn5LOvXWySjs65cIq29pcNBgvJ7RjEKwBsI= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CH0PR10MB4955.namprd10.prod.outlook.com (2603:10b6:610:c2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24; Thu, 6 Jul 2023 16:38:56 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::d9c0:689a:147b:ced5]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::d9c0:689a:147b:ced5%5]) with mapi id 15.20.6565.019; Thu, 6 Jul 2023 16:38:56 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, willy@infradead.org, zhangpeng362@huawei.com, Sidhartha Kumar Subject: [PATCH v3 2/4] mm/memory: convert wp_page_shared() to use folios Date: Thu, 6 Jul 2023 09:38:45 -0700 Message-ID: <20230706163847.403202-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230706163847.403202-1-sidhartha.kumar@oracle.com> References: <20230706163847.403202-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR06CA0024.namprd06.prod.outlook.com (2603:10b6:a03:d4::37) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CH0PR10MB4955:EE_ X-MS-Office365-Filtering-Correlation-Id: a6c958b8-95db-496e-3a57-08db7e3f7dbb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PpUh+5NdLaHK1h4YNoseqVi2fYwg3kLiaL1X7t7V1uwzNvBqzOtOyWzGrnwTZQd88L8dx8pSOU2K5w2znep+77xK37nO/Qu+VUuzhwJvKWsVsrqYktLkZDVSogEX6g3TqcssxNb6H4igO8RA14StX/a6MlpT5okG2dr/2ZkogFp2uT+8xze7RK9qAzwFX2/cdwsIrzLkuINjp7qZIr3P/Y5gvRfY123DmmzQM4BqhpDEYZKbB7nkBLwAjJfctVFn/a+mCDpfPczu+F6h0vp+hQQeGkpmPQ0kpJWorinUW50hW7EX8/S8CbEMhrH8cVG8qyiIqYaPKIMDpdg4lOd/gKWWEx8ht1PBhBBSO5c9IPtbpv6qpkEjlymOGHSLF4vG+ki8Ea51ElvGwiFVL11HAgZjVFOu6acY9jcGw3zNnjWAST4WYmvBa78jNqgPOOA4W5AxNTrzVQc7jLPSCt30KeTOU/uFGyoMx0mxryGVmI7VSvaLetyfd5mtbCFG53MSQfq3nxfCuCY+Qlh00yGavcf/1gTM8fSIWUABxIdd6bPgNgyWQgrSCX+8RAa+Q88k X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(39860400002)(396003)(346002)(376002)(366004)(451199021)(5660300002)(44832011)(66476007)(66556008)(66946007)(38100700002)(4326008)(41300700001)(8936002)(316002)(8676002)(86362001)(36756003)(2906002)(6666004)(6486002)(83380400001)(107886003)(6506007)(1076003)(186003)(6512007)(2616005)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2F3/QA9OUtXUXpl2Pv+chwn+CX4Md4nuTp2oTiilfIfBuwe60uwOu8EOn8++zNgi5b8pe6pEpfu7f6RB/2X74/rv4/ZksEOeApjRhIVtJjL/WpF7as3gvR7z1/DOVlXKYdjJVZKB7WQT0Z5PtSgSKUHZCv0A8hfDPPcYHaID8z2Jzy+mx+lS6qDBBT94fT80mBrOg8Jo6gln8cFn6COPawD8qLBJoodyLg16bxWhpRLWAW1Xglw47Pc0aQWrgz+/Z6cwnBVWcQV+1yHVB0sHjKu3zNKfVf8T2Zpd2fxCFLfqj2OeYsrwdQz/pWeT4X1X+7O/9AwPE4fA3+eonXaeRjJO1+i/ViSwQR8RGNvJry6ehpEUYcmUJOtOEgpXMi0FAvi8giJpnQU4CEV7bb04xyPqCi6cRhDt4mp80Jx+5VtE5YzGZaWUlWNxiVObdLHshkC/5i12dCLQTWvVG8nG0mdIWPXX/PT65Qq5KLMF+xpjaBRCF5RqK1ScywVVavAPZAbk0PaMaceLnkukgaQfbyQP9Tsg5pMofRafVvlMeRoISqzG3imVlNZ/eubEqQAvnUf4+PKg9xs5rzjNqoBiBjpSTo/JYnQ7/LXqZ5tU+nDcC8P+skB4YD5JzMd3cIjUuxn/zWWO1dj9uwgsee0BgstZCRnBUqkiKMo6mFpoIJwpQMbWJxl6+IXJfSdAg5bmMEq13tfLqRNe7ohfuvom9WkFMALJyTnHYIS5Kdx7NNdjCQJGrZkeL/kv3Uba9LLm/MzwqI9jncQ52oJQtg3uSXBsHMM3KfRCp4eYWq9RncHTt64JrQs9+T6/QxVPHqQ8L9Mo4BQHI4lOI/fVVp12dm4ymsCfC9zStgKJoB2tb+O7QFKst+Slrvo6zmk9fXpP/Y5MSMgdJTxD/8OViYc617QTu8i0+cFSfCGxjJUKiOEEAbEgj+HMNEwwYcuLWXaUwnuoOIhC/igzM4liEvr54UCsikwnGOE7RXNrVS0AHlBaoyGGVAZNTPCK6bD9DN+kx4HLXEk77obhPUfC4bOxZP6e+3nodFIXixIovp/Pz//sBcMgR2TvlTWegsvl0udsJXIVVyr2cLOnSY6jGtA2zsQL3Uj7PScKThJGCAUwkI5lMH9WpPwAuEhLrTU/3mpqsdnDwOfX88SqsLw1ouUV/QE3uogCfgmPbA7o3q1bX04e0Sg6g6tqnQZH4xOP+ad/BKYnUJpmgUMEXMqHNRL9+ToI3hDT9VX1kw8NvyYMehu+c8l975H41DBQC/7cm15OXVBwjQuGh1pws+PaRkNTLpjmWuGFg4KUE9lfVSlGo8hjTCKE2tr7djsXdVyZ8YZvJkzRDGfpesqcvvM7BHOGG3i3LD1S9H9nqxQki2b58KvQhjD1VEmDdbgUnHPI8Hih95BHrU5+MzUxacN5tNMizMJ2QCa8pLM204/dpiLX0SuI07umQXlcfXhjeTVQBkv32SkLKWERQSL9kSEXaElzW3qJP6cuo/hQtCxWKpo3zh9TphXMexC0Zd5pCanx4BizBdp0nqvuq2nSOPGaDPZclgSeZbnrQF3wrVUnFoKyKcUS1C0WJljw636ULc+DZlH230Zq2ar5uITdwWYK6W1f9mxDWLi4cTUVkvX8e+aasTY= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: gltjr4x/81QellTs1z9Rz8yOfu0+8R1BOp4UDQw1W8hzZkZSe/9oUP33duSsbL2Oqft+SLG4cPgOod5nQD/KINvlYzi+BcrvQYnVHmVKMq03W51PHCvax9At1oEF/iNTgNCbqqbOTl6awrgN/FiPa9UOif6NP+SNOWDEqF7bwYV9wKf+g7vz9gv64qg2FqDZfahnM+vdC/cb9+QNaLYG+uHamKVuFpB993jIRiOuxQxmk5nGYXBenlMQcjHJdqsWB25rok07EboAFfwuy81ZOaRZHHeOynKj9YH1hUKGKhaE6z4fD2r82Ob/3rcy16073xV76REq4aidDrxSzBXCaZGXTCFdxTX64zAhL182YZ+uRIm+3wfW5S57GbrsOwGFYH0EjITL5HRYO/2P9WpNw+30BibYoL1h+IlM3fcz6Uibcl5EcuMpd5IvJ5IuaAn5WKJij0LF4y0F/gUY6vEEs2pFPrAy+3f07m2deoSo6EzzmdDH9RUi2G090gMxdHxSpnmuPa5yXHOp7AQgq+qFMgO8pHQktBNyEdJoyGAELnG0NukU+3cUd0VUBuPoLPkaQZk6CAVBofE6cyjVjrVJeOU2bw96wpNhM56sPZzoLFLPxUauU6vYHtBmpR4mKF8Mn3HuI3B1q6Cv9Au/EZfR9slUEEfh2+l7/x1oJuBKWxMzvf21Ej9yvvfn5w5FODvTHfaNkMxGJcJ0foPWKcOyFBgex4xlM0cFibn4jfdqUgmLQln7/QsIMqFACB+ZBOXoCl6P0jxQAqgQHki66Bf1jHJi792yXKVmspXB6L/E3n1y02J+1FRBn5PKqmj5srseroZoZGx7uGYsRkjqcTu5UNbRaWFLn907plg9jtobweqrUcOAittzjStqyqTeT56Z/iIf25bjkKuzy9cXKbPIBg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6c958b8-95db-496e-3a57-08db7e3f7dbb X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 16:38:56.2418 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tU+iqB6ttr43aJwO0j5V47jbr6nZx+G2ODcK3rgl3qaGHHXEkQlP/YXw6Mm7oQKNKQ4/OxHKoc2W2kXzI5SuHUwLbIa7Yid2UJklzbmuH0E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB4955 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-06_11,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 spamscore=0 mlxscore=0 adultscore=0 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307060150 X-Proofpoint-ORIG-GUID: 6rnXGtSvtB2SHbdrWX9tGa16FLQlmblg X-Proofpoint-GUID: 6rnXGtSvtB2SHbdrWX9tGa16FLQlmblg X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 1FE4C140007 X-Stat-Signature: bmrxuf1d8hktyd6aezzoj54qf6gtyked X-HE-Tag: 1688661549-438689 X-HE-Meta: U2FsdGVkX19tQK+7sao/eJ+H5Fjo+Cc6A0bdVgH6bG+03B2be2SHqnjagH+VlOBhafkZb57YWAupCbMxXk64d4bwgaRdISlLaJ30SOtvvDGTwx73fnq0Ow8of9ebLt3kuFpxWIL4psGo7eMb9u1tfhYNelvVp5snEV5vcuc8Hfj8Orzdr1FN/nJ/nqeBONf3rXIrIDcnidnd35l2uuD4lRn3asQg2N5ivhym8SsjziBusQDNWs8fq3gjGNi6LvB5H4rgwG3a09fCbagdiqk7a4N++RsRSUrP4Z8vJgvtCiqZKtDS4eDlwmauLLTah+7xte8NbSDwEvTDXG5s311CK4qkGiDpZ6/0QyvtorvGNfG8Fru48q7GKMHIFLJkiYDTmGyLXZaCbcAPSMqn9+h0Ct8RIRzRE7WtLlWvcdEKTsrbEkWEiZ0ea5USIQtQmkCYsu/qRQLNeYmItgIZ3Sx/9hgNqE3yqB4nzdT0bMkxSvU0veXHLHu+ioy85EeYzi9rGK05LYigyiY9L/naurK7e/W6WkESNV+/hyltTbhv1HmkucKSJgFrnczKUn5XzRCy518Xaji9J2EQuFQg/JwqP1vH/6ojYjtr2U4uSZspjSno0YvE/e8xWciedyvMng8iczvSobJWwUmBBWSy1nYkNb9KYYVTqIPY+ViN7a3AwIhWhJlVjcW/Lm/x8+kg9Mv61FCMdQfLsbxZFc2/j6lNAfxZ90ika3jQFscxDG0Ta3lgGoezmZU23nRRUMSOq20XifMsWLkpEuMD2/GYRUtlnanSQBGe8T+y244bGCOz++pXQ3Bkh+6ml90Ne3DtKwwP0TML+DPFAIj6sXRkH7ocBnV9jTRVWmW0xlc5F7pZZRJdwexB7OxFapbFsfGFOu1oxuS59ECqp10M2Oj233q4o5+A5oeEfAzZ4uBU1OgvYUe4V2GJwYsV6wwEgIoD5a2MslpjvlqYRfxuOa/YCbL GJXwzKMT 5XyqdTGuQMCqrZZkRQ0iBcS/oT4LdOiAadjkYaSattpx7ve8mPpnobL63CngzpDH63o7RMYltk0p14cgJrfFZ0KdLB9bQP+zSIRsgNmXVfNS9Kp5tL9HDQnc6ixQhqKDEishnZVi+xEOhVeysAJ9nuYnPf6geyXRU2gYEYyM0n+VPqnsOKucZEq/MsaT4dlbeh3HR7DiA5dW5nALViOjyCCYKpWsyuMEBAK1q2UYM3PQDAjqKs0F+88uFQoj3LK3815yXXTWt51ksthA5sOYwmA2gcbBBVXXNYheAm5gMXGeXvnmlX4YgoQP6bIqp0Xwr3b1yhiMxmrAqeZUEWv1NLyP9LzBAOm3lZnYo4y60YFuGR/ZVg2dKQpWSzU2xtiqz+d1pXUgX6ykWkr9gB056UDhfUc1n7i3kzK3SoqF5674/94c= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Saves six implicit calls to compound_head(). Signed-off-by: Sidhartha Kumar Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: ZhangPeng --- v3: - remove extra page_folio() by moving up folio initialization v2: - change function definition to pass in a folio mm/memory.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 1736a130fa829..673b9fa67d0d7 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3285,13 +3285,13 @@ static vm_fault_t wp_pfn_shared(struct vm_fault *vmf) return 0; } -static vm_fault_t wp_page_shared(struct vm_fault *vmf) +static vm_fault_t wp_page_shared(struct vm_fault *vmf, struct folio *folio) __releases(vmf->ptl) { struct vm_area_struct *vma = vmf->vma; vm_fault_t ret = 0; - get_page(vmf->page); + folio_get(folio); if (vma->vm_ops && vma->vm_ops->page_mkwrite) { vm_fault_t tmp; @@ -3300,21 +3300,21 @@ static vm_fault_t wp_page_shared(struct vm_fault *vmf) tmp = do_page_mkwrite(vmf); if (unlikely(!tmp || (tmp & (VM_FAULT_ERROR | VM_FAULT_NOPAGE)))) { - put_page(vmf->page); + folio_put(folio); return tmp; } tmp = finish_mkwrite_fault(vmf); if (unlikely(tmp & (VM_FAULT_ERROR | VM_FAULT_NOPAGE))) { - unlock_page(vmf->page); - put_page(vmf->page); + folio_unlock(folio); + folio_put(folio); return tmp; } } else { wp_page_reuse(vmf); - lock_page(vmf->page); + folio_lock(folio); } ret |= fault_dirty_shared_page(vmf); - put_page(vmf->page); + folio_put(folio); return ret; } @@ -3365,6 +3365,9 @@ static vm_fault_t do_wp_page(struct vm_fault *vmf) vmf->page = vm_normal_page(vma, vmf->address, vmf->orig_pte); + if (vmf->page) + folio = page_folio(vmf->page); + /* * Shared mapping: we are guaranteed to have VM_WRITE and * FAULT_FLAG_WRITE set at this point. @@ -3379,12 +3382,9 @@ static vm_fault_t do_wp_page(struct vm_fault *vmf) */ if (!vmf->page) return wp_pfn_shared(vmf); - return wp_page_shared(vmf); + return wp_page_shared(vmf, folio); } - if (vmf->page) - folio = page_folio(vmf->page); - /* * Private mapping: create an exclusive anonymous page copy if reuse * is impossible. We might miss VM_WRITE for FOLL_FORCE handling.