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: 13302860 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9228DEB64DA for ; Wed, 5 Jul 2023 19:44:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B40158D0002; Wed, 5 Jul 2023 15:44:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AF0968D0001; Wed, 5 Jul 2023 15:44:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 942FB8D0002; Wed, 5 Jul 2023 15:44:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 80E0D8D0001 for ; Wed, 5 Jul 2023 15:44:08 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 1D833A0416 for ; Wed, 5 Jul 2023 19:44:08 +0000 (UTC) X-FDA: 80978584176.23.2D64C1E Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf06.hostedemail.com (Postfix) with ESMTP id BFC1C18001A for ; Wed, 5 Jul 2023 19:44:04 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="FnAs+C/d"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=cS7Vf+G9; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf06.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688586245; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=kw6BRq5S7nlCZ1N4MuCx5rTYDaTeRJQjFn2jRhBUINE=; b=LQ3gkZTtqTwLENPbMJ0Q+aDv3x0V6i0+roIIVfRQysuEU5idw4H+IVClyMCTMWLJlnM/MG DJlWCUxOPBhbO+DssgQwbjcfQ0qz+kzKcNOE+IPxHqqzEft5peDUd9jKKeAatYIQCNcn5k a5HUH5KAF4xwplP33u6mXEPnj1DYRMc= ARC-Authentication-Results: i=2; imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="FnAs+C/d"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=cS7Vf+G9; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf06.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1688586245; a=rsa-sha256; cv=pass; b=MZwaZiWQV14BZsiLN/TwslDE6zPqg5HTl0fTSZHgErFuS2vxvqcPZ+qqVAe53xbUFS485l gZDWXr13fDS2ssVYrIaP+TWvxlSYQcrDLVYk45gEAotGcS3TYKoBqwgie5IUZ6CggCBeFT yJ0BbH2zKDTuaevRbx7egyvbYR938ec= 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+2tC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LfSwqMNC2aP6hmOfO+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-Rspam-User: X-Stat-Signature: jdyi8xghabhgtyug3bbitjgo6e5yy74n X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: BFC1C18001A X-HE-Tag: 1688586244-46809 X-HE-Meta: U2FsdGVkX1/8+n53GpK4Fafupvg4c9smvHchCa791INRVLNDTmpT1EHikMBypdsZVfGhyUH3zBfGPMNyRUbe53pmjmObRoybKF+GxBzalobP/1F8iQlw3D/CMRb+X1XYqhzpf3p88OmFqDXin8y2pX5hdnQ4tQoYX1B6GApliYB4a2LfTnD4tYXnK8e73/WOIsYM2qafwekwk8J/bHh3g8YkGyemlPKNSy38PSckjSy1UWWwTR3B9BAL7MsAg9xzrhBhoXHR1pOuWPiN2oW5lUU+NGz2Tzbc1rpzLaCGaOvYRWvJgRYD88WIvu+dsZYAqGpDodr7S/UwckeHu2smQA71Y5NuFfWZuufZsEewkED2q2zCarwJOnIxwDNDLrpnNDACoT0nmKy30e8e85phD2hXvsXeZIjEYU9U1Xj5YNTT3GQfL4GiPVN9vahKIvJ7laaYrUiWJUIqRe4YphgP64m/xVk5u+RIQFolgEd9brU+0mDCrZ795HlzGhUdLCwcEjXvPwWE1TsezNg429a/p1+WFN3GaL3a/XSujOAYZ6lJv/+5mO2afzczOZXAY23PsbD+C1IvP2jzZPpQGOpJBLivhqWG2nLniWg1w+iHprlpaV7XpRXMu/7yjUQdI0//OOX3fpAI4Y/YNYeduYzhSoEufyzu5++l94bBESSfLEofS0rqwu3kwsiJNG6nAIBXxgP7gWh+idmaip9EHIsF70Feh4nAifLmI8S5rOU+8ghwV3/dk3pnn2D7S5W2rD+KnFLFJ/cGSFIo6jIxYuIlTbxQkpvzl9pOAReTD/v6ywnN3kJ9sAObGrhoJZ6vvZ/ORtEmKSqfgFF7f6rMxxw84OheYKMn6LqzH6ggZ6LItka7SXvO4bDFoxUOfpaTz6rXZIVPiqvk3r9jk8Pp8UNpxInB01eDZuNYl3h3sAGXh9k3d/bpq0YSbtpDWIvkNKNBnu5yFufQe5xD1QZqcB7 S1XyyBdm C0yjldvNYJmWMfe3pYi8VXUXgOkE0HHC62UCZxyjRbC4e6jYUV4sQhmr2UskzzwYGy6oVKmODuo3vnXiB8z7ihZxzxxC4ImwLDJOaUbLiRNMRZYRgCe+Lvrw49Z7DWAZu4/J9WvePcAqx0lWB8aWRCPuvMEYaoudes9EuofM/2gPleI4+SHMpy75o3QC396xZgcEG1wNJWxHhqFy+ukfdUGhAhM7zTA+fhyKgVvwgcUnbsfxqPM5cyPOE3B4XySkclDY56wUWicnPLOsWpTJg9Ie1SVTWgFafyialC6s7yy0AJV7KggP1x9tVGlyGzpmq/XJ+Pwgfm3uWaUFsVSifn0DKV3oIuQsDgPTj1uNJcv5tgCBWFNeAG0yzWyt0djN5+su5bjBWe+AG59TDilx7hmr2QpMYQvVE3NtosRHjJx7I4GQ= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Saves 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: 13302861 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55C2FC0015E for ; Wed, 5 Jul 2023 19:44:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1097F8D0003; Wed, 5 Jul 2023 15:44:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B7A78D0001; Wed, 5 Jul 2023 15:44:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E4BE68D0003; Wed, 5 Jul 2023 15:44:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D59288D0001 for ; Wed, 5 Jul 2023 15:44:08 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 63C9EA04E9 for ; Wed, 5 Jul 2023 19:44:08 +0000 (UTC) X-FDA: 80978584176.20.F63500F Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf13.hostedemail.com (Postfix) with ESMTP id ECF3C2001F for ; Wed, 5 Jul 2023 19:44:04 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=bhgIPPYR; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=i3MucXkz; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf13.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688586245; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=LDBwrKukA1W27s7eOaMHDH+8erEXbwg6C6gQbwSy+P4=; b=AWFgcP8QWnf32yc6MAnbaopgWxmF/BjdoA7QiFlyJ5XWAchLDdVdGovLrpxq6wy/ksY5lZ uxNNt8nx3ZGqXArWHvSbZ0NIj+uBxyzPGurE3Wi+iICwk9enmaDuPY/3RgFd+fy5BGrdlc HjV5BZmagkn6BMUP7OzLVqVH4oI/MdE= ARC-Authentication-Results: i=2; imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=bhgIPPYR; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=i3MucXkz; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf13.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1688586245; a=rsa-sha256; cv=pass; b=sAv6YWdtCRvCL4ZB93zNYdKCq7fvS5Tm+SKwnaDZAWp6v4aLVYjaqXqC77TUzAneWcxnN4 DCz97yzcvJg14bID7jqsb7jQg45SVFE6ygmolznqQu1zhNEgrBeP+5Cqfao3BtZ6UcFPIY jrhQJNDNdCO2YVJW2vxyIybbJXEGFDA= 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+quGaREspROaPJRnYQ5PtgDVHHNiblvGp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w3cG64fhAlXvn+QBENZh96BFS//4/afABCaN9UmaCD2M+ahyO7FViuSLcZDpGQx04wG7CMUEXMD1JvoNfJR6VH4kLr7G3dugQgfiK1m+r9O+7cCanwWH/ctGHzOG0OgVKZCOG8Ky1lR5gOexTAzfNMRU1QRLJlTvnpqMeyLclwooUvyBGJRqhA5sBYDJIIyd6XmdGBCVdDCNJAm5IrL0s0z58po4iEVAiWOEACQG9yivTWHM9z3xw4UCdVYpNMUSDpbpD1kdB2EBU7rzZkO8sd6i6PEIMWPZkxkJ2hXfPB54ABuLqO44M46blKMr3dqurILkcU1EUfKP/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-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: ECF3C2001F X-Stat-Signature: qwd6e5i9r9446kzamsaw5c3bdqbwk5ug X-HE-Tag: 1688586244-33226 X-HE-Meta: U2FsdGVkX18yHV8k0yhI57gk0b8bu3osDr0DgN0Ae0ehsG5kT95moDxagSNEIBCAR1JsJeA0xGQbRBkhPZI51ffJI5m8BssNd+N200Vc+QYCAui+zVGidPclsRttaCuZUxym6x2CD+2MttgA2sZZJfIno+YXvzBtD+r+KQ1p9RkVs9oseiSyQf/Ir9/q3l43xQOhp+3pPOCEK0+REcJ4lN95FyGRQgeskwP9pEb2wOd6+7l4Pup6ndZw4FBC93wsTWI4w4Loxh2730EQj+6omKVD3tlTPDuMkp2j4uLgj2gfBOXsDbHKAveeScJgj97vyWQrLLR1lnxRQ33eLBibxoRF/OJ7QtkTB2jByedwQ7lUXiBWoF23Cdde3/N9c16F+h7zHbkFbuJUScxvmfkEz2V5ZkGc7RgIOV06o7ZbjCQ/kXRkhSmhpN9x+P4BrKifC1gnGM16reh7HLjG36ufsUua6MTIIb15T8sr1zLBAU8zVwp92dXvPbY5aocq2OIpTYpNEVsBtKnEBrFu2yJD+ISYmb79S/UI4v0/lETG2u8l+4i0hMDC4XNvByb1xPgqu9+bEsS7H5w+lJ2CCSTX90yCsKi6kSMr5h/xp6f6epptMHfPXnKCjDtg66OB2OF0K//F0WGjsOcxxVLzPD4biCxprVjsRAiC9rdm+TIAJyLSe31gBTYeXKiRR3OjJFHqdf+a8i5v7eA2nFk3PTV+FmwBjqUGnrU6kXywamxMfiFxsrD7eOu9ohDrh88OpHPVyghZOa/UwB95p5m7ImHeqqqqLdthgvg7tqzYtAEgQWNcnabYpHZ0JkMXSuroitrdwH1U+2SX3VvyIZMaKMRi/+zHTl3B1P90GxgwJ1N1oo9HuusJDIicncnXXw2YaiBDPvLekhhyDfPSsZmxPMy+mxgmChCRJXYmlXRwewj4cSrX7/ASBqKsEggG49xTU/d/Iws+55smMzuoLJX0fYo MgPDZwvN zCy176s019oxPhSQuE2qD9bnZrmZ2T2BMN5ScH1QpJ7c2pp68PHFNd1yUids9JYzUfw/elPDejYnIjHNbcPdLXJjhE/pxL6uGsrAOTuHocH+Uin1Xal2fmrb2+D2ejSAjHPhLRSHtqj7GXqd2IpKzY0bBFAQX8qgNx48NyuGmz1JFAThST25CJmayLtAOziL6D/UKUWLdyIl5iEaIcrQJARrTFi4Pv6wY7okDbWxkxJtW8OL9RASxYee6MXKN3zgMYXbGeOeO7ddpvgbv6qRMMYUlRIo4V7ZlA6b0NZTKHc96RN+XniFzx48pbfbJddLtzr8EBOeea96HLq+Q8lfj8ZK05KXMIICSFE8VtYPas26eRCvlO0XxnHsQGLne2QDCn5MWwkx0uoZpImUGAtv/xI3/e9MG4M9Jb+ua6Ibq0LBiszA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Saves 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: 13302862 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8E4FEB64DA for ; Wed, 5 Jul 2023 19:44:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6FB458D0005; Wed, 5 Jul 2023 15:44:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6AB188D0001; Wed, 5 Jul 2023 15:44:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4FD458D0005; Wed, 5 Jul 2023 15:44:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 40B598D0001 for ; Wed, 5 Jul 2023 15:44:25 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1671F40241 for ; Wed, 5 Jul 2023 19:44:25 +0000 (UTC) X-FDA: 80978584890.15.D30F82B Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf13.hostedemail.com (Postfix) with ESMTP id 985DB20021 for ; Wed, 5 Jul 2023 19:44:21 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=x2MzM4Jl; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ZoOzrdxs; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf13.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688586261; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kLaVdzqwzCfX6zaRLf4aFStQzSFEnzVid3+UmntP8l0=; b=4gh3B84VlxIydfaF45OD0cI6ibOvn9ZC8iRO4PmT8Mzhzf2VH4dfwKkMMpOlc2eXOrbBT2 sXrf+kai25qE3eZ9kSHO+JGX9h713Jr3wQ6TvxCD9/4aZC0AAxK8oOj2f7vcgS7YJ/f+9l W7mHFqu3PZkpvYNo+fC04OzZHhys0HM= ARC-Authentication-Results: i=2; imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=x2MzM4Jl; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ZoOzrdxs; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf13.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1688586261; a=rsa-sha256; cv=pass; b=on+otLyA6j2oubRi5wS3E6umHzlOKPEz+LH48779V678iSb811NBVXpuO3+VznMfQ8NbBG x0Uij3nsfPus1LGTX1xqICuYiVON5I17SJmnzIlNK9NUZd4Mlngkexb/c5vneX/59Ic4wF op9M/ALtfyGCfJMxW522UrLN9cYjf88= 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-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2WA5FjZfQeAbPXVALK7BXG+quyKaKu54u5rEXIDAn10DRiWn5DBX5vIgKhm3o5zFYntzut9weUMSsoFfS15/LLCTXsi5VQJBAl/Tk2qk/BPO7oyPs1XgoTTW//t/S0bGQPKmiwkaQOh1jH924k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DqR9E2RA4mzhqYr39pAUc/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-Rspamd-Queue-Id: 985DB20021 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: qdzfkgib7upwrm5dkjr6jawbm51abznr X-HE-Tag: 1688586261-328294 X-HE-Meta: U2FsdGVkX19akN49mGPsnffVe+pR+NXA8JLBmAooPVHhV1gleYppRtrA2HZNQWd67S4oWJZv1AIaR3Fn9URu8IO1YZt5763LFKBKdMtsb0W/fw5Ps+WX/dlZIxAtf1mXQQMtHnr8mSAvBlIHwiBLaCTfZ4ogqh0rtNOxpVjs7PJvr4/n00fgdZSR2GlVRW2XfJ1diwH29jpNowLWFuXDKAkd4F2Lfr6ZSsgUvZiRyENulFupt1ZB/rdWhCUJZovUkFGcz1+Usesz/oGY6YWld/F98q0siMsyvW4QI80or2RGEPVCaiVRyrjkXdFmmcYt+C2SkkiwgFteTqL61OmkR8+4Qb8x4n5BrthQKZdT70OUpECp2OjIuISuvOOISWIHglyhN8OM/t00ZiRg4d0SS4a0sOLJbcRQdu5p0Wxt8vNnGF44Tgc8IkJSt+UqjlIr4kPcntRKjC8wx4QpuR8/NNkdapqCSpx5Kzps1j5200jyGoI0BIKdqCu2nqjzGrzvj85q15XDD3r4F33bw3Hjdd4KsY/6MbplrrL/Mknno6WgeY+6TXglB2j6qMuTrghZbdV2jox8j/QvFW5KDEmZj7tIDbn+9Mpf+Aiur/D6CbiL3SnVn4cMTo6rJDYUjLQqF4m+UHcml5DXD07MUtlksnywNgy95oGUIJNv+r/U3421TwVVyd9WsuKPKWW8RC4Sk5lEHsKAu+7dX4puho6y1Cx3pHo5xXkJg/r7OwH7a3b0ADX3g3p2piNlgdg+/v8dcdiW1Qy3D0EquWc+xre+ql1Yx5pz4ChbPloRXA0nrp+/W9e7F1KzW2BWs0kLP6UnJsAZ/nvjFHZMzVUdKwvrY5ozrC4pLj41fotw8doBy3uD6SySbn8Y8rFFSyFbGky3WODW2xw/r6jpWmjr8uyqGJdEi7a6pE1jg1v+OIHyX+yjg7HoegsX5AhUvsx/XxeZhVA0md6yJqNm7hCqmsN npNUlMdu giaBofp8dvdbhagq9NkYk/eD+pf7kywh9lBFsWgjAIsN4KBh9rU1LAsegIaaYnQ6K3QHumBNtjdz+jNe+qn81TJQMLSCFPxGFGAwjarPbTL9nDPmBy7K8qyZGz/l/IQUF8PKLWfM/7gDRaD4DZFVakuwaNffo84lapBIQ4BEzxFsDatHSSTlEea31U34hV14ihYS0ai9hsvMGQW3HJjvZiYgbRcb94XJe8UtzQ6s0rlzKXLHx+WidcN/rOD+vFe+jqC1ZbZpIJhgj/huDWHwzpraUZN1rKvxSdEUoid3svd01YbXEHVAu3kWUwONat8LaBgfT/tFin6zYoO8ArpT+bIwsh8cgnAg9YM4yn5FsXxrYntj2D3CKWaXiNsGVmCNnHB1kVNC/S09JELX6rLqB+YUkFku1ldYPCVzXf9faW9YhEO4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Saves 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: 13302863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D912DEB64DA for ; Wed, 5 Jul 2023 19:44:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 796DA8D0006; Wed, 5 Jul 2023 15:44:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 747618D0001; Wed, 5 Jul 2023 15:44:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 599838D0006; Wed, 5 Jul 2023 15:44:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 4AF918D0001 for ; Wed, 5 Jul 2023 15:44:29 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 186A01A02D0 for ; Wed, 5 Jul 2023 19:44:29 +0000 (UTC) X-FDA: 80978585058.11.CDDA5EC Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf25.hostedemail.com (Postfix) with ESMTP id 99F85A0011 for ; Wed, 5 Jul 2023 19:44:25 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="sJiU/kNo"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=MYp475Qv; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf25.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688586265; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=WQEnffaP+1i+leegzaQJ8pj5MOjXtFFS0B58kv4ef+I=; b=G5Z3QFGrWvjaaWz8goKcMiWTHEcATx7vNP3soVZxqeLx8NgwQ2BRgAmUtUwD9NGEVsf1no L5R9Q58zWZnzh9Y2YqxHqMZ9EzQmaJSUcQbVc8bE0MAhAWgIlOqVJtmCh3BmGlugy/U8R9 qM/WAOp9w5p/vPCoSp8agbU8E+xRTV4= ARC-Authentication-Results: i=2; imf25.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="sJiU/kNo"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=MYp475Qv; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf25.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1688586265; a=rsa-sha256; cv=pass; b=59rnq0MjE+8EJkbwZa2W2cVvYgjIoLCHA9B2tViUAWLzF8xxofiIdW7PvqkCil9pTRTgGN UcgrpoWy+yUDsFoIZpoAgg1L8lOgDbhBv2/MUykgUobSZrdEZtfnwVXr6DujXj1gsfuvgX QMd9OItNoAySyaqh7G0iTvK22Mh/PRQ= 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/vRyCK3nC7MraG2AqFTdDcmsoESxXXrKZs5Z9PZcNG9sl6dNWPC/6RRHR11wV3+vm7V2aXh4PFok3qryrRTS86YwancuEGcQvFKQ1bGeCt1n5Ynxv++p9r7SizdyJsMrb448ctGOUjH1KLoyYdoVZaWjnt/zTLSfNF5FXRe588vSLZyEC1aON7WDbSZ6/SsNSdpy/HIzSSeSQQws27oZjzHL3oGu5Av7iJwW8Bc2lEo5BKIVM1GoeGdefGFtN/fQ3OdKxaTtRy0xlZ1L3LH6Ixk/wqgv1iq5eJKdOtjhccouvvcaA76YT0i6IiSGxrkM+1s2/uuL/9vKxJtPcCVmhQ7xlc63eiBFRgAxm5k/iNkWmymAreZTgBkeXtGwy+fc9p2wVmT180js+G9VnHdMHIUt5CmZyiPd+l187AYKMWvWAlRehQNLhG3EED62pO7jWR2Wera3sTflrNxh3IK4DAwHsz8E+XxYzbdgNd1/pjiIAIjrEbXh/fpou7qKn9bBp0BeV+HknoEHJJGLgD0Lp/tDhZ8QpmAobJsrP277hWyG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g80Yg3CZyNt2sF9s8zRoZefs6LIwbhqKFM4Y9KNT1GUGhjgCnFz+/yO2610H/YG9R9+FXPVn3hIR6Bxl8JkyF0COk6cNHwJ7nXiC/YGMYONk8rMfzRbB8cZQYx0MtP+F8ERGlDO8wBTWJHYL8g7oXlLGLk2sQXkjWGLp6eHElVm7piGo1iEJjyWpSzDRKqROaDsz6ISdb+R6Rulj6LIujZiidYurz8dbKbNRlaWSr16C/+r2XdOqIESKKjYA5BOZLUVq6foO6lrloRuPfiueh5a46sL5kctLhcZmDYZMlUpTaWsLM8Ac2AHXL/oryf5U+SgV4vgapQI6n+Yebg4uI1ngMwdDiYmgDDMIJ3+xzq0q21KTTomvTu8rQH/dByOe3yhqBt2Jr/1mq+flTN4pDEJvjMGyKiEupgEuS20gCUma3XbtJ6xlwAdrJYe8+J+036Rjlf444Wd7KvQRu7U5ne9g6QITU8/Tk6rmDoQKqBjMRBB+uMTbi0yOhwedu4qOKgUuv47/7GtLxmhkWyA0G34cQJ6mgu6zvQruMRYoVNnig6XdohEazSJ/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-Rspam-User: X-Stat-Signature: m3m971grwbfwi7a8zk75y4usns1dyeok X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 99F85A0011 X-HE-Tag: 1688586265-327141 X-HE-Meta: U2FsdGVkX18Rr3fYPaQEKKruI6Fi9rlzVmnHWZGjawPL8zK17Lip0YpTt9shPFYDrETPX5miOV1+8kgRXJIcXwwCOsLXrkzaGQhF4Fw93dPIgDLfzHoO8FutCeUytjgtz+u8soL1cJI8qwFrIPg5KHVFDXw7dmw4t3MfEFQ6NZ9P9Bkr/c/9cjlPpRmob6de7kDYaaTUCDrse0m2IdkRiynB1S/Ux/hWENryAeLlWitVuOkiJHYV23nW0/5OKYVXGjvY4xVdpZxOIE0u0cRFW8a8lwy/OcWpMZ8dtoadN2N5HjyAJx9hfY7rtYfoU66nNsX6hcZJzUQsEaik+wMuYKX03OW9AZZyKS5K13ZtDkHZUDYWhX+35DhVUIyctRCtY17H0BICODtDdNPuXJoXKsN1EiVo8ct/PonvWSZoEONK4uHnUoNhmt/fA4PatE14h8lufjWbLEMfcgu8vzLe1nYsOTR9tw/FKOacAzNUBNwZ4FbX5+BUSCZ1ukdg8a43YeBFA24FmTl9IHjdxOIOT4EwdA0XQWL5wLHFc6jQNMs7/vuEr6X36/+BRz2MLr8ckwhfIjxoLHtYJ+cMc8sULZzUtX+Kv6qSHLrChrCekVB4HGteQgq032mQEnQLkcXFPOoScuHl3Jw6MF8DWwkaVFpX6vxS+iWOD0nXwTtsYcxmfEK0nZp0jQvPOsYsXYOvaiz4Ip6sUDAZcLectOmJNLYfjfp97U1YdV82I87yneBAcxyzSXSIgr11Zk0VNG7OgpoIlLgfVZDzSGflPuJu0koGFIVaF7SJ4vXC2vxi5uhKbuve/IQeByBpdihxH2m724AQS0or+TTEAF6BDxWgyhcbLMDZd3X5VBsU/MtiMf6lCPjKnjIoPSvdkrFCHKyJ0da5bOfBfEUrGkjH9sjGRj67Uga3tfzL/0S2IEzFSo1xwhvFwz8xvYcU5CxaoGgnl7CBhtPVehOoes7n5UQ vM435tXd dEF1B+x8xYYVmcFQk1gS/Kmye+J35cwYgE7wF5x2fJtddhhPbkjEs96sr4bdKPchADHaeMZt2zy/gwD6OUHaS76oC/pTvEB6vsjhmzyjYSQKudLBRv1/POOc9Igzkc7vbgoZE8FvlBmqhumWmE0lDbGKtFb4YAO4b56p6ejFKih1IPu0ypUJsTPoZzR5JPXKrOFiszwpcXm1fyIZe3eaX8aRgxUOLa2AyyWLxKLCPcro9n64Iwyiwd47maGmM0n8Dm+Wrf/QCVGljgAntkSBpGX6dOEaDfSOvi7gIvOZKb4oRQoHK3jFbrQKVgLxd8b88rrYTrDetjZvfdQQ8InCWxGmo4tU8zAmp+DzJ0SI5VbIYAyc59z1QcLdd4HZj/WoxXAZClm72KTbDmkpLg9f+adzJ5gUdrEXx6ugqKPn0wM/lwwQ= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Saves 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; }