From patchwork Wed Jul 5 19:43:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 116410 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2102757vqx; Wed, 5 Jul 2023 12:56:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlFbTXdX/bF0PgPLRR74UqFfbLdfi3UXdlopaXeGytgcpkymrpBu7Ynn71QXhQ0ExU5gV9Fn X-Received: by 2002:a05:6870:eca6:b0:1b3:d679:d3e3 with SMTP id eo38-20020a056870eca600b001b3d679d3e3mr37260oab.6.1688587016472; Wed, 05 Jul 2023 12:56:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688587016; cv=pass; d=google.com; s=arc-20160816; b=xNDIRU0LBOgahN9ieNCTxuzalWYrJvikPPLZjDoM78vf1kM81j6pvDKK1VkkIj9Z5P 8fFTqqPAGNB3sebLTAMTqVM0y86TSzC2NLwtFADm0tg3BR4nitS7Sfu+mwu2bYe6DGPK RuTaawRJ0euVK/7pEs5YrHPYhrnk1DOcAdGPHet0JTGcFNI02yFtPpTOb1Y92la24Cpt vVV5kR6aoSrrvRwlsP94IWoxwgAei7alDRd2adTOLbikTIiysEqTUtH3Ns3+VRlrBAgx UZ/AFGiuVHipDcZS+w/YV/6M2S+JmDsC0VSuomy8rFniXibKtkSFB1fJ6mV54YVEqzEE qORg== 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=kw6BRq5S7nlCZ1N4MuCx5rTYDaTeRJQjFn2jRhBUINE=; fh=/9bfJsMG+/3rgG7nJ9LKdUdSJTmdx8OfkQbVdkOHqG4=; b=P9Dc4900uOiyYdbfrCCH0kTZ4GHX6nnHuHEogmYN4tSGyyigcCW1O/v61O1Tm5Yg48 RootUbOF2C4qCatcB7SjUpMPutc9LZKQMRTIOiP5mGuIFteowr31V0I+ivm/fqxXXH8P 0vwRDPTOZ34aYO8rOfkjhJVU94wpHYyRbvXTCOkfvsb2QdWW0xRn2aB0LRJn7pYkGZ45 b4PJlFi4hiKi9Amqcid48tp1sDBJs0+f55nypBU2I6g9uxt9jbwx9cmZp8t36B6LLVPY 1oVVRo94LdmVr8YMKnyMEk1YlG1FF3XOKCjO85NlGPhGCdl6tIcxIOAayUQt+N3DJKJO H0cQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b="FnAs+C/d"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=cS7Vf+G9; 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 e19-20020a17090a9a9300b0026343b62cdasi2196996pjp.154.2023.07.05.12.56.43; Wed, 05 Jul 2023 12:56:56 -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="FnAs+C/d"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=cS7Vf+G9; 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 S233314AbjGEToN (ORCPT + 99 others); Wed, 5 Jul 2023 15:44:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbjGEToK (ORCPT ); Wed, 5 Jul 2023 15:44:10 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BC48171E for ; Wed, 5 Jul 2023 12:44:09 -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 365JU9NC014840; Wed, 5 Jul 2023 19:43:51 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=kw6BRq5S7nlCZ1N4MuCx5rTYDaTeRJQjFn2jRhBUINE=; b=FnAs+C/daCUDtRIOzSaz+1aF1aXr+T06lqo+4q1AmhOzQbQa1VmloZWNZ17sFqS1961h I4ZgJg0F1IWXHBPJAkOQmlwvTS5SkgBEOTvF8ISwUrJ8BIBlNIZyQGxGn9cAPrK7yZYC NjGb+zUnrDeoOVlpe3uiobZVEPiqSUDw54+l8wCF3EdBTcCkw7yt29+Sn06YPL6+Y432 3IY60fbqWQ+i2Lut6iEVFhRbLcRG+YYfkWQS69oZuYz4OSjugK8GKtvBbK+UYD6hQpNP tORrVvKxJ3dxkln3QewxEmzQjuPsxidkPdmFttN+P8+kkCBQ7Aqw/0p+JU7TKIwRfM+i lg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rneqqr11u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Jul 2023 19:43:51 +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 365Imt0k033353; Wed, 5 Jul 2023 19:43:50 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2041.outbound.protection.outlook.com [104.47.73.41]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rjak69932-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Jul 2023 19:43:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DCGVbWULdmiGagyAK5LS5SZ8yjnw5R0xjHQ6EFF1LFNC5arH0in90I5tA3fQK9oEZt+n/4jXsPtnaKfr/SmlP5RP+QIRNWA4M/Ots+Qb9OMph49zGBrJKKBlwDh4nFoI3FhdVzMNSLgXz1MtkV/bwVt8UJCB1ImwLtQFa/fBCrkw6WcKPHFISnNN0RVQXsMD6AhgdGwqn/fgGAEosAbayGcG3PGpMMjKBsqm4pGq0QBvd2/aH9pgH0aUH5A1SQiRZJv4ABFFoHupc1NnkCY92J0ska4RLWqBXLpw3o1uRaWe7xucOydr5+t/ucEW1N0ciojtd076rbakH2Nb+1yloQ== 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=kw6BRq5S7nlCZ1N4MuCx5rTYDaTeRJQjFn2jRhBUINE=; b=Ia/sF2Wr9mY/vNz5ES26ce7rKe4XGUSFdaq9n1QMjFTzFp+/Vd7I5SlkC7FY/cg8vNjfpv0y6mCpd4fRF6KRTBja/zkOE/7m41VCRtiS3t+mZZ6CUEuPzhymg4vxOF6Ja8oqphktQ04OimqUA9wz1j+krMwszTy4ADXsysch3Hjyxa72Oh2iGv3iu7xrZHIzCAXsJobB07PRAG389xiNdprI53ZUIqsu23eZuQ+dC9+36i6vNYn2l5J2e+VZQHJnAZOXUnwESrdDpZkB+r5quHKYrhCAOjtMda+zVbU2LMXkmeaNaK4+VxXr/YFPvMWbBoGhWkuYJu1lk4m0Kzjkmw== 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=kw6BRq5S7nlCZ1N4MuCx5rTYDaTeRJQjFn2jRhBUINE=; b=cS7Vf+G9bPQogDNT4BhkuqojsnaNZZKQh2O53Bb0JagXHkrMb/5BLrjJyFehxqmVQtLmU0jqdjsOnhsK4WGsCqCb/q3/sRluX5p0AIR2yz5BxZq3+KWiWGfCEc+WSYiuiPjucGPWy7BTyNAQ/WHNCwNspuUa9k7G9fA3SyUZYA0= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY5PR10MB5914.namprd10.prod.outlook.com (2603:10b6:930:2e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul 2023 19:43:48 +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.016; Wed, 5 Jul 2023 19:43:48 +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 v2 1/4] mm/memory: convert do_page_mkwrite() to use folios Date: Wed, 5 Jul 2023 12:43:32 -0700 Message-ID: <20230705194335.273790-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 X-ClientProxiedBy: BYAPR04CA0008.namprd04.prod.outlook.com (2603:10b6:a03:40::21) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CY5PR10MB5914:EE_ X-MS-Office365-Filtering-Correlation-Id: 1dceceec-79a3-4004-4ca7-08db7d9026d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1T+ofY85lq4nzn9CRxUa95RcSdNLzSXAS6tPJCUFuL4kLd/zdKd2TODtovL/Fnb94oS/qw0V4C4GX2W6hisPQ/sx2nLLjfJ6KyoytlnMuT2rAZGU7FPSLwqsfIjXGqa5uz/pfe8hYEKBChC4Iva0A9D+xU+GYPLj8VDP97l+DQ3EYucpUKu86oL6/+vZ80ZU5BitlY94lrjSU8a3NuWwOgL9DndkSrrXKAjqWUEw/8DtfLBEsi+aCLpfyaeC+LxIfwISygkidtWpfWmfpX7WUVPBLuHGq3PUwBj9WNm+qydRPH+w/1Osdw3k/IY3B+sH9BcA+rrZO8QtCropTrLIKJlCmHrQ93SDd21Kb6TEQ5RfMfGVwC8Svl9TaSQ643sDyNNW/riU1pWa0yWdqUYUJxQHvU5y9sOB/ICpjV0DZALzuUcCFyfnVp5hlac3Jrkko0aCr7502vrJSa3pIqjzfViz4Qctq7Umkk+/T7YVErUvA/1WVYOaVQx3gjCNPH+MKQHpk9dSH/j5LFreH7yWd3Grg0YYVKIy4affAWGVImNgzPSlYVVLWDpVpCMKpyNL 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)(376002)(136003)(346002)(366004)(39860400002)(451199021)(2616005)(2906002)(83380400001)(38100700002)(36756003)(86362001)(6666004)(107886003)(5660300002)(316002)(1076003)(6506007)(41300700001)(6486002)(4326008)(8936002)(8676002)(66556008)(66946007)(66476007)(6512007)(44832011)(478600001)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ogDP0AlzEJVYBwBftW5EEh0X+wlWZk3XqopYQSTSm2+2tCP0lCLguRMdNUqKTYLw8iADmBpBmOguNiTTIviORaBupbrVme98mLjh/T4F+UOqc2URQ/DEDtxVkvUCw4Sl2OKIHVT1Z70Z73Mluh4n8mGxIf00In+FsyGfZwvj9ebeMct5DoThQ13un1WV4RYmRU2zq5MRp1ouro6pSmLk86zawVNF4daLDDHiBMWDRwNs3gRN6I2A6VclfouZum/lxUMVDPnLUpkK0vwF1OBvaMOsI+orCiUfqIzfpXLea3GuWpxxqLrRhxGRd4+BzBKsQluvnbNm+bXLcOIT395l2+HcRrPrdSKTauQ3d1BJAPMBkTwjfNcsa8Un+p8x3gZDGbBGWj3qyHWVyJYayGHFduTEae6uBn2NEZCGLjRUHzoVrJYwfTZd+4xYVCNIkzFRpbMYAQU6i6p5lL/z4hOCCyC7U0lCJdYgSM+JFJB7RUuTzbNWQcjtJY5Rg866Lxa3nD4rpn54sajWTmQu/oHid6YISXLTtgULA04LuLXHjyRujW46Y3exqTrTGODAsq4B7snGZtuDY1rOAP0kz7vs0QQ7GWV4i0ut7Eys0URTWU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-AntiSpam-ExternalHop-MessageData-0: EFSqoR/5kDPXBII9EgsJ5AI/hD9w7PAIP8R2PN30d4BXgaap65bGYiJAVWvnI6BJuyV5adyDj5YEbXSEbnAmpmvTj0Nho/89iSoeuBgSFl4BKO6Cx2ctH6VtVK47ojqqLeUW8jSXVWCsAvRMc76M9IeRCtz9c3pd+7vodVNEY1zEvK1BAfpHS1tYDsSdHRM1RGqbst6dMC2LwCn0ZeX9K5jkhI5YxBchOkMitUKV/HKkEaI+qEuIKRCJSaotOnEyj+GZlwujL4qA0es0U6pymMtAfa/UsUaN/tCNhz690rs6xLh2kIMI1R9Bs5mN/cBD5b9taIi31iL+yRyhrlMHXG5FEUtIUu5BBaB93P13IG3CrHyj1NFQRAvVl3zxq5NlMkEXsfzYJtskUbk5Tx4F5CUao8atYOVdcNKUSonmSGaXEBTkWVSoSKL3XeyI4ych3kDKqlrrDFVX6bWFa9ybtdno7eyNwmCT3n9wtlqrD8LfSwqMNC2aP6hmOfO+bJ2SV1vTd6Kj6ThanODyTuQy2KEKFM4YkI7uLTFEjv5nJuHxBsmVDwQeu+15gtBhOcNGSClgOlcx/148XvqH9JcCkp7Hqy+tRVuNRNnY626oykjJuyoqPj2TPtnHjuWFBckR2VAGo7xHNETfAgx28WHQmI9oUiVxO2KQq2uC+2BoIqBkmozTyH04S0WJ08E4wgHFg9jnazMOwaPAur5GcmY8RGlWN8/9LrsmAXW6WqGotrvmR1FIBpR/3XHgx5ZvKol64xEszchrD1d02DhNeDAarj4nzT9DEJk0Slf/nq7ykxMZ6NTLfCtVq0cubGiphE7cF+1u/A9VLcULU5dn8PujdTjwib3wIVUCMGwIeNGBy54Q5rGahy2Y2CxWEE3RxvBK X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1dceceec-79a3-4004-4ca7-08db7d9026d7 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 19:43:48.5568 (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: jb4KVrnhj49G36XmMfWGBsL+bxqwWvuU2SbCXKgDInj5gafsfJAD6YYBeFCKmy0SkwtrKKEEXaxobwAGyXOtPAF1JBsQ3ukIwTW74agRHZA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB5914 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-05_10,2023-07-05_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-2307050179 X-Proofpoint-GUID: mG3kDwMm1HkKk6TsnT2Lt3wO_x3aiWc0 X-Proofpoint-ORIG-GUID: mG3kDwMm1HkKk6TsnT2Lt3wO_x3aiWc0 X-Spam-Status: No, score=-2.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?1770611819222151738?= X-GMAIL-MSGID: =?utf-8?q?1770611819222151738?= Saves one implicit call to compound_head(); Signed-off-by: Sidhartha Kumar Reviewed-by: Matthew Wilcox (Oracle) --- v2: change folio_mapping() to folio->mapping mm/memory.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 21fab27272092..e73245b791a7a 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_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 Wed Jul 5 19:43:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 116414 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2103497vqx; Wed, 5 Jul 2023 12:58:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlF970UDU4xpHSyvXiYSm6Q2iXd8R8sy4w3EeztzMDWJwYJrY4s9UcoT4JJEux28Q7wFjg+t X-Received: by 2002:a05:6a20:8f2a:b0:12f:5f2b:cbb0 with SMTP id b42-20020a056a208f2a00b0012f5f2bcbb0mr4354491pzk.23.1688587118198; Wed, 05 Jul 2023 12:58:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688587118; cv=pass; d=google.com; s=arc-20160816; b=yW5D+Db0jYy7zT6J3v2n9aV2Q1+v2FNt/0fO+WWbYYTmzUqBEz4n/UImQIHBEb03B6 cAQva3Y2DMgWRb/AXbnJg/4OWwJazEa76vPWH6EC4lwshEG7kWI3f//X4oe9Etz3vSrp tkz6IK4cwZtHPPo5GDc/pXHKE1sOMjaVXnKXeyaNF8uYqpky+m001NP8D/sj8Qm1BDv1 4bk8SW0IOIBiORSlp23ssEbnU9U9hkDYdcE0aIf2eZnou6YxrZlOAfdxkBsTOR93Nngv B0KkmI19ihJ6UHWREcglZjMD9bhSRhMYwn7YXX7xf4clH6yz5arqUkSifpFA2EujgwuI gSow== 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=LDBwrKukA1W27s7eOaMHDH+8erEXbwg6C6gQbwSy+P4=; fh=/9bfJsMG+/3rgG7nJ9LKdUdSJTmdx8OfkQbVdkOHqG4=; b=cixayldP18ryJk8AFzM9NB3WTodsHLp5ysWrSTlxzUNu/GtTpaNgd+19hCIEcp0N0N /dhe6mEfRCtvo25L/6STYAEQEeN+jIZjwiMv+KgpOg7bZkNS7NJTpr5g24yyV/XzOp/a 0LUG6vWSRa8iwztOprjZ5hriMY47tdVe13VKRIpUvXJb6O/wrkStUNJOUCpTe/tCjKBE iYFNKly4g/zE4WNDtBE5pWTO4SQNF5Iy2qUXG451wkGoTI4fxDINb4bY8P+/6jeK7/YI lgqCD24mlEqs1+ELldkAwz0lOLLL7mbyMYI9SI8O9y/U65u5KBJ1u4SpTde+Cm5Nmptq FnNg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=bhgIPPYR; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=i3MucXkz; 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 h11-20020a63574b000000b0055aeedd94d3si20063241pgm.58.2023.07.05.12.58.23; Wed, 05 Jul 2023 12:58:38 -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=bhgIPPYR; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=i3MucXkz; 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 S232584AbjGEToL (ORCPT + 99 others); Wed, 5 Jul 2023 15:44:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229700AbjGEToK (ORCPT ); Wed, 5 Jul 2023 15:44:10 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49C659F for ; Wed, 5 Jul 2023 12:44:09 -0700 (PDT) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 365IXhUR022240; Wed, 5 Jul 2023 19:43:57 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=LDBwrKukA1W27s7eOaMHDH+8erEXbwg6C6gQbwSy+P4=; b=bhgIPPYRK10fo5YtD10ROB3CrvG71mMGxSZ30PYwAc/kSXVDUElFYZzPC/kx0vrW/p73 vCJbVphj3VvBdVU366TQwizkraM2jYnwcZTzDjCNEX0VjhUfOSjUeU+fOcs9Vk4rAgHS Te9UJPF7lqbfv3P4y1ZROyX7LXwvoCnrtDLpOISK6hadYyjegEl4+K/kepD1wI6x024E 0G0HYFNOD9yfz7HqXMR/gir9rdu9sxnQ+yApktwue9bvePR6UPrmsER4Scln1iP1irWi /RogqzH9FGuuJqwbQjnaKerupqUPFnf9Cy/F9m1yAlOuAnNoEosoxlgyCkaiTOwwWDuv eQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rjc6cqbk7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Jul 2023 19:43:57 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 365Ibtu7007290; Wed, 5 Jul 2023 19:43:56 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2045.outbound.protection.outlook.com [104.47.73.45]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3rjakc1rvd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Jul 2023 19:43:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SsJ/hrQimeyRZJNPgJgtMx4LXDaXayXIrmlAHaw/FLXmBSyCFUNWh786x6gB9SeFT/RIA35P6ZzM93GETrvN9gOrcuz3IR/7nbY15llvAe71U7DNH2xKgCjZYDAa40g2PjALgyKT4R2eRZDU0r2FwEyX0YQ3/z3H2B87VyBKRhEeSGNP5nDyn8m1F44espcOV0B7s4ai/J5aO4ji9MZLSqjYs0MhtGYATBp22HxgGDuDYyBe9Eeg7go5iBCd3Qf9GgV7PO86WG2ODi8BWg9Y9xnyEx9PzbogHVA6B3mJsXq0KrEh7uAjV5neuyMkFWO6KNRvKa6xt+VEXpaLAaUCAA== 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=LDBwrKukA1W27s7eOaMHDH+8erEXbwg6C6gQbwSy+P4=; b=RurhXM21TtBlnB9f3HU6PYNoJPc6IKWw4AJUlE9zQEYTKqs1UgwlygVfDzT3haDOSraFL1Ol8YvVq5NarN8RraGeH0tYEjYzQVhpoDN0GAMZPlX70A/fPtLN6u6C2AgEvPwgcH/z9h9Eab+dQK59U6l0Zv/UxF4a6wukYwg5r/C5ooVEToWZ5wpqBgEI1WzZmUx+NZdHwtpsJZ7yEWLRPM88NsJPH5boH9Cso16U42FiL8WmrBZXqpXxMCeEQAUhxkG1LxdwFC7ZUSioDxYqkRMTVwsAGKTbgPlcB8UgEX7mrctUXx5aEOdossa4a2yki/a2bkyOsPomPzc4Fqtuxg== 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=LDBwrKukA1W27s7eOaMHDH+8erEXbwg6C6gQbwSy+P4=; b=i3MucXkzYyDrwh0ISJ1VGP9V3GiTrFwNBSRtHUZUEnIypPIG7Wo//LWM37nDdAg3QXWp5AHUHuY3YLi9iCr/lZMwnRbCsiEYEcQf3zdbNgJJeEBcVQkknvGKUN7+oEa1/BGaf4kvNdqu42nKJMtTk/k9It4zH6CtKz92uJX50bE= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY5PR10MB5914.namprd10.prod.outlook.com (2603:10b6:930:2e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul 2023 19:43:54 +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.016; Wed, 5 Jul 2023 19:43:54 +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 v2 2/4] mm/memory: convert wp_page_shared() to use folios Date: Wed, 5 Jul 2023 12:43:33 -0700 Message-ID: <20230705194335.273790-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705194335.273790-1-sidhartha.kumar@oracle.com> References: <20230705194335.273790-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR05CA0172.namprd05.prod.outlook.com (2603:10b6:a03:339::27) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CY5PR10MB5914:EE_ X-MS-Office365-Filtering-Correlation-Id: bad443fc-e510-4d10-d13c-08db7d902a52 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +gkX63AxXbKqBDK3TzYKFiXmbFxica8FqxN1axuLAht1jXk2ODR1nDRuln0dQPmXe/uIDiLmGf11Mc6R8woucMA3VP7MNtAsevW/NTAAwCmLoWEcRXOJhATht7cWt36xpuN7CleLW7SdgJrT1lSiOTrzGjXNjsTpbHDyLzhQGFTiBF3tf3NPket0nHxRcK3NmBgQElc4AVGY6HY+47wymCjrMdrGdjPmks9Qh/BbSSn61ZTt4/PxgfjocFyYFptj+mvtUTWpzo4F2BCOxxPT8sR7zuuDRkIVHGeW2edi3t0FQ2ZP4aefrLnzqWkhjtTBx0zXy3fC9zs+WNY/NcN+IpZEbb/DeZS+CdWglGjZLTrym2VF7pBn+kemm/rhvK8V3AwG758+/qUDVViBbjzY1rvp1DYatkQQo6cZJtvLUdEag+/19kts6bjwaE12qy78hojQHtSfsSQj1vHmeTkN2LZMzsX46KuYibcURKrxVgmyhKj/l06xdkB//ZtNWOogoVz/CtsP6SNNQZoLjf9rlkHxFALl9vk3I8nUZz2nCtIGz6zvnWCnGZJlVUb2Do36 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)(376002)(136003)(346002)(366004)(39860400002)(451199021)(2616005)(2906002)(83380400001)(38100700002)(36756003)(86362001)(6666004)(107886003)(5660300002)(316002)(1076003)(6506007)(41300700001)(6486002)(4326008)(8936002)(8676002)(66556008)(66946007)(66476007)(6512007)(44832011)(478600001)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: F348Z0bOY7/ZSPXyhq286c3S3afRi87AZkWLG7UZXxZGU9PXruT97cdGa93MWU0VdtnMGgG0eGRQ/awGsHJMqIQ0QqHWoPSGE3hDfsYCQnDCPLemS+51xtUc4c+GMm6YF9l95viK9GPagh3+X9Af0nPvq3wO04rodO6W28PqJVKBCd1mSMY8GVl11Vgoao3l1VLGufI+5IYr2F1wYcLLyaRARaBKsQPQwQlRTXT90mxEmpLpp13kpF4XXGXesFi1h2vp6feLqo9J2v/CZF4RKCM0NhHoU0cIr336HOQ7VxZAcPEr5vTe2EwiLALMXGjms3OnqDi3vFM1Gzm4wCJKhylTmJajvXIhQEqW0Kr2BtL0iYqKa38kQGy8oiFYubGspbfjSeCMfnaBBFujPrVQDf6rE0F01bpTO817mJbPij6dW4AwYfCrTHXJZsjUaVOx/kSHkl2+GLoZjjrUp6OTHAVRqnlo8Jbrf0HNO3gtfz/Gf+6bWyfYWZofuJgNxuUPSSHvmeiEmgjxFGWpM6+ZLkWO1dxGf2NUFuU7yllY3Ylrzoq9jRT4qjRTj3BeeT4YFsSfdtDxwYnpv2dpJ4yZ/OuigTaZFS+RCrZeYDoxF0eDt4HSNlZD7d+yMr4zD2h9+rc+r2k2lVE1ZoMosN4Y5/FS3BCtXJmL32cnlB7nnAu7nyyxgef6/2yMcAGr7AKuFQRiXHhhX0KkP+quGaREspROaPJRnYQ5PtgDVHHNiblvGpCk1bQYL9eC9jvwjz25k0B/7GMQmsDZzUMLap4E5vtGLmOTYDzwYiRDXwzy5raI8OfhQ+MNTGTpW21Y7Swuh6AUmcUiSP6fBQJTdk0Ox6I5KPojkUvFtUahu4W11Zw6KDxFUwwMbUi+8fG/nT4N2vHPbEqfSZB2e5PjS/6qNEyO64kNNYhf2XCNQGTuheoEkao1JEn9QPBF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IrL0s0z58po4iEVAiWOEACQG9yivTWHM9z3xw4UCdVYpNMUSDpbpD1kdB2EBU7rzZkO8sd6i6PEIMWPZkxkJ2hXfPB54ABuLqO44M46blKMr3dqurILkcU1EUfKP/ZBuYQaCvPk85tUbP6wVPGGPG5bKTZY5Yk6zRhRsrzicLMu9Wdvuv8ZzI3qKllJI96vYmVmOGfIioHfzFw/anIVlPb2MSWIFR4xsnD4uR7nKoeVfbisnQo3MoGuRF3SQ9co2GRCQs44+ClfjYRosSHzPsFWOzWQc7/0aVAi787C2eFzLMng2RjqZjmbRWKIR4JLCVB7iQLqUp6Hmbk8ha2DRrdOObEfQCsRf9fGLJZ/Q0iHtDzP9ddHwa4MCM1+mOQnBjliH0BOl5Xg2cHa/5dVwFLOU/zX+ydKvGMf4nzpwIU0HRWZsZE4f6T00oji4919u7XZgGHyDRJzfpmK2JUDFkgrmQercu37ZnoqDaptKCb6ZYLMEL1M15TsrbBGdSgnevUltygVMToSWDVPcYKbctUVNh6gtPM6jUUH4KGK8wjPl8Ck0HGohCq9an6Rqe5x/Se1f3E X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bad443fc-e510-4d10-d13c-08db7d902a52 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 19:43:54.3643 (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: SxjNFEcEwLGVLWayNnil2kseefEOWWfKFgRhNLsZZQ9J3f8hjG00k+cG6e3u3NymfyRg7a9EeALfHa8sIqf0lU7wk4NCXOtLqwJccD+Z3Us= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB5914 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-05_10,2023-07-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 spamscore=0 mlxscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307050179 X-Proofpoint-GUID: V2fimosQar6boSLQqZVsYItvz9w4-VGG X-Proofpoint-ORIG-GUID: V2fimosQar6boSLQqZVsYItvz9w4-VGG X-Spam-Status: No, score=-2.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?1770611926052605594?= X-GMAIL-MSGID: =?utf-8?q?1770611926052605594?= Saves five implicit calls to compound_head(). Signed-off-by: Sidhartha Kumar --- v2: - change function definition to pass in a folio mm/memory.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index e73245b791a7a..fba33fb55a010 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3281,13 +3281,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; @@ -3296,21 +3296,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; } @@ -3375,7 +3375,7 @@ 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, page_folio(vmf->page)); } if (vmf->page) From patchwork Wed Jul 5 19:43:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 116402 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2098815vqx; Wed, 5 Jul 2023 12:47:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlGFHEEz8YzUu47NcP8w7ESTrIdJBuK0VakEvEFLoAgdbtVpYvBIwv1FGF1QWv39Zi65eXAE X-Received: by 2002:a17:902:d2cd:b0:1b8:1c4f:4f8e with SMTP id n13-20020a170902d2cd00b001b81c4f4f8emr20884493plc.53.1688586454576; Wed, 05 Jul 2023 12:47:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688586454; cv=pass; d=google.com; s=arc-20160816; b=K788sn0yU7moTG9Bcq5cNggJvvLTrohfahBN9Rnp4J2/2zlukU2NV9dEBoCgmUb4wx RkCUPr5+hdeffl7NXsZl7RzomKG3oKuf1P7D7H8/QongTD6rmH+TfCSpaHYPxnH+YetO YRAxcDW4s7lHRHeQT6LKWkm1PLo2MM++zf+nYtiGnq0P1RldFSkiRZQFSDzWApLn0BKg KzqgflLxAt9SgBpfUwRRkQKGw2Lsb9Oo0eBh6ZeZ47GfhkFCvCoGOoD0QEoAXpK/OCsf nn+tckX6q0Cp1rYXMexRJGiQG+ACp0QhE0etY2qqZP3P5AMVsx9zJELAjh/V9I8fGSNO kHaQ== 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=kLaVdzqwzCfX6zaRLf4aFStQzSFEnzVid3+UmntP8l0=; fh=/9bfJsMG+/3rgG7nJ9LKdUdSJTmdx8OfkQbVdkOHqG4=; b=VWoKNnj6ANCrHJF/DmeOLtY3TM5wwMaBg+awVP15NMzbCyutfr3cnzOgMo+SAIbbt/ VMQOJpplwsq28EYbKEYZG5qmcgLURd3B79Kq8bKbWQ0a5J88brjJOL37LzzIjr6n/wCr 7ts2vXDsVb4+pzT9rdFwo6Hy4zsV9pQ3yshYVY6g3vyLJKkot/XjKphcccuuQ0XK/fou 3ZBXvHXej9ZO/XuhWuyVqwegNfX8G8BYqC8XVOHSyjdzkNvNkas5nzrZWWt2BrKJz0Vj pYLNOqs2OMkSMUzYrZmTyMspAzGmIKTiaZ/2Q/jGJgTYtorIlMvpqFJC61dIqr0iNf6J W65Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=x2MzM4Jl; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ZoOzrdxs; 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 s7-20020a170902b18700b001b69bc74fd7si21814441plr.157.2023.07.05.12.47.19; Wed, 05 Jul 2023 12:47:34 -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=x2MzM4Jl; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ZoOzrdxs; 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 S233588AbjGEToj (ORCPT + 99 others); Wed, 5 Jul 2023 15:44:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbjGEToh (ORCPT ); Wed, 5 Jul 2023 15:44:37 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DB231732 for ; Wed, 5 Jul 2023 12:44:26 -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 365J9tk4026780; Wed, 5 Jul 2023 19:44:19 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=kLaVdzqwzCfX6zaRLf4aFStQzSFEnzVid3+UmntP8l0=; b=x2MzM4JlbMZ3e0n44T8TgkSzrzLnEMmtVHITBFZ5UED/3IEf4pBfNZwFf/5aHvIUDORV 0q+00paOgBRWo27Cvr2rzPQw9ziTDCJcCuD2qh81YmOUn0naLXjRnIZfBc/YtvJ/Q1Fo Yldm8Zysm2hBCBSsJbgb+1zpuJ18YKcqrqCj4Ela2GSl3ZQpWEtWgzTWZoRDmhZtQ0OE 25yZpajLOajIr8XOZH7dG/ukEWYPGTJIYj/hK1F1vjh1N5vhnhl5ckVPZwiSSWX2VBaH 7L0IdsG1d6yyiuvsdBrjkROmTPhawuYvyWvpH4V9ZQpPBp8FwVXSpDFxB9X6/mQ41Xld LA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rjcpuf8rb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Jul 2023 19:44:18 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 365IlhXt025202; Wed, 5 Jul 2023 19:44:18 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2177.outbound.protection.outlook.com [104.47.56.177]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rjak6hbcj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Jul 2023 19:44:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GWBoPySkGpZ8revh/mOSdm+RFBoO0gRWl8BYPv0lU1MG9kOrqGXzkFQ+9zNpQrBLCgc4THm5hlApxz+jyxoGJilE7U2MfwAEj166X/TMlNsFV3gAJamtfPbZQAxfoWYOd+TXHF+DIOvYthDmc09Lx68qtSbRdKW6ssvrjKcGz/h1CcEZI3fc7aM34HtlMRLvXeLawbZW/YLoReVcFyxwhib/4BH706iIrmQ/rWII3oswvJhYzWm2iWq9tDiCH0sJafiriZYOmf/+o0aWR16K1d61G4B5WIHgO3D40C4wOnyHnZ2GCZulYh6NclBG/q0hZE+6HlrB+S4i/q1hOMnLGA== 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=kLaVdzqwzCfX6zaRLf4aFStQzSFEnzVid3+UmntP8l0=; b=aJxbo2d6jWXxKHY+Q1B82OFzKK/We+PPmfFlOLTpPf3vNrzjtSGVbcU/QIZNbO+kgLSNt2ICUkL07EVjKnAF07GtdVvQrjEV4vUrzrtvUQc/ibbW9v+HaD4LHt3jlVyYyIGsEoRC5e1nlsZpVCQdKldn706zDidO6w6PXyAh2YPNsdcl3cvS/KqLQVWtVcs3qKHe2UanbYN1i8wf2NzcZ/fu4x69SHtr9jVMekL+7bFj9KSXjVX6wgHO56KQj0S/h3uD22tSH4OGBWlz53GE1mU+A91MNzH8nkPc+a6j8IcmKWzxh5ObR/C/fu8NlmlfiALZWrGAPZxdvBXlI9neUg== 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=kLaVdzqwzCfX6zaRLf4aFStQzSFEnzVid3+UmntP8l0=; b=ZoOzrdxsxKhhQ4QuY+kZskTFBCw2Y1yIzuSLko5AAPb+ifZd9RsYYn4CWf0YZnHuj8IL9a1Tn1EpVg1Hd8bN5R4SaWhAgfCM4xcjaWhJpM+EiOhcRMof6Rxsk2gnRnJmgmGGOtPL0VSVk8Cx8m9D4qlp8g2gWm3YbBCu6WcU4P0= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by PH0PR10MB4533.namprd10.prod.outlook.com (2603:10b6:510:39::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul 2023 19:43:57 +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.016; Wed, 5 Jul 2023 19:43:57 +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 v2 3/4] mm/memory: convert do_shared_fault() to folios Date: Wed, 5 Jul 2023 12:43:34 -0700 Message-ID: <20230705194335.273790-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705194335.273790-1-sidhartha.kumar@oracle.com> References: <20230705194335.273790-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR07CA0103.namprd07.prod.outlook.com (2603:10b6:a03:12b::44) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|PH0PR10MB4533:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c08156a-b109-4c87-ba1e-08db7d902c17 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x2XQm5U8O6IG9gT3vNn/WG0GEpi1EPeM/5lePqzeAW8dP9EFQ8hC2EOw44mJ3o9K2zjk/OHXblOoXfaXPMr8/pYDIBRhjQRZjLIJhdJHQRX+fUbF9kZFbc1a1TAmIG0JtnuhUzOhh+2cYRg9FFO/xpVj8xByHos5c8WrWbmk1OP4p92N66hHLVVb6avl9LF63v0IE1h0aB24BlYE3mdQqtgao+sDrLgoU/S8rZ0yOLn4f2R+rG5/KYfVmb2sPAmuGm0guzXFjKxt6J/a9k+fRNEOnJKoY6HKmLgDq7LXfgryIv2dUrIHSVrOqEEg3Q8RwusJ6WG6m5uWSUYCmjcuRLOdMyb5LEHOXabZHUe9tycMRD7+E5q0C4yg5778pwfaccKhCcJzU5rwaooymeUr9gJoBE1eCYtQ1BFRgqtIwNcuFkwRjHHNc0C2tjcrbuyzxqqXRPK8smP1yGChRDG+q7PFQx7cRlrAS5swKnA5st5EnvRDdW2nPuaiqafBSmLQaD2GU80zaF8e5tEA4/VnxisicLjFUYpFzZEHtRyBDleB6A+akMhj6F3Z9Gv7fgQd 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)(346002)(39860400002)(376002)(366004)(396003)(136003)(451199021)(41300700001)(2906002)(5660300002)(44832011)(8676002)(8936002)(36756003)(86362001)(2616005)(6666004)(478600001)(107886003)(6506007)(1076003)(6512007)(186003)(6486002)(66476007)(4326008)(66946007)(66556008)(316002)(38100700002)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-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LQbrxfyWaoffDZACmFJFTPfKHSGWO00k9+ZBJqqr4gXfZL4uBrHyO6X7Xm7T4c7Kx8uNqYgcKUSC8k4V7ouANaV2MnLh96s7d8dJxINmrKdicUwiOCpPja9xVrCsMRSubOPEun9uEfR3siraos0ZIHblxwRmmQsPEf6TVB9sPg6ma6UHfeu5oDqR9E2RA4mzhqYr39pAUc/OaO7RBQRzrpu5qK4ekqDchMIK9W8SZTvA6Z0LKNYNrGHHMRM1y7jCS+Dl8Sdtnk+ZmjTTIhCQ771n6TJB10er8nofzENwLy4YBVs1NsGdsp3JE9whwviYJw2D8QKLMJEbgHTOuC/uSCxfB2f6lJQ7oLbliS7EjQwXZug4TuqwD62FFI4neVI8HENrEqz8NosS2mPGyLoFTF81GqfZnU/7VJ1wEhvunLtKpKa+tv+La4648ogQaufSYNaRHb+bqSxnLPpAQT5TVqlrR9rRpcQ5Iqod85payPov345tTTNAAMAnnp/8z8A1lV81vBN1xni63Ksco1+zrDl0HttpM0xnTj1jWSCSX6goJy8A9vUKliFVcacwDmZI8Ern53zhOD52PNxsTuuw= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: VobPXkaiKw0dK9ceKqrjCVqPlsLaVaN0OvAi0NWxDQyKUnEI5JYciOOAUfwJ51rAgxuRvQkpln922PY8JhcgkB6ncaVqtDHeYUaAHtE83Uiwrk5I4pnz3p687HzWpo0ZfMTF/F3+A6SzixAe1oXBXcgX/bdtT095AAxFmk9sef00W09IsP3A4AKhj2TVyCCq9FwoxEzkUnpg3AU77JdlL9ZcjBhAb+hLxxlfKUK1Hmzl0IcFRp3asQ1Hh+yJYmVeQsx5GWDl1X30P26lLTYodx8HNuJnmgM8C5vH7CcNjiubou9St5MsyNJoBEXx7A3KhT9sogj8SwwxQaSbQVlSXY2StXgsu3mOzcwd79K18MZu+qunPF8DX+6bL+bumS5V3PoPEi5uRq1QiZUZVZwCqS60pTE9NF3MDp141bdm47+wkJC9BseAa7j0z9xi+gxh2SajM1xqgcUvpD2GdzTKYCo1pHnlEea3E2U15nPT9ZdAD/2LigzE396LqGvQntAiD7JAw2i+PBF5E/x77rdhU4/2iq5bY+mzjTA1rX8v+4y+4uJjcBEj7DTeuhL1ExgJlOtwFNu3lwscLRKjzGJ5ZOPJ7qRYG1JEK9NdqSreC0erYw4aJ+m5z30HEHbG7CRcUwpvhS5zVCppVUrkEpRZ1OOJ+OeHMIf5Agip9fSkNyzfFejkRpiryb+t0e+3UKAyUEJLrsLCzrTVUEXcctd0mg3dkXZJNcustULs/QtGhhBpMIiiPOttJaUywQaSh3ihgWRprj2lMz/Y7ZlUOthOC38XjYiFxskU6Ik1dAFKzmhC+dvdh4q6JNo/t6R4JyyziAMImlMx4TQP8N541WXzn5PlckY7xhI5s+TGpbgZlKoSKpxMlahHyMlmrpE/Rxr7 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c08156a-b109-4c87-ba1e-08db7d902c17 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 19:43:57.3394 (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: TBTQOV3I2JZB7KSkaLLS89HVu2L17r3/k3kd/D7bRLd8VabKWZYc18B36OjuRH2Kup009mqaLjdFK3PLmmd7dbH9TDkktcARWHVq75dA3x8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4533 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-05_11,2023-07-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 spamscore=0 bulkscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307050180 X-Proofpoint-ORIG-GUID: M9-XHpMHVJl8IMCMoywoSL_mP6h9dm9h X-Proofpoint-GUID: M9-XHpMHVJl8IMCMoywoSL_mP6h9dm9h X-Spam-Status: No, score=-2.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?1770611230643930621?= X-GMAIL-MSGID: =?utf-8?q?1770611230643930621?= Saves three implicit calls to compound_head(). Signed-off-by: Sidhartha Kumar Signed-off-by: Matthew Wilcox (Oracle) --- v2: - move folio initialization after __do_fault() mm/memory.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index fba33fb55a010..ce7826d3f6200 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4593,21 +4593,24 @@ 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; ret = __do_fault(vmf); if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY))) return ret; + folio = page_folio(vmf->page); + /* * Check if the backing address space wants to know that the page is * 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; } } @@ -4615,8 +4618,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 Wed Jul 5 19:43:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 116403 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2098818vqx; Wed, 5 Jul 2023 12:47:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlEccz0FNTw5kl+1wLM475ztJgoztnZzDDtKEcEtXtcJAqBQDCpdLXFlFysniXIreW7ev3oX X-Received: by 2002:a05:6a00:148b:b0:66a:2ff1:dee3 with SMTP id v11-20020a056a00148b00b0066a2ff1dee3mr21046912pfu.6.1688586454869; Wed, 05 Jul 2023 12:47:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688586454; cv=pass; d=google.com; s=arc-20160816; b=AvyKQw4nei44Q9pLML7UGfCOuhm4f/fmdUqNsDdOJkSUs0wdtiaayR2zhQY3bIs7Jh WuE3gWACycpAVhMUa5H3oMH7phY3os4EpyP3ZUShqDg8dg5YalS6mtzc3t02TPczZxVU tuBbUj6cKbLxB3lafso8vUcy+j/zJ+v2P9B8dHPqBeLWziH2Npg9Y9n0tyqaoSIa/tyT /gGI2vLEPGiMU1cs1gIEDO2xD5wuJAPl2delXxcS93bmLai3A5EmXJ5iu5ObiMeqGOF2 isBu3TlvULrIkc6LEoOA5iSfbllZWw43wFex3CpFVdw4rmTku7XFnhlG7FjbugX63BJ7 C8eQ== 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=WQEnffaP+1i+leegzaQJ8pj5MOjXtFFS0B58kv4ef+I=; fh=/9bfJsMG+/3rgG7nJ9LKdUdSJTmdx8OfkQbVdkOHqG4=; b=UvnNKgq68jpnX7fhZKub1pvqBQzr5cA8+WCKyj14Vw6c1eVoxiueOu91STd8dsAl/p AbtmdDHabbt1WT0UZ4fYJ7SfGL1odBoZyJYRW7tV3Pdef4tnFjF6FHKUkczrKr3lw99i CD+AfuueWUwNUHAdQw/7yNCJ+z2FLM4pk8LvqNzUaU7N1agFbBoBTuC6zd+HgtKcfcGO 0n/X8ZYmjL/12SKpbOoDm9Mupt9PpHa/5fLVYWKlgmbdDhAp+Ehnv8SZX6xwbHg48PA6 7CfAwx9gyUV3O9C41e4Irhi6kB9A5/DYoDUkBSdJDBrA/QEos3vTlJk0cFLJIL2ObB4p e/gQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b="sJiU/kNo"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=MYp475Qv; 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 e185-20020a6369c2000000b0055aff745fe2si18416740pgc.406.2023.07.05.12.47.20; Wed, 05 Jul 2023 12:47:34 -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="sJiU/kNo"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=MYp475Qv; 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 S233683AbjGETon (ORCPT + 99 others); Wed, 5 Jul 2023 15:44:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233593AbjGETol (ORCPT ); Wed, 5 Jul 2023 15:44:41 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF0511725 for ; Wed, 5 Jul 2023 12:44:29 -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 365IdPXf005170; Wed, 5 Jul 2023 19:44:22 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=WQEnffaP+1i+leegzaQJ8pj5MOjXtFFS0B58kv4ef+I=; b=sJiU/kNohchCAn66vJ4oux139locQsDQPTmm+rJVX9Sb5vmQM9OMTljJL5AgrujSYFCz VnO1ecY5dsUCGZtFxPmZ6cwpGBYeny9aKpizUN1A8iROhlcyTdE3vw588BOUfdRAUNsg EIiCgFmgCHRHnmdf1NOZ3jmL8gEECYTspphDq25JJl/JG+wGUAyrOPWWUCiRgF1qtW8p 90Wrb0fZ3RM3XQOfg4lFhoNMxgu6aYsjRMmHBOLjukxWlhTQtxAO9QNuZEYv8IkYolzb Bkjy6tN9gsNuSk2jDYWFdWLVWBl4tYaS+N2kKAHOncBHbk0341JMCOVswe6dFN1Vu1S6 1A== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rnd8q86ns-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Jul 2023 19:44:22 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 365IlhY2025202; Wed, 5 Jul 2023 19:44:21 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2177.outbound.protection.outlook.com [104.47.56.177]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rjak6hbcj-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Jul 2023 19:44:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gHQIqLqBP/JHz++MKOWoOFVMrGrIYajmC+3MKh4+Wq4jTuOIF5Jw+TINY8PTNVFoiwTNBUeF9tWDIsD/O30NnZUY3mfjEQIXiLzKUksNTCx/xv3bSZqNDkD7fMWfrg0hVNmLuyoRurBJbLVGkhQtCUv1PoxV9No0AfXemOXHON40wPQDZy3z4HDlOO1QGvdjGV2QXqwwx1ibaV0CX08Zkh5yr7DYDwje+gLy/9m5/fJHPRnBWk3+I89qeISnEv0bG8FezYI1qHJeCB0v5qoXzeBxpO6N9kchur9XwYXvmUqjZPKNHP+simf7tQISJqTO1rxh1/JOyciw0aKOPnNHZg== 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=WQEnffaP+1i+leegzaQJ8pj5MOjXtFFS0B58kv4ef+I=; b=j5wbAFhKgX1/r/JAH2qGPgioZCtWgSFilCgzv2q678nghWHFuucnUYimNBFCmEEVpKjYFMcjsI1qsq/rTA7AzMjTrKgcCpMjFB68fnZFNaf0kAGegbvREU4DUksOmYRyLdSP1M/B8wTai79IfJ+VEojCmlU6UZIC77e9QrQ45CE/IENejl2bB0zJ6ERfj9SNBMJWfwJzmmddVeinyL3rP7IdzSrVrVQE8rmYKyQ+IacAqXWZRJiSEYNi/jLxdrb1pL+1Q9+v7EOnQqibJVKaWEGeu3L/ZsOHHqp+cpXY2+V85ocdANFS3iHXFOPN46zeOs4KTRLknD2PDBdgJb1S9Q== 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=WQEnffaP+1i+leegzaQJ8pj5MOjXtFFS0B58kv4ef+I=; b=MYp475Qv6q5DtvYxZ2CRFdax/1Tt1I5fJsFx+h/AJ6ZIOS2U/jnsKFlB2VeeEpkqW0FS9V81PKH/ByXE4hWh8BXiWQyD2F6W7voVNF+wMeiJq1cUSqh6Kll0YBeIY7RPXIo2wBE3Z2vNknrSqbif2ovh+BTPXcNPjP4SQweg0t0= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by PH0PR10MB4533.namprd10.prod.outlook.com (2603:10b6:510:39::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul 2023 19:44:00 +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.016; Wed, 5 Jul 2023 19:44:00 +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 v2 4/4] mm/memory: convert do_read_fault() to use folios Date: Wed, 5 Jul 2023 12:43:35 -0700 Message-ID: <20230705194335.273790-4-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705194335.273790-1-sidhartha.kumar@oracle.com> References: <20230705194335.273790-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR13CA0121.namprd13.prod.outlook.com (2603:10b6:a03:2c6::6) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|PH0PR10MB4533:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a52448e-ee75-42c6-dbda-08db7d902df6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BEOD+dFO1BUxep43/2bfv+1XNuNQ0YZwk0oSLRgO2c4rzsxT5lwTOzvBU8O5ulZpNYpyfuj5m8oyTBx1MIoUoDNTzzfVJVV5EyaMd856iN2oUX29GM+sD+BGs+0y73uj7hS9nRmntRQCvg3AdC2cHvW8YYtgwTfOAuMD9sMkEu31qAOPLMqTRL0lyZ2zYIrojmd/2++PUUHboRimDdUMfMczesx5WTz51SqOlAPi6cqtIkByCsOA3xTW31+0cFeBkyWbmq/RXPGhU0bvDN4fa5iF6lkYUiHbIwDEwTOfoU7tQMQQVoxfvE7NKNb5zez5i8MKB8zN07N9sgo/JF6sgPy3Y26zUOCfbkcmLPI/A04nYRvJ3xvYFWEkvIGQjZmC3TST/TaH2Msj/iHlgbpXlLHtD4f7GHIla3U6GSbgoD0G/GnKqAmbrJCS1KnxAFe19jHU/RW/NvSeMcjUmiQcE7r5gC48t/rbZn2PWf89x7F46W1rjRsj6tZDgVamuIRQkGi7CoRq6NxT9I6RkWqSFyb5rYQIDdIuyDwuFGLdhNSeqyj1CO6f/FFLs3dNvdWz 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)(346002)(39860400002)(376002)(366004)(396003)(136003)(451199021)(41300700001)(2906002)(5660300002)(44832011)(8676002)(8936002)(36756003)(86362001)(2616005)(6666004)(478600001)(107886003)(6506007)(1076003)(6512007)(186003)(6486002)(66476007)(4326008)(66946007)(66556008)(316002)(38100700002)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 79kM962sxqC3+DhR2JXf6iWBttD0BMv2oop6jdT12a2tqZF/5hi0XT+Llr9qRw3mWgMfhcdqq9Zc8R/3bloIowXp0ltguQGPmS4UWSPPBHKjYH6iclsI4zXal8R6DRMGfP4vJplNewndQfvu1JPcyum4HBS9221s0DdEHCsS5p3X2Xu8rbNbI8ytELISkHBv0LjcGhiRtiONJZJgNQju9fIVZptw2VpG3rglBugQzeHxCpP+3kUJEWLWLd/vRyCK3nC7MraG2AqFT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6mgu6zvQruMRYoVNnig6XdohEazSJ/sm8LCDF4Sz4tVBmycDA0yzRJLVsBor3KnmyANa8GsSThdfhaSJeXaGSOJuAjGtq5ibt1PtTDuN+jRjApBccvxFna051pO737b81o3l+B3l0VT4hAdM24ikTv+BHHKVyrX6iGISdukAbIx9wXy2sTcROY7glQ1skJJGEtbTiUgUaR9GT X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a52448e-ee75-42c6-dbda-08db7d902df6 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 19:44:00.4558 (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: JU0PtL9WgMh1oRGPn4dGDPKFseA+nSRdp8jX4M1WLywGHjehbqr71/+PLiKn3NElXmyo0VJRYdW793LhRMuh6L3I7QZY7Ddt3HAOTzgQaNk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4533 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-05_11,2023-07-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 spamscore=0 bulkscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307050180 X-Proofpoint-ORIG-GUID: zACk8YPwMVg6eNxpn9tX93_ogJ2CbmAt X-Proofpoint-GUID: zACk8YPwMVg6eNxpn9tX93_ogJ2CbmAt X-Spam-Status: No, score=-2.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?1770611230662317222?= X-GMAIL-MSGID: =?utf-8?q?1770611230662317222?= Saves one implicit call to compound_head() Signed-off-by: Sidhartha Kumar Reviewed-by: Matthew Wilcox (Oracle) --- v2 - move folio initialization after __do_fault() mm/memory.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index ce7826d3f6200..e40a03e488ca2 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4527,6 +4527,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; /* * Let's call ->map_pages() first and use ->fault() as fallback @@ -4543,10 +4544,12 @@ static vm_fault_t do_read_fault(struct vm_fault *vmf) if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY))) return ret; + folio = page_folio(vmf->page); + 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; }