From patchwork Mon Jul 3 05:58:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 115191 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp311357vqx; Sun, 2 Jul 2023 23:07:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlGQwiZsmTTzBRs2fS8Z1Vjri5YWPkmZineNyKNDXoeH/QzsG5Wx8I2sWxikubC0O+87YZrz X-Received: by 2002:a05:6870:b628:b0:1a7:f79c:2fbc with SMTP id cm40-20020a056870b62800b001a7f79c2fbcmr7142977oab.0.1688364436586; Sun, 02 Jul 2023 23:07:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688364436; cv=pass; d=google.com; s=arc-20160816; b=exyYV55hldNLMAC04agPaoNqowCODORv+UADIa2i7ubGM3CeiHGVuTNJ2EuPr01ozf li0fMZAhBk4Bm04KEKn73GhwAFgLEA++Mg1Cpmr12bKHUsmH7HLh/Z7HDd0P9y+zOUao ZorqhnGE22YQR5tNsyA8glk3uryF1mLzxmrYjDhv82d7ssJAY76naUKPd3bZys+dpYWG yIdvt6EYO2TdQg2l0lmAA6mdpIkUPY0twyaWy+znIc7eI9YDRFpW+1/vA8PfioM+WKI6 cUq8R+nVk/KroGTJYTFpdM/jNqqJkNdV3E9tIcXFo+5YMeYXZxvtDAQcFtwXWFv4Tdv6 AYWw== 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:dkim-signature; bh=dj7z8RUuHw0Qg+MY1bCofYDUKBCxdrPRgu++XFuJR3I=; fh=/9bfJsMG+/3rgG7nJ9LKdUdSJTmdx8OfkQbVdkOHqG4=; b=xU2RIQgjR/gYxxSBlieFD4XciETlmmbhNWfoMjeG+Zg9q0N68eSrvkEyoK14gEcobG pnCEkaqUOGpeWWCfBm8X4jPY1RIYfrvkRwEEtsYBb1dsSYAyOFy2U47rhvkpafMEq01J YmbowFhr5eHhafQ0uVmuNRiGB3OVWtu8LMmM7L2Hplsig65QvtbetiQ066acIGimt0U/ Tiu2Pw1TpBbhBasf2nyuBg29+9KjsW/xvFCxEDhfdWdMRdmKWY8Irm51ZR1wh5K5xLh7 caXqbnlhQ5SGNGAPuCLuK0pnJ0lDb/Lc6LPtzzX0QQM+cS5oy2fgSS0VROUoU+L0pU4P AYyg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=MhPpRbIN; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=g+PAyDEL; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv128-20020a632e86000000b005579bf98c6csi16102678pgb.157.2023.07.02.23.07.01; Sun, 02 Jul 2023 23:07:16 -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=@oracle.com header.s=corp-2023-03-30 header.b=MhPpRbIN; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=g+PAyDEL; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229844AbjGCF7O (ORCPT + 99 others); Mon, 3 Jul 2023 01:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjGCF7M (ORCPT ); Mon, 3 Jul 2023 01:59:12 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC729B6 for ; Sun, 2 Jul 2023 22:59:10 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 362Mwqrx014049; Mon, 3 Jul 2023 05:58:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=dj7z8RUuHw0Qg+MY1bCofYDUKBCxdrPRgu++XFuJR3I=; b=MhPpRbINaJ9TmXtJ6o41qWPmQAZFRicSmIi2dIKjHVh9wnc6t9NKXLmKc947C8CNg3aH jst1yNbGRRXHcliZld/WlstI/k3E7YLkUQtVSc5Fx82pwqjX8gM1PAORdgBBiR1ZJwCI 9kT/Jf4TXd/Bh5Fnf1tj6bVmKrmW4reOzOkNnnkXZhNtn4lOiiZQFLihE2pBnXkFwZRZ 0ZkBPVzQ3fiIftHsd3CY6e+0dypxINOQD14ZYBToFGNVKJ7aLyOFBJRGYtKNbi1UpoI4 YPsoXzPV/Ha+LvjjawpQouEbinEhqkWiNKrWiScjUYafgxOfddPvqjX9CLpujleVnvaj zQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rjc1ahtby-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:58:59 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36344iLj010994; Mon, 3 Jul 2023 05:58:58 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rjak2v13x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:58:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FuoLBZ8qxgvPRdfi3+/r2WNbrD5NdHS6tyD+vcJgp28ne8WxqxUMtq1nuyILsNKM4Imly6D0aUdK82Ee6JmMM/9yalO/qQ5IF4JqtT5PAWZQR69Zc1WW+sOWc1csq7qs7jCGo/UmMslt4ABnQTCzShUlBaMekWpt/7Rn1XvD48B+psA3Uvj7qbgckkO/iOYoqQJfGI5wRtqkjFggHV+vLzXI9trMuQNBsziAmQ1hSt6h3iQICuUvvJ+0tpgelO7z4yJtR+a4VsW5UqXsdFyTFnfg9/vtCrSdzoYkYenSjPh6kXi7N1HQA3wBv5LhI+oLJTdEf29mISoh9hSvSyFWBw== 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=dj7z8RUuHw0Qg+MY1bCofYDUKBCxdrPRgu++XFuJR3I=; b=FlsN72vwvZEIOt0WHk26DUiupGLl458x9ykeOqROaYQbkm4sJufXyh/Mv/jcaMktKeBThomCnm/MdB6rGCwttQoDlk04+NcqErzakbnX9ClveWnhmtvE0xV6BddiZOv3p8ZCAkng0Y28ZnjTmwXDOMo+Cao3Rtk/Y1x3ghdl8Z/S5K/g1Y6DEgeATCccn09n5zEYVMiEM73iMdiJ4nu9zLlpUF3Nc+dNZ78UVPY2BALXtj85gMMYMKoKNid0dUFsG2MJWXUU7RdrvbzrSNorTF3i4fyCfu+PMxSjjqYN9cmNRIHjaGVFyHK15bvGV3WxftO5tOxXLh9AZEYXrkhmsA== 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=dj7z8RUuHw0Qg+MY1bCofYDUKBCxdrPRgu++XFuJR3I=; b=g+PAyDELt3X9gzOVzeg+0ZIUB8R3xMLEFYu56QO65tvbtLllVVBl4c+/vPptKgkTBd2t80pVQQc2+TX2I7JpNvq9Nt2+geGfZ4aFoyn6WXZZuKfOfXevnLEYVATjkgJeoG8TGkG/M0SiPcZ3DoHWcpAHyZEjdKmmmQ9CvURfkgA= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by DS7PR10MB5085.namprd10.prod.outlook.com (2603:10b6:5:38c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 05:58: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.6544.024; Mon, 3 Jul 2023 05:58:56 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 1/4] mm/memory: convert do_page_mkwrite() to use folios Date: Sun, 2 Jul 2023 22:58:47 -0700 Message-ID: <20230703055850.227169-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 X-ClientProxiedBy: BYAPR11CA0042.namprd11.prod.outlook.com (2603:10b6:a03:80::19) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|DS7PR10MB5085:EE_ X-MS-Office365-Filtering-Correlation-Id: 0806d1e2-a03a-4b25-d3a5-08db7b8a966c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xvDcWnOXh1p8FMhcwGxI1wJD4C+VBQSTxGz2Uv2TCFmPrzye7NsXDuLvglg9/nnzstylSdn7Js+ea0hPxRV+iG3ogqyYuWGilTEgRNy347AGWAkYnH0Qm/J7EAiVh2768TSC849p81QEQlogyhZ6xwM8P1OIra+9pP77y9jDONJc6Z1q0/oVmuZmPPL3pIB3hPd37QvwhTxuTD1O0jftlpdSqrjjk9rcoy3FyCnmFqI7/arJETmv5iQYSZSRE/C7r2n9fBeFyOBN4Gjx/2Aocc61I0RBCi2XgwmoGonDX64N8vJJJbcMgSlm+nMgDzk1WWSkHanmersLuo9+ahSp6X5oUg8+iHm8dcjb6WuinQ3IWlc2Qc/p62eyDvIEGPpEtKpZNNpFs+//SFqiZtkKoIEVggA59XLBZ3asfjpd/od32tasDbvCVmHKfWwFJ7t/2IwkKa0mqYNjhyj/cFsywrWRLJgcFXoQ8Ro7CefiAY5r3vvO3hkgePEDlOSn0VAlEiVzm2mpagg8441ocbNDBp7wqF0sSZIMDT6/Fya4kM24zGt/7oNFMv7HiB5hXZe3 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)(376002)(366004)(346002)(39860400002)(396003)(451199021)(1076003)(6506007)(66556008)(66476007)(4326008)(66946007)(478600001)(41300700001)(107886003)(38100700002)(316002)(2616005)(83380400001)(186003)(6512007)(44832011)(8936002)(2906002)(5660300002)(6486002)(36756003)(86362001)(6666004)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ip3V9nchQcJYodQs28kJxmeq2kNv5YJP0uLX6F3g294oWESCA+oZTo7/kxgYIZlbBEHK3nSP8BA4Z0Z0FRGbYWfIlRSWbYYNx0wyTpFimFzUCMn4e7voDYP7ImRMEhu/uiQ2LsKKXWiRhJ4lonwgOmqLZe/TkFUzWKFeOBXULOyKm9GLFApKuZanUqcMs7yVfXZbIJhFpYkW2JKaQRHB0ItaXkviGVxuo7t3NeD3rK9LM9cjB1kkUdJpPCWePBBZcuS9ln8Nz38c0pUOJB5fZ/ELby/mOr4kMCT8wOt7ybSedKBwfy4uZq+kelfcS5+GstIz4PACxdzNWU/6C0DLYvGUzw72GT8AckLaYDHiFX+IoaOEUYTGzXEQyW5HMUQyMUwqxelA996vFChZrEKEKRFDyZKzAQyqINWcGNjJVn4MB301lVPbI0GdlvuDezfDxYb8zf8t8n5FySKSnd1o8lTYGkF/a0Me0wqQG5niRCGK7u3JleT66FeolJ+kvNEh9qOBF4VkSxOUOg90xrxCuRsEudMkxz7SPF3ijZWvzVv+aFWm/RGarlQcfgVe/xsx1BBgUfCfU8nq4PLOBYa9jINdKgabxKrcnvSvFsjoJr71InQqtU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op-MessageData-0: V+B+A/SvDP97laGvgglBSgZZk322Ma+18sTDIAQnAlH6kUMPQ1N8oyE9mAJHurNuS2gcQ+qDyBIjno4J2tIVo7SdAtEXlOVBCB4AiZizk6NzunSBrU49e/MNI0UWyVLyG/sPLgcvxCDfkpCFQbiI32emqxi6t/IfSZQIryf/T/d/RVJ6Rz4QNbt9ubKX0OCQGOK3xl0B7cLhYDy2RmDOHL+7rJhxA6DPzv5Ii/vLzt4NTlBaN0kdD0CTDz2pYBsoTlLBSPck6Msz7HlS2Dtd6il32kbazepY0m2YGtYrEotCdIOzhQmcE4po8iSW7KU87PXtb6Aro6iul9kQzSilVEQLew4sm4I7RfV24gINhxgXWpUU63X5QV7G/E8YHhNHY31pNo/nG26yV4238Foz64s0hgbY94ay/lt9mB7LEa8kKzWRVwUGsnwCAEmdFe76gkW+m82MSyRdrIw53XgKmyBB+TG15/0536ODMfouNHeZTxYt7FI0rWyXf38e34kq/xDu8TA20Wu5yQiY0hfxaRUzaIMFkmmrEhnQskCWEYsv6kGiDzFYBChX5Par549Pk8tQpGRj65qpC0PpfEs1xQsgrgFRB10tqhBWPWftQwG2OHLqpkUYTYM5a5Pd0QFuoWL4UzJSxMLqXjibB1gVB/m5BISpUoRJFmTqfHPj9zLL6bhJAGsZdqjRqnNlt4Eqa5Z252Y1310bwF6y6GNm2IYhIUTLs50+k0y7X9DUeEt0oDI95zx2ie4nB1t6m9Utdw6n6wpZ6dh4QFhOFe2Hf7cOghTCm8O+tsd5qi+bYmYnk6BslznNwGnKxsoBlJAM2ElasM96V8qrZGACAoMlFpVjSTz9WVmx4afUyB/9bMwgpsTHWqrrvVfpW+7UsIsj X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0806d1e2-a03a-4b25-d3a5-08db7b8a966c X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 05:58:56.3959 (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: fIG3u5hMag6kaNhwmv0/jcVz+jwMHSX15nC+80iaywgD6GuQIq7Usj1j3cWnfwr1GVRkYAtdwshJ6mlDrL+QCePnq03MLNPanKC6I/e4T4M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5085 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-03_04,2023-06-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307030056 X-Proofpoint-GUID: YYiuVSLmrAngyqz1jYO00p0EnQzdi3ia X-Proofpoint-ORIG-GUID: YYiuVSLmrAngyqz1jYO00p0EnQzdi3ia X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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?1770378427498469043?= X-GMAIL-MSGID: =?utf-8?q?1770378427498469043?= Saves one implicit call to compound_head(); Signed-off-by: Sidhartha Kumar --- mm/memory.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 21fab27272092..098fac2f5efc0 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2932,7 +2932,7 @@ static gfp_t __get_fault_gfp_mask(struct vm_area_struct *vma) static vm_fault_t do_page_mkwrite(struct vm_fault *vmf) { vm_fault_t ret; - struct page *page = vmf->page; + struct folio *folio = page_folio(vmf->page); unsigned int old_flags = vmf->flags; vmf->flags = FAULT_FLAG_WRITE|FAULT_FLAG_MKWRITE; @@ -2947,14 +2947,14 @@ static vm_fault_t do_page_mkwrite(struct vm_fault *vmf) if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE))) return ret; if (unlikely(!(ret & VM_FAULT_LOCKED))) { - lock_page(page); - if (!page->mapping) { - unlock_page(page); + folio_lock(folio); + if (!folio_mapping(folio)) { + folio_unlock(folio); return 0; /* retry */ } ret |= VM_FAULT_LOCKED; } else - VM_BUG_ON_PAGE(!PageLocked(page), page); + VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio); return ret; } From patchwork Mon Jul 3 05:58:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 115194 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp315359vqx; Sun, 2 Jul 2023 23:16:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlE7bzW21Zb9t8ijt8l/NAf+VkLt1D3JQmlfX8bNiM4GCFM8Y0hK0yHHKjBlU4Rmy1JstFjv X-Received: by 2002:a05:6a00:8016:b0:677:3439:874a with SMTP id eg22-20020a056a00801600b006773439874amr10867632pfb.3.1688365018024; Sun, 02 Jul 2023 23:16:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688365018; cv=pass; d=google.com; s=arc-20160816; b=KqzyqVa0Yi0zw8O3pqjFih9oaEdXu3+hMRF77Q8dTfzMTDqaLdyjhzwSBs144cC1lc imJ0JV9FblQCJ1LVWU8ZIGm+9Xg/pkFOyboJFkgU2005GSWVjg3MygzjgnuxdM0dUZvz q3iN2jVpEDjs4GwYYEGWSeemhQu0wSkiTLVo8e7MaAB2IaqHJfAJ9DaXVteqLql5eumQ IUBUr3Vq08VHa5J2oJ73MFn1zft47ke92XhAz/TmCkOBxbi8cA8akr5lIw6GXkXCRJmq xwov5zRfFJ6wQIFY3D0vheiMrsv/QR2UN38NM29IjTrm2eZaaQKs7Sw5GRK7QQ72xgwx Zq5A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=bMN5wxrHdDVf4pWWBhvN1nIvgXVXW5I+t9zbWvnRgtg=; fh=/9bfJsMG+/3rgG7nJ9LKdUdSJTmdx8OfkQbVdkOHqG4=; b=go3oi+SHbCamEGWfCVjaxN3/b9G/q3MCueYwKDfJOwaEtM/ia/vSbkWZ3X5qeJ6b63 4FIV1pqtsHba1LdfA0sPJC+Qx0LBB67+yCdylzyI1RHLiU2FY/PzztZyC2b7XNjLPGc0 XAA2rovuX1PnacELrkRgbIgIv3TGzLO+cpVJHwzzrcFRo8ZIfi3kbwamPFI0ITqRpS3/ zQIGDYRipu9IYPUquPDFbLYaGLg3h0FyCGZzDdPsHvS/Bl4WrGbQhS+IEaqxf8IFjI6f hVKDyOWkPB85mN6YkDdNupKxKUhFuhb6WSeWSEBjbvjhvaZVn78GXtmdMDb/RaeuP9wm 7VJw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=bDu6Z0zn; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=XpaYXvx4; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fb22-20020a056a002d9600b0067af445c0f0si13788940pfb.291.2023.07.02.23.16.45; Sun, 02 Jul 2023 23:16:58 -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=@oracle.com header.s=corp-2023-03-30 header.b=bDu6Z0zn; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=XpaYXvx4; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229899AbjGCF7Q (ORCPT + 99 others); Mon, 3 Jul 2023 01:59:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbjGCF7M (ORCPT ); Mon, 3 Jul 2023 01:59:12 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BB91BC for ; Sun, 2 Jul 2023 22:59:12 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 362MW8di027336; Mon, 3 Jul 2023 05:59:05 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=bMN5wxrHdDVf4pWWBhvN1nIvgXVXW5I+t9zbWvnRgtg=; b=bDu6Z0zn8qpX9Vc3p/R2eN+c1Zrx13TQPrD+A/DGnKDaf4vX2lUw1FNrsZRLSDdmV92d Ik05U/QuXfXQvMmG9oX6QNaLXJBmDHXCOt4t3CjnJFrjWEFhkigYJ8x8aGReO+MD52we i0L87yjvrfWkY5//CQa9yT6vKdFYzVLD8VhomQMJ62HmSogEVwoI65YhUIOB+uQt5Uk+ LZbRkHoA21h0rVlaSqGtGw/0Hw4mdiiQe3gEmXeGjB0fdaivreHPdOPJMvt4/h/ILqf5 EUboNdhHpqtug/O+YKnDqVubFbEjoiwWUhppRdHHehk4PxGTbPxoelN1Rn3BwT9wr85B ow== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rjcpu9ssb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:59:05 +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 3633xh1p039614; Mon, 3 Jul 2023 05:59:04 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rjak2kv7c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:59:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cdQ76AFjUgXUSkWNYcfQswr//rV4CnZY/Sf57HXHxxgkkqL/dzQTOaG5P8g5u1yaPOAlCzmaK/2f/rtA6XRFIj5OQ8yUTe/0AFryaCxQw/DvSyT3w54Pq85uJ4LK/0lGnvBm9AJo47m92+NNCFQlTLx5RYdB94YvzfRJnB7fpXSV/oR/iNpDBmg2SjRRzjNq2V/E83FSA7K80PQDzGK4iqt/F6KZx36s8ES/MkulBC95xCYBGxmW6eNm8t5LFcnM4uyYizZH0ckoAoe6+VR1Xuq4g7vf9koh6r3oxKj3kxBxDMuIDyLO9LSOnpxkg2aUXqR1Fa6E94KgparQ3YdCBw== 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=bMN5wxrHdDVf4pWWBhvN1nIvgXVXW5I+t9zbWvnRgtg=; b=Y87FZubXHC3mO4OxC1j5BNvtaWQtnj+6EXKj7DcbB9rR7iCwIHIhrj/Jfdb7UavWw1HqZ1+O0Icpf8C8oY1JQDtHCdO71gbUuQPIx7L8occ5dL1UVI9l2N0ahSfY9LUztZrycZzU+GRvA/jX64U46j96FttceKwJFRb/1Y6cU5/JEzJq04rqklmjUtv5I73OQGX4tb7wPYvDoRFE61cAhs8Gdc6I3e9PAtAECpaki9kvIhB8Wmzj6uvTpaOdTKxF4ZuP2N7zMJNG+/qGhQuYPNqgabunhIlF17au7qR6vBsSeYtypaLcp6K9Sg2vPxu9ZtFfo5SyvK+eEmxAmuNyUw== 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=bMN5wxrHdDVf4pWWBhvN1nIvgXVXW5I+t9zbWvnRgtg=; b=XpaYXvx4qrvBM1fQeD7m/W7g9s4kuv/yp6IySf2AH1mJfEqForhA01sBvKGhwHC6ek4xmrttmo5eWTZMbE8tHjz03QiClrixG+Th4sDIllyvf7VejE3rQjDjfXg8Ep8HZLmNWW/6eLoJbM/v/TRkRa7TLSYQqgkccjakurzUITU= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA2PR10MB4697.namprd10.prod.outlook.com (2603:10b6:806:112::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 05:59:02 +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.6544.024; Mon, 3 Jul 2023 05:59:01 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 2/4] mm/memory: convert wp_page_shared() to use folios Date: Sun, 2 Jul 2023 22:58:48 -0700 Message-ID: <20230703055850.227169-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230703055850.227169-1-sidhartha.kumar@oracle.com> References: <20230703055850.227169-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BY3PR03CA0002.namprd03.prod.outlook.com (2603:10b6:a03:39a::7) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA2PR10MB4697:EE_ X-MS-Office365-Filtering-Correlation-Id: b95c54a4-6470-4175-9d22-08db7b8a9986 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kj35FeXl8YgzuILauz5aoZbt7w9KZYeJak0VmW9JcF1EfUccAaJeet4ZgWKdrwXqDiXx0F7awSmiHGx4kbuSuDr/s/lfgON8/G8oqPx4En0ctrg4h6zorD95iGONkCVfiOyyEkC5XpNR7xtcgta1BU5w1DU54/Cq052WcCOPFa5fAwx3+PGO0eUn+0x2vp8oHa00LZi3VlFOadnOGABGv/6uiAVKdkE86Kg0ZhK+mx0c2ElM/bcgarl7FZ6Tg5CBGBLQ4ag5oEZ3kJxGYpqY0N+BrJ41xf+6J3Eobk0QVzRXIxw756PRNkA5Otzjuh9yZL9xQf7hxDtkVoCTWXLn1K8v9CJMREk4ftQWCsE2osIBjxYSSU7M27Z0QsZxP+G8F96My5GIWQBiKT7MuowqYK/MpLzZtx1BcvtfLA61ic+GfKZFG8ScfwbkCRCxtKLjc6NzgFmRkI8fFCczwou/qwYo8dPQXzmjuTSy1vHClXMzDFpymbnXxagkEF78O4LbArzUTSt8JLa3obLfkgo7ruDalc6hcHaTI647Ol/YJHyRHC6Ylt6eU4LVCOGZtlQH 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)(396003)(346002)(366004)(39860400002)(136003)(376002)(451199021)(2906002)(478600001)(6666004)(6486002)(86362001)(41300700001)(44832011)(8676002)(8936002)(5660300002)(36756003)(316002)(66556008)(66476007)(66946007)(38100700002)(4326008)(6506007)(1076003)(6512007)(2616005)(186003)(83380400001)(107886003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Hb9r1nAaluz8shVTeEGmBZy4THvww/GH6YajXOWhDaFzC1p5OIZostO/zDHD71XVDcTrj61HIpE+FnkttTqWT93mmZwgy5rtKepwRkvfdjZ+HJUX86SmRroWZM/895N0PtNoOEElXf4tfMpXCVcWfhujyDWaVeigFNlPzANvSDcBYMlD4NMFxhBpzM+kvxaw8afUXOi2pVPK4seGCEfYiniqAekUO1RyZ5nj1kgEN03VYvSVFDCnnQGTtDYDBjFG6lH/gEkDEQ0dduBOQsiz2/91Y3UKRyYFSw2GoDiq8JUgqcV06k2ShEcOW4MxxtfJzQXdXVsWF2IHbdyjh2wVK+BtUsUpaiyDUyQmjW6rT5A2SFqn7iKpke959sAQweXJtsYm+wnSWcrxaSUIhfIHBjHlirO2pcufiC1+elNkexu/nDdzM5yPDcsgFZLF4E3dwgo34yehuUn5bhlGxENC2SIU3jVO2Elq38bPVKwstPxn244tCpm4bMDONaa4feIlNSF4P9lb9KVfAH/68GRT8cFMwtr1s9NFIKfcmJ9td+WzKb06T9zO3bw4o1M/Jt8ysaadliDYqklKMAjAT1xo2ZX08e+G5Q1FN26XvTwezuqh9lVNFiQO5m1NersHFbTSnc4jduBfEUfLYGbDw4gwXJ8H7V42oECGzR+CmD+iIU9Qx6OlZTUIrZl9/ilO8/HU0U56VRf8n4gDHH4YKZBIYSEi15oEKf4KgkmWSE5xg3WxepjBy60n3yyoYz8lbF9geMW3NMGfHVp7W/fMT4gVPXOK4mD4SsU73/C/LpXDlcDX2HeBcKKSXWCecZBBSnopNB0yWvvXYcV2KFYWxBNOz04yiac3sRCTOX3lIYNVIZvOQkLRkk85vuN+0HKeyX7owNr72eHhy8jL5zzMaPwtxruHPHBxkBkHjAyjlbCc5231MZDnnULS5K0mrsm8rQNKQ4wjaawi0zafNJFxE/4+7ZCzfWRuTNiMQvV8Pv+Iv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0V0V8mrv7ubBU6YuvHsXpVHHwAZQ8GayEjCiLNsunMJdghdcRO9BFzKowAEOYf2VP4wbwZn/bSTGSsSLDFp3K9+VvQMyOqyMPXKCxYBdBvcTbs1zcV2WaFSOV2WusJhJt/4yhx3tTIc65SAXoH9l7sqfLnm5LGukwWeFXHeMtKZQrIzzs8eF/uagUF8o+jgtxchVlK62319fgpTAln7ZcqIvg290SuYS/tJjrzXzao/sdrh8K0mUEyd/CKvGXYXpA7poSVzVlaeDg8YcevGW7u5t2sRcKThp+DKaCFeqJWydJT6FNc/zt+Hty+byHiIbY4DahyobS2YXOhYzVCd6BcVPka2cTPmSPxnzVXrZ5yTrcOpqx7QDI0yTIk7Xnn0oD2ZuxMDYQ2T0JhCQBmPwfNTNRkv4jvbS9R2hcRoNg59vd/O45+AENwMsYPvU/XwAqL/povU56ZkxOMyGTIVeSudYWKJN9AcivrPW6V48oBKt/xQaG0K4bvdgCr8w5q2F6ltrBXpEUNMtWi60FW1gJ6JnDt X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b95c54a4-6470-4175-9d22-08db7b8a9986 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 05:59:01.5989 (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: 9sw1m94o8qjv0ozpHrl71pOoxev4eHJI7iHnItIQHJFYv7hoSd3cMZh3x8ctGnrpGmiGfpQa5r0yERPfKScyvc/jjZoga4qPZpPL6/4FsDA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4697 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-03_04,2023-06-30_01,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-2307030056 X-Proofpoint-ORIG-GUID: 9G54wqyZKX08ZeGYeSApwjCptShlxvou X-Proofpoint-GUID: 9G54wqyZKX08ZeGYeSApwjCptShlxvou X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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?1770379037218479605?= X-GMAIL-MSGID: =?utf-8?q?1770379037218479605?= Saves five implicit calls to compound_head(). Signed-off-by: Sidhartha Kumar Reviewed-by: ZhangPeng --- mm/memory.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 098fac2f5efc0..93480e846ace6 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3286,8 +3286,9 @@ static vm_fault_t wp_page_shared(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma; vm_fault_t ret = 0; + struct folio *folio = page_folio(vmf->page); - get_page(vmf->page); + folio_get(folio); if (vma->vm_ops && vma->vm_ops->page_mkwrite) { vm_fault_t tmp; @@ -3296,21 +3297,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; } From patchwork Mon Jul 3 05:58:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 115195 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp316287vqx; Sun, 2 Jul 2023 23:19:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7jzR9/skedFMkLPkj88nb6YMtxefxkn9oD0Pet8ioVlLIuYWd2e/PxzhoxO6D6k0hlj5sU X-Received: by 2002:a05:6a20:1456:b0:111:77cf:96dd with SMTP id a22-20020a056a20145600b0011177cf96ddmr15027484pzi.5.1688365151659; Sun, 02 Jul 2023 23:19:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688365151; cv=pass; d=google.com; s=arc-20160816; b=ynM1WE500ftpvS2ppPQP7PhYK/ZvIf3OTcqM4TIgoAQUXeF+FUMNjfTyF4OmGMroU8 TheUkmLejY4ek/Fm54e8rWfJkJ/x2YdNdX5Eo57VqhfwxGdubCNC3Z3uB0G8AyD8WpV1 /yGRKeKTtsV136N8cABR9i/e6ySEtFTZYeGbCEjO6ssCH02vuPcDh12l9g74Rr5MKhQZ v8RNAOi+LHIOdPBw2Q6PIb1ctWdH+EjtKNVuFXBAEkQqV+LYnCbN9Yq1hmFpX1tI8NZT CpgO3z0/xbAh96DDzZFQQIupy/S3dP/MXCAqu36APKZr1eChVEOkjXEhoXSyX9Aoljls NMRQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=gFYk9aa5kbnZajo5uK0L2ZV4PacQ7xs/SUS137pU2kE=; fh=/9bfJsMG+/3rgG7nJ9LKdUdSJTmdx8OfkQbVdkOHqG4=; b=XEd8+ZuG7zlmu/BtB4/0OgpYpcaqJ18Y/P1vUzlE/y9XMwtAOoAKikR8G4dEp/84do 8sg7PEFWOqlNU9hLkdyB7d6bWsWPNsyeMHmVbl1KB1JbPkNwXulqhVRl1tt0GMGH9mz7 zGci4n5hviWKwrMt67NofwtoXWz5c8BUyiNMMThGwMBoRQNSnG7pr7mf34TYLW+fhLJl Gi9uV2DToeO1BQVT5L3E8GxJp0xqjX+4linkglQPci0AMo07UsvPPvGUvsSRyllE5vEN aZmypSHxpqNhR7HxqSwunHd8guaj3L6HG49WCNxDIfVKDh4JnFS+aqk/921524ry5515 j5Qg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=F7nQkhYX; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TMQOWs3u; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w24-20020a1709027b9800b001b81a9aa3d1si11502615pll.223.2023.07.02.23.18.58; Sun, 02 Jul 2023 23:19:11 -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=@oracle.com header.s=corp-2023-03-30 header.b=F7nQkhYX; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TMQOWs3u; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229949AbjGCF7V (ORCPT + 99 others); Mon, 3 Jul 2023 01:59:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjGCF7P (ORCPT ); Mon, 3 Jul 2023 01:59:15 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14253B6 for ; Sun, 2 Jul 2023 22:59:15 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 362M0IrP009736; Mon, 3 Jul 2023 05:59:08 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=gFYk9aa5kbnZajo5uK0L2ZV4PacQ7xs/SUS137pU2kE=; b=F7nQkhYX/+L469mNz++FGGTzynh8Aam3rZeVuJ253RqtD/PTWRd6iA9313m00h8uIE2M 8Bi4ljW3UEEil69+MVrCWqqaRKa0Rn4F6bI8j6VFznLIs3qTACXNIuC0QpBlNi90PDYE eXqCJ0VOfuDvTkS6HYpxPFYn8msepEVLqHXtnNoIxOeYdsuhldC8YUb8EAXt7ZAwzp0a Mbqrys/NH8joQY5dUwNCuJHnnxNjvpWcVvxnVD2kF5sT+f9o2aCdRCvA1OE+pOC3PnbG W29n4WoeJh5pGijClfthdfRh1nYCk7j4ixIpEVIaVwQRMHKY+GWENh71NRgOBC1ogH6y kw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rjcpu9ssd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:59:07 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 363406s2020201; Mon, 3 Jul 2023 05:59:06 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3rjak2m4ye-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:59:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j2x5z+QyxmQCkVay8U05dK44UdxN0THzvWpl+/4IxvwORjdcMDhZbAaBriUTWm6mMbt8DFb93uQtoq6jx37Q+qC0wiX53djR3xW6+/lXPc0NvlRHwm6NtqOTCKktEn21fqyr1g+fedaVv+1spiysZwRgP+Fts2kQjlqJ5bYeUvk4BKThMrW90Gg/upSz/hTurOGN1n5KEZlF6y4PgdKOSpiG1Sdpf0dKvNAGHKzp7q65p624z4tw4x2zZVE9n3XOSpBDgsTJx/zjP1iEIVzKO4w6aLNCI4l4L427qZ8fOkci+TK4MgvjgppYc68XIu81lXStsRSHnPY8A3uLP7QKeQ== 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=gFYk9aa5kbnZajo5uK0L2ZV4PacQ7xs/SUS137pU2kE=; b=KFucXsfjmrot2/lthEteci15E7RYHuTCVmJmTD+dr/oHZCtb0EpqqTT3W1DKIDa2HvOgiHjNWDKXN8QOlvqw+D4KFp2myz62eG+nowuo9d8GzJ/vxmjdWTZz5Rp/1l/q66u0VWWlFFZStVygvQXTFzWCxfcfS2D14X2Lx+8MKyyyzmAZj623J+K3R7ZUnl1VDsti8yNpmRGpJu2iyLKwZJ7Nm/1Fl3nduQlUZQ1TI0zJkh15YywZ9cfT1HG+DTH18LoAxPB06NizdRjmRC/skvvT/apAlBYhVGJZrTwNV7jZso+NO0hol/qgRYrrKnMpTp0BY/joNebkwx5Uu0l6Kg== 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=gFYk9aa5kbnZajo5uK0L2ZV4PacQ7xs/SUS137pU2kE=; b=TMQOWs3uV9Io4DHAVHSZ+6YrabTltXLBhzCYmC+bqRrXU90fKOD6tAunCR5Gfxee7OY+oO8KwaCY9G1xmp1Ugv9u5PUB2VYkXDnzS5sb31QEdIa2WzzdkhxyU4WscpmHIS3C5RhrbwQPX0M4BkwShTObTivdo20W7nX1GJdRqH0= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA2PR10MB4697.namprd10.prod.outlook.com (2603:10b6:806:112::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 05:59:04 +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.6544.024; Mon, 3 Jul 2023 05:59:04 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 3/4] mm/memory: convert do_shared_fault() to folios Date: Sun, 2 Jul 2023 22:58:49 -0700 Message-ID: <20230703055850.227169-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230703055850.227169-1-sidhartha.kumar@oracle.com> References: <20230703055850.227169-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR11CA0088.namprd11.prod.outlook.com (2603:10b6:a03:f4::29) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA2PR10MB4697:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f8c906a-e5b8-4c31-d6cc-08db7b8a9b3a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B8Akol0YSu5KAnshkV8ClRUIP8QP4iqvjj8rKG2+j4VoKqny2oTb60faR+VblMYHcph6RlNSEi1YdRLKzoWvUPwftYXqFSYUUxNwsOmms6IZazJCmUbyvwAi9Yy4DvG9PGIKajN77k162vf0cdeEBlPWuIXrjpju3vDqnblJ/o4b8JD3GTNhPcBAGiF6dCHVQAxAk/g5aXOOKG/M6D+FFREgH59UiCtDlv/c46Q/31NKSGkE7YLycfZqgqQEJeL8zttsomm3GJ7PIPeO/T7LwDdEkGYELxM2DDW33nPMzxZBhyFxHkrQBAOprVt7xLYxxHDp2nJUtIX6Fxg1pfMOJmDGWVs8J1SGJ7w7hTLeoCJXTm1dTqBTmVS4/eRmLAg2bABdXW4zGpeuLyuj35eDpsVQGxCUEaJelY0e/9YRfQ7pnMWR7dZh/MJATmriI7Pw7UfzBkPN5NNY/VPVXSbZm1xls1rmQAT3r7kdDwE/p24WqUgqkYa1+xukTDxrI1AKwD9wVkqf2jSQ7T2LHZMHhEqkGOy5kJpXv9KTi0/f0HVvJv/qTesjr8uCyU/hEXuR 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)(396003)(346002)(366004)(39860400002)(136003)(376002)(451199021)(2906002)(478600001)(6666004)(6486002)(86362001)(41300700001)(44832011)(8676002)(8936002)(5660300002)(36756003)(316002)(66556008)(66476007)(66946007)(38100700002)(4326008)(6506007)(1076003)(6512007)(2616005)(186003)(83380400001)(107886003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NRvIhPAVMg2MbRf/29IPgQoNFRuR2wzrSV1/AvV0dxJ/c9vDhTgjF+AE1cDk4uSbfcn9ZRnVqTk60JiUmzfDFHlO+C6t//Q5XGWagmnZUlguZQvE4FNrbczmJ46PxJkDVnrPEMzolAK+8j5EypHINdDnKdWPibv+N67RC42da+ZNVdQ4NRYVZ8qy91jOx8JALz3sqqHegWEkNtKzoy4eabZogmTbz+wxa5nJstAB1uyR0MAyD4kWR+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HUz0ypaXP8dmqoE7z3m8KZ+HlZUOWumzULtfXUhQKRjBMAeyTCIXgPQjL1hFAEYvvmBJLf+p1FvxUDP8uzilmAaj7POCrC9WR0EKFT9nV5hlFgSiXdn0k+WfNhXpQCZl9ynFROhqdN/NfpI3wVYAqgZfypB1Tc0qxiyv9bNbmWmN7m3hIojZRIzPyZGeksKFwaVkfJUlz3Bvg0ARJxqHSvyZ9M9mII5WRO X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0f8c906a-e5b8-4c31-d6cc-08db7b8a9b3a X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 05:59:04.4576 (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: 7xN6c+Jc65DBGxZ0k7dpf3fSslmU277nJEaCKQ9ifOSX4mQNJBxfTWKOU6aKOBvTtD0XDOz/N20w/iTUuxa/SDP2LTxcLVpVbfL/02DA+0s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4697 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-03_04,2023-06-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 adultscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307030056 X-Proofpoint-ORIG-GUID: gJ9jXKm5Dfz6Ib6NFElSeh6loN7MmKkc X-Proofpoint-GUID: gJ9jXKm5Dfz6Ib6NFElSeh6loN7MmKkc X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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?1770379176968733296?= X-GMAIL-MSGID: =?utf-8?q?1770379176968733296?= Saves three implicit calls to compound_head(). Signed-off-by: Sidhartha Kumar Reviewed-by: ZhangPeng --- mm/memory.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 93480e846ace6..33bf13431974c 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4594,6 +4594,7 @@ static vm_fault_t do_shared_fault(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma; vm_fault_t ret, tmp; + struct folio *folio = page_folio(vmf->page); ret = __do_fault(vmf); if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY))) @@ -4604,11 +4605,11 @@ static vm_fault_t do_shared_fault(struct vm_fault *vmf) * about to become writable */ if (vma->vm_ops->page_mkwrite) { - unlock_page(vmf->page); + folio_unlock(folio); tmp = do_page_mkwrite(vmf); if (unlikely(!tmp || (tmp & (VM_FAULT_ERROR | VM_FAULT_NOPAGE)))) { - put_page(vmf->page); + folio_put(folio); return tmp; } } @@ -4616,8 +4617,8 @@ static vm_fault_t do_shared_fault(struct vm_fault *vmf) ret |= finish_fault(vmf); if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY))) { - unlock_page(vmf->page); - put_page(vmf->page); + folio_unlock(folio); + folio_put(folio); return ret; } From patchwork Mon Jul 3 05:58:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 115190 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp309994vqx; Sun, 2 Jul 2023 23:04:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlE8/YHsAXZJACzb5XDyxoNWWZBhJOpjoCAqBVVEJEj7p4MfKjC4AliLkMr19d+wpbPZtYPk X-Received: by 2002:a17:90b:3706:b0:263:6297:9f73 with SMTP id mg6-20020a17090b370600b0026362979f73mr11030542pjb.1.1688364244330; Sun, 02 Jul 2023 23:04:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688364244; cv=pass; d=google.com; s=arc-20160816; b=Tjh7nh14LRB0joWg3t9RPcrtyUFCrJyeHGV+9z2NtWW5oqK9GbPX45urIGOIae8nN/ tELetivNp5t7ypQM3nGz2NhXKA/fYz3IJ1A6PD4UCE6V0OrVpqNuAcsOCZ3O8fNEs6qu 8lKG7Bvp3G5vyCHokFI0xkjYQNdciKHlaMesBOJWncVzsnEDo+sbFdbxowlxX5orCLlR u5WYW6A4zk9vLLfIwrMDgg5zE6/NQnYXMQV1NQS0oA+eDq9Ab+a+g7TNQj2yLXJEFAn/ ZATKXZo6dzU5zQ5Z5D6QoAWttuvfvJDkAzcKfb76CCmJb/bOUSEswbjYAwX4mFFE10tr 2/Sg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=mWjQpZo2a6ZCry9xshQ+oF9KkRkC5CiVlfyKFHFCjOo=; fh=/9bfJsMG+/3rgG7nJ9LKdUdSJTmdx8OfkQbVdkOHqG4=; b=tetvO+OyVZkcWVi4mQNIiOe7lGmVmVJghfyqY76XuWO248iBvCCiZBhTc+O0BmmbwT HZJCgRYpeRu695yIJsCq3chICctMalyQhAcocTvYx2Cid8phliRaIXL2ne6boRgPMqHD ENbotqGo3AATboy+GsPZqsZWCxmQTqtyoony2qAn4sxxyN0pMkVhd0tnoiKObS6MWFN2 cZaGx6qYcqAo9JO0+RwGxvTKSO9N86mRkQzisG9Nj3enLy7aeSbyQ4GLnRydLwYYoDUt M1ZyFlNikxVkViWR6PCcwpOpkKPXlt9GUYdvN1RtuwlcuYwccvvNLjGNX0Mqupe4h6+8 LD4A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=jliCc39L; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=nrGe8yxg; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s3-20020a63d043000000b0055b635f28b6si6445699pgi.881.2023.07.02.23.03.48; Sun, 02 Jul 2023 23:04:04 -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=@oracle.com header.s=corp-2023-03-30 header.b=jliCc39L; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=nrGe8yxg; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229922AbjGCF7t (ORCPT + 99 others); Mon, 3 Jul 2023 01:59:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbjGCF7T (ORCPT ); Mon, 3 Jul 2023 01:59:19 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93E83BC for ; Sun, 2 Jul 2023 22:59:18 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 362Kmxhr017325; Mon, 3 Jul 2023 05:59:10 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=mWjQpZo2a6ZCry9xshQ+oF9KkRkC5CiVlfyKFHFCjOo=; b=jliCc39LISMvdZaP8bIYwVGCPZCXISSwiwHGfHRhSbCb2+fZo+I7F/yq82ZPrJvMBLJG l1U26Q9NmAv+KvT0jKMZw6cEhUIM031Jv4iwXFrqfuXKRHVZRPsGfpUGUzKtiCjGV7lq cIqzpOE5f2WvjLhuxjU3Htif5O77136PrHImnN5fM6Syft+FwXozjjhUEKZkpFhTTMuN GTeXH1KK+yU0mrNK7RAqEdpPeug9qg3+Tq8GcWNFPaLI0aXrHSE8Ii351TvRFpoX9tCc Fe7vRcDc2CCUFj0XMB9cuxRdArhCyUfEjwqZGX0NzPudZ58zxGSa2Mje7onUW0H2h1jC 1w== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rjbrt9tqg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:59:10 +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 36341NvC038627; Mon, 3 Jul 2023 05:59:09 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rjak2kv9g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:59:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MH3FlEQ67bWA18PMv1MRGSwxAcnaijJ4iafaTpRZm7gAmTXAf0rLFMhOJV3U8RhOkGGn6tAlIr3UdR0hvBbNgG8N5JrZcv8rVOJm+Xx842mOwqnhYWAjMSB0J6YbMgJ2+vNo1k5YYI6tlw+bAhpQPFFgNIVxQylIJArPBvLEzdYqeeWPssEHwHTGfGvUDpf2pxSrRVAPny9MfM0DDcq6PsCs8M1/67NkRPU7AQLxajuRTEg4KkUrI0VrDs66yOtHNUCkL/+Rg4dreL/PTKvxz9FmdXFUM1arhiIfS2uGhglbZ8qQVU9LrhBhHzspBg/NyUyjfY9PxJLMIwKZDr+YMQ== 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=mWjQpZo2a6ZCry9xshQ+oF9KkRkC5CiVlfyKFHFCjOo=; b=D1CIIZldfpm7nXyr02FbZYL8BmDaT+nODbqHxZmlozGAZCDClm/zMm3ML20BOfjX08eAjQImHN0p1XkQ+A2oaLocbVYUpQoXMRupG0oN8MkyUzDq8JBO3aZtdO4tU4uEVbQ5P60u4s7wumvIUKfk39ojkbu4/gEOT558SzfSsVuIsbf3fMu6eos9s5MlbjXwXAhr7kOSNllXXY6FOSZq0v4oK/NT7803xkgooiAoyMWF/c08fTP2CeU5JMW9IPAkUUX8WlmE/IvYsspQFAWyi/XyH2BpbqzX3mxRYVmhXyiJ017++Eak6EdFR6Pp1ZLORplodGtbUu3pkk7adtbNVw== 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=mWjQpZo2a6ZCry9xshQ+oF9KkRkC5CiVlfyKFHFCjOo=; b=nrGe8yxgYcjS6jdyXaA3OwdxZ68eRvBX2f/IwD+E/df420KqgJjrWAS10ZXWoQwcdZkx83VfP7/wby3GHsoc12FQbXx+nfYh4+xz2BLd66tLz01EaTJaidFV2+GEdBPq7+J8zn5OohmBs0RGTfaOJSJp6wq3F6HFnAd1+hppIgc= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by PH0PR10MB5548.namprd10.prod.outlook.com (2603:10b6:510:db::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 05:59:07 +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.6544.024; Mon, 3 Jul 2023 05:59:06 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 4/4] mm/memory: convert do_read_fault() to use folios Date: Sun, 2 Jul 2023 22:58:50 -0700 Message-ID: <20230703055850.227169-4-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230703055850.227169-1-sidhartha.kumar@oracle.com> References: <20230703055850.227169-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BY3PR03CA0002.namprd03.prod.outlook.com (2603:10b6:a03:39a::7) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|PH0PR10MB5548:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ba42725-885e-48b6-3d09-08db7b8a9cb8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DQUoLkhhr5DsQDs5vLzMaGRONzdcH2qgy7q8gqoP05rg3r6Bb15RvXd1G45fqlBz2gKQ3SWCFd+JER9KpIlXjmkFJiYDvevBA7xWKaRbmOdRIf9HXIDj24Y5lMeeJ6Bv/e5md0zVH9dSsmdCcosGYjN9iYdui2PjZnlAybYYKW1nQyZMyiVxu1xGhdoXUEoZGAKPRXiO0Gir2PD4aV96KbT4Gdk9Z++P4sGXWQWDX4N+7N38hlEtrpcjk4S/HkUGMbdijmsTQNEtJgnvszRHPmFdikCRNayITy3cLddOXvtchSWV02vq4nQlh8gsCsdCtg8oZaRB39Zao6bOvIR4Z5TIZOY1BcRyOUlhecuXmm4HDGWdaFSJNiZsSW+2QkZ0//xCceH0hpdwkDpp0NApF2WC9hQOMgVFUlbNunbqengvcDc29j+k9AlockHFHKh91TOZLgb3oukkgdYKMRpEWNoljBVfNTzmCDqE6s5CV7Sd8Ov+cnwZg7bkAoNIOhawHuZqMABDhyomy+QzgV+FgAP+ql1tgZtnMgTq97ik10UerzeqKQnSxat/w9CETKLL 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)(366004)(39860400002)(346002)(396003)(376002)(136003)(451199021)(2906002)(41300700001)(5660300002)(44832011)(8936002)(8676002)(4744005)(36756003)(86362001)(6486002)(478600001)(6666004)(107886003)(83380400001)(186003)(1076003)(6506007)(6512007)(2616005)(38100700002)(4326008)(66946007)(66476007)(66556008)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tNDugnlBGdz8PLbf3FF7c8UTx0EK7uotQcSoT6RgZNbH25zd6EtMhyDBGE32uH7chw5Z7MYTZUbe6Yu2Pn0lLs/0EtNx8yJyegXw4nJTOenmgYCAYwGU74mjtA6Bb/DvJCdx5o1xa7UGWiuhCGHnw4OpWrroVU0z/L4E3VmnCPDRaT0RoqRa1nzSPsRBRpnn3Uu7r1NG3/7Merg9hLdHILh1CPcaz2ZWT42csPyfP47KBlagcwx3pYj0ISh17hqnPsWuf/SjCRg1DKW9Wwa75hTp8/49Um6nZGZzeAQU2ov2GtedrdkYkICReZieHmx8tpN3B1qA7ExKGzO1v5o6oRgBkdf1tUkmm8iUxamGgEl6gIM0uDoBjCr40Br+UfSuLTkRqfixQyTS64uPkotl1GQWmvzV4Kl/o2a1LxRa6XmC2aNXbQ1QCf//UM6XdgACpQSCcT7wzJnphnIHdeOioy1iXbrB6g8BBskE1B4CFyHXi86tDMeVsO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ange-CrossTenant-Network-Message-Id: 0ba42725-885e-48b6-3d09-08db7b8a9cb8 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 05:59:06.9136 (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: 2Zf4r5vNmlvAiM9r5sTB8vGAot5HuNAjQPxQu6Q/lTKpApx0V4qa4ApOYNxY7ZGrGZ489XbjDCdpeXx4hUwWgJ8ub4Wy8rm7xV03FTYU0hY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5548 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-03_04,2023-06-30_01,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-2307030056 X-Proofpoint-GUID: BNAt60cMlimAfNfcHa035vsMOJJClT3M X-Proofpoint-ORIG-GUID: BNAt60cMlimAfNfcHa035vsMOJJClT3M X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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?1770378225800932387?= X-GMAIL-MSGID: =?utf-8?q?1770378225800932387?= Saves one implicit call to compound_head() Signed-off-by: Sidhartha Kumar Reviewed-by: ZhangPeng --- mm/memory.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 33bf13431974c..b97c66df4adac 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4528,6 +4528,7 @@ static inline bool should_fault_around(struct vm_fault *vmf) static vm_fault_t do_read_fault(struct vm_fault *vmf) { vm_fault_t ret = 0; + struct folio *folio = page_folio(vmf->page); /* * Let's call ->map_pages() first and use ->fault() as fallback @@ -4545,9 +4546,9 @@ static vm_fault_t do_read_fault(struct vm_fault *vmf) return ret; ret |= finish_fault(vmf); - unlock_page(vmf->page); + folio_unlock(folio); if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY))) - put_page(vmf->page); + folio_put(folio); return ret; }