From patchwork Mon Jul 3 05:58:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13299593 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 E95DFEB64DC for ; Mon, 3 Jul 2023 05:59:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 42B158E0090; Mon, 3 Jul 2023 01:59:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3B4C58E007C; Mon, 3 Jul 2023 01:59:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 22EDA8E0090; Mon, 3 Jul 2023 01:59:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 106838E007C for ; Mon, 3 Jul 2023 01:59:10 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B529F140563 for ; Mon, 3 Jul 2023 05:59:09 +0000 (UTC) X-FDA: 80969247618.26.7D20E04 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf12.hostedemail.com (Postfix) with ESMTP id 445C040002 for ; Mon, 3 Jul 2023 05:59:06 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=MhPpRbIN; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=g+PAyDEL; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf12.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688363946; 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=dj7z8RUuHw0Qg+MY1bCofYDUKBCxdrPRgu++XFuJR3I=; b=K4mY2Fbnk2WyIMiaSPZ3MvLQKD3CwFFmpihXsbspEMqfAw/zHRa8w0cZrwPvKU+hGgLtvj SsN7AyQTyvhFiCB666u3mac3uMCnI0WTNUaj6aNXIWtBPncbCEjnNqQ7IJZkvclo98jqdA PCR8T+yX0vfpRaw+YQiTChK/9xlrK5Y= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1688363946; a=rsa-sha256; cv=pass; b=JUl8284SyUvgAneg/eYc/dRp2US+EyXrwcfeU1qg9wYCpMN/HoXVE2k5hcIbN1mWOLhxYM x45lPVkWgn7Ho1mUlb7fJkH3Mkqd4Qr5G7nXdWgZiLPpwQ5qGLmeD3k6VQGORtSnSLZPL3 l0ZRog0+xQLRuH142OglyCwPktvl54s= ARC-Authentication-Results: i=2; imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=MhPpRbIN; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=g+PAyDEL; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf12.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 362Mwqrx014049; Mon, 3 Jul 2023 05:58:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=dj7z8RUuHw0Qg+MY1bCofYDUKBCxdrPRgu++XFuJR3I=; b=MhPpRbINaJ9TmXtJ6o41qWPmQAZFRicSmIi2dIKjHVh9wnc6t9NKXLmKc947C8CNg3aH jst1yNbGRRXHcliZld/WlstI/k3E7YLkUQtVSc5Fx82pwqjX8gM1PAORdgBBiR1ZJwCI 9kT/Jf4TXd/Bh5Fnf1tj6bVmKrmW4reOzOkNnnkXZhNtn4lOiiZQFLihE2pBnXkFwZRZ 0ZkBPVzQ3fiIftHsd3CY6e+0dypxINOQD14ZYBToFGNVKJ7aLyOFBJRGYtKNbi1UpoI4 YPsoXzPV/Ha+LvjjawpQouEbinEhqkWiNKrWiScjUYafgxOfddPvqjX9CLpujleVnvaj zQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rjc1ahtby-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:58:59 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36344iLj010994; Mon, 3 Jul 2023 05:58:58 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rjak2v13x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:58:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FuoLBZ8qxgvPRdfi3+/r2WNbrD5NdHS6tyD+vcJgp28ne8WxqxUMtq1nuyILsNKM4Imly6D0aUdK82Ee6JmMM/9yalO/qQ5IF4JqtT5PAWZQR69Zc1WW+sOWc1csq7qs7jCGo/UmMslt4ABnQTCzShUlBaMekWpt/7Rn1XvD48B+psA3Uvj7qbgckkO/iOYoqQJfGI5wRtqkjFggHV+vLzXI9trMuQNBsziAmQ1hSt6h3iQICuUvvJ+0tpgelO7z4yJtR+a4VsW5UqXsdFyTFnfg9/vtCrSdzoYkYenSjPh6kXi7N1HQA3wBv5LhI+oLJTdEf29mISoh9hSvSyFWBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dj7z8RUuHw0Qg+MY1bCofYDUKBCxdrPRgu++XFuJR3I=; b=FlsN72vwvZEIOt0WHk26DUiupGLl458x9ykeOqROaYQbkm4sJufXyh/Mv/jcaMktKeBThomCnm/MdB6rGCwttQoDlk04+NcqErzakbnX9ClveWnhmtvE0xV6BddiZOv3p8ZCAkng0Y28ZnjTmwXDOMo+Cao3Rtk/Y1x3ghdl8Z/S5K/g1Y6DEgeATCccn09n5zEYVMiEM73iMdiJ4nu9zLlpUF3Nc+dNZ78UVPY2BALXtj85gMMYMKoKNid0dUFsG2MJWXUU7RdrvbzrSNorTF3i4fyCfu+PMxSjjqYN9cmNRIHjaGVFyHK15bvGV3WxftO5tOxXLh9AZEYXrkhmsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dj7z8RUuHw0Qg+MY1bCofYDUKBCxdrPRgu++XFuJR3I=; b=g+PAyDELt3X9gzOVzeg+0ZIUB8R3xMLEFYu56QO65tvbtLllVVBl4c+/vPptKgkTBd2t80pVQQc2+TX2I7JpNvq9Nt2+geGfZ4aFoyn6WXZZuKfOfXevnLEYVATjkgJeoG8TGkG/M0SiPcZ3DoHWcpAHyZEjdKmmmQ9CvURfkgA= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by DS7PR10MB5085.namprd10.prod.outlook.com (2603:10b6:5:38c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 05:58:56 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::d9c0:689a:147b:ced5]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::d9c0:689a:147b:ced5%5]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023 05:58:56 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 1/4] mm/memory: convert do_page_mkwrite() to use folios Date: Sun, 2 Jul 2023 22:58:47 -0700 Message-ID: <20230703055850.227169-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 X-ClientProxiedBy: BYAPR11CA0042.namprd11.prod.outlook.com (2603:10b6:a03:80::19) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|DS7PR10MB5085:EE_ X-MS-Office365-Filtering-Correlation-Id: 0806d1e2-a03a-4b25-d3a5-08db7b8a966c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xvDcWnOXh1p8FMhcwGxI1wJD4C+VBQSTxGz2Uv2TCFmPrzye7NsXDuLvglg9/nnzstylSdn7Js+ea0hPxRV+iG3ogqyYuWGilTEgRNy347AGWAkYnH0Qm/J7EAiVh2768TSC849p81QEQlogyhZ6xwM8P1OIra+9pP77y9jDONJc6Z1q0/oVmuZmPPL3pIB3hPd37QvwhTxuTD1O0jftlpdSqrjjk9rcoy3FyCnmFqI7/arJETmv5iQYSZSRE/C7r2n9fBeFyOBN4Gjx/2Aocc61I0RBCi2XgwmoGonDX64N8vJJJbcMgSlm+nMgDzk1WWSkHanmersLuo9+ahSp6X5oUg8+iHm8dcjb6WuinQ3IWlc2Qc/p62eyDvIEGPpEtKpZNNpFs+//SFqiZtkKoIEVggA59XLBZ3asfjpd/od32tasDbvCVmHKfWwFJ7t/2IwkKa0mqYNjhyj/cFsywrWRLJgcFXoQ8Ro7CefiAY5r3vvO3hkgePEDlOSn0VAlEiVzm2mpagg8441ocbNDBp7wqF0sSZIMDT6/Fya4kM24zGt/7oNFMv7HiB5hXZe3 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(376002)(366004)(346002)(39860400002)(396003)(451199021)(1076003)(6506007)(66556008)(66476007)(4326008)(66946007)(478600001)(41300700001)(107886003)(38100700002)(316002)(2616005)(83380400001)(186003)(6512007)(44832011)(8936002)(2906002)(5660300002)(6486002)(36756003)(86362001)(6666004)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ip3V9nchQcJYodQs28kJxmeq2kNv5YJP0uLX6F3g294oWESCA+oZTo7/kx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MHTmmXQbGGRcBIR4uq5z15RStrtbDoRfHZpjATooPnNmDNaeiwjl6NPBfCwY5qWlnHT5JIsG/zfo2ZCMhivKYhOxMNxIeuI/J0zluoLAKUswm2tTLF9su5OZkHCxiJ0LMNi17WxlMggAYJEofEMi6G0UtBG68QGmyAx8JbIAoTINnkzLU5A97+jrckBE94F/oJjLmA7kMhKJ9edgyfkzoqCIDhgzWiOpo7GYTGDSWDL6mhw6yEx2aYC3qaRlm+It2egcvEwd08ZTL+Wu3te9IFwymSYp9K6vLKMgClJSZqjPfqtTA+C1FFaBi4GgBcGqWD6dhTI0OnPPqmsu+7g9Btx6MhznWNV7ux9EX+ENyeEYVCscqpcOYKdipreb6q0BTF+lniCCi61SBJrwImvu7O4fL6xEa2aGweE83YZHOtl1N4XS9yMXWp7nsqtr/PnaXjDhiYzYB0u2fx13L7i8lK+ygPQyxpKOnhxnW0nhLauSAG1YVEmLUp3rFU= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: V+B+A/SvDP97laGvgglBSgZZk322Ma+18sTDIAQnAlH6kUMPQ1N8oyE9mAJHurNuS2gcQ+qDyBIjno4J2tIVo7SdAtEXlOVBCB4AiZizk6NzunSBrU49e/MNI0UWyVLyG/sPLgcvxCDfkpCFQbiI32emqxi6t/IfSZQIryf/T/d/RVJ6Rz4QNbt9ubKX0OCQGOK3xl0B7cLhYDy2RmDOHL+7rJhxA6DPzv5Ii/vLzt4NTlBaN0kdD0CTDz2pYBsoTlLBSPck6Msz7HlS2Dtd6il32kbazepY0m2YGtYrEotCdIOzhQmcE4po8iSW7KU87PXtb6Aro6iul9kQzSilVEQLew4sm4I7RfV24gINhxgXWpUU63X5QV7G/E8YHhNHY31pNo/nG26yV4238Foz64s0hgbY94ay/lt9mB7LEa8kKzWRVwUGsnwCAEmdFe76gkW+m82MSyRdrIw53XgKmyBB+TG15/0536ODMfouNHeZTxYt7FI0rWyXf38e34kq/xDu8TA20Wu5yQiY0hfxaRUzaIMFkmmrEhnQskCWEYsv6kGiDzFYBChX5Par549Pk8tQpGRj65qpC0PpfEs1xQsgrgFRB10tqhBWPWftQwG2OHLqpkUYTYM5a5Pd0QFuoWL4UzJSxMLqXjibB1gVB/m5BISpUoRJFmTqfHPj9zLL6bhJAGsZdqjRqnNlt4Eqa5Z252Y1310bwF6y6GNm2IYhIUTLs50+k0y7X9DUeEt0oDI95zx2ie4nB1t6m9Utdw6n6wpZ6dh4QFhOFe2Hf7cOghTCm8O+tsd5qi+bYmYnk6BslznNwGnKxsoBlJAM2ElasM96V8qrZGACAoMlFpVjSTz9WVmx4afUyB/9bMwgpsTHWqrrvVfpW+7UsIsj X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0806d1e2-a03a-4b25-d3a5-08db7b8a966c X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 05:58:56.3959 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fIG3u5hMag6kaNhwmv0/jcVz+jwMHSX15nC+80iaywgD6GuQIq7Usj1j3cWnfwr1GVRkYAtdwshJ6mlDrL+QCePnq03MLNPanKC6I/e4T4M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5085 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-03_04,2023-06-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307030056 X-Proofpoint-GUID: YYiuVSLmrAngyqz1jYO00p0EnQzdi3ia X-Proofpoint-ORIG-GUID: YYiuVSLmrAngyqz1jYO00p0EnQzdi3ia X-Stat-Signature: xmmxtb3tecbpz8uubwck9gsortchtpf9 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 445C040002 X-Rspam-User: X-HE-Tag: 1688363946-767861 X-HE-Meta: U2FsdGVkX19/JI54k/Ik8Er/zpLD9dMhdZWQuKBrNbjFKc0q1nncq4IyV/IdraEXpe5yIhjmmJ4A8Bx8Hgq27+VzAml/B/zsAwbraF1F38R6DwKR24uAzi+OdNMfp1UgZGl1D/pc/pqIxu6KUBBbMcVCJQcJK3TtXPfZolima8YY94Yb0SYPWh+Bg2ZI+I/8x29hIP+dOqcOtaWYvPxsjzjPhD8NVfHlexf25JJuFGRNt0NVWyj1LmONokpiyGJfUwLek1diC9aYhw6c0OoKUojo31CRicTbZfP3/vlLzmkXalovPJzlLGJEcCDWA7+3t8oUzV9klna00EVn938GyXZZ+wOuIVmiJNwUY9Ftdjya2vGP7LME0rB6npk74OqBcsyZZtJm8L7tZV4Ii7zkDGCsnRr4xh930ASKNOTxeC9l50XqNgmqxgE5razu7thZj7O9A8pUhxXMW3l20yn+qRPO0QTSvNsVYgImKVAkoaGMZ1ANF3k+fzXoU3h0YcUJku2Zl3g531hOLMrHyvfIoJ6h42Aw02j+sgzjqjZl8CpFwJpmrFxajaZvciwyeIRZaiy1GlTgf15rr+P62qN48fPpG0fyVT4w0e08Y6kjmD63nO9qml4MxfDXpzQLVNKrfWCCBBpZ8W3Lxu5puBixasq2Y4c/b1edDAEj8VSysB+JuKBM5KOoKicmZdVSSnKyRxfhGmE0dzoYj4p7ldDgEdQd1Ep0dNDwlwGoDaTsnEHpnZ8STdfhJu7C4JJ1jsif7gDTrdXuouIt8f7omGaNet5CuYW7xSczIzebAE/iFnjj7swJ3ZfvIMyELVBmczRRnTDtmm1nyxKZTjHhYjCj2GUriEQmnlMFcd1zcH901r0qOGhoCUYI7jm6hlyVBnIRz8t86L+a5M1YZTpqONMjAc1vZe0zGSF9d7KRflC2q4N84NdXx/4Z2ClcCe2U3PolNi6JNnKw8kPceVQzXP7 NykmtB4l Oz+qhvMViiCojBIlhE2NKfmm9XqPypHQrmR6aY78a19b7mAxybqquvKdYSFH1ZEfwjqHyJnfs6kSl4wFJtXJnsnWNRfAfhlLNGQjPbYt/olew48/TfgPnrXeYN6PelcVrq7sHkAXcbFMojQ61eALr3LHAEr5Hz/nHYe5fDAq10KGXIaD+0SricSxhLgRVyQQwViPtJ71NbSRxz09uEMGt6YRoGN8NtFPKjUKzls1SCHruFf+KnNzsChyZTf2Lh3AC8hSGUgta7fEACT+7LPwD/Seh0uRgEJGM7nIiYDqMQFwknBrvSHmkHCV39a3wPMHXydMZEvB3xjJN5nUGUNXjn0YHhrFiroWbYepPGSCfZOnoGIqWxfTclktdGrE1uavsh3MTJO5qSzkB5tqHDGUWZLogn7RFlCAe/1uyKmNXU5Nu1dzSe7I9shNESo9z/Lwu1dRj 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 --- mm/memory.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 21fab27272092..098fac2f5efc0 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2932,7 +2932,7 @@ static gfp_t __get_fault_gfp_mask(struct vm_area_struct *vma) static vm_fault_t do_page_mkwrite(struct vm_fault *vmf) { vm_fault_t ret; - struct page *page = vmf->page; + struct folio *folio = page_folio(vmf->page); unsigned int old_flags = vmf->flags; vmf->flags = FAULT_FLAG_WRITE|FAULT_FLAG_MKWRITE; @@ -2947,14 +2947,14 @@ static vm_fault_t do_page_mkwrite(struct vm_fault *vmf) if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE))) return ret; if (unlikely(!(ret & VM_FAULT_LOCKED))) { - lock_page(page); - if (!page->mapping) { - unlock_page(page); + folio_lock(folio); + if (!folio_mapping(folio)) { + folio_unlock(folio); return 0; /* retry */ } ret |= VM_FAULT_LOCKED; } else - VM_BUG_ON_PAGE(!PageLocked(page), page); + VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio); return ret; } From patchwork Mon Jul 3 05:58:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13299594 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 4DAD3C001B3 for ; Mon, 3 Jul 2023 05:59:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8E6CF8E0091; Mon, 3 Jul 2023 01:59:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 898138E007C; Mon, 3 Jul 2023 01:59:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6267B8E0091; Mon, 3 Jul 2023 01:59:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 51BB38E007C for ; Mon, 3 Jul 2023 01:59:11 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1E018806BD for ; Mon, 3 Jul 2023 05:59:11 +0000 (UTC) X-FDA: 80969247702.20.09D1BA3 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf03.hostedemail.com (Postfix) with ESMTP id BFD6A20009 for ; Mon, 3 Jul 2023 05:59:07 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=bDu6Z0zn; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=XpaYXvx4; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf03.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=1688363948; 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=bMN5wxrHdDVf4pWWBhvN1nIvgXVXW5I+t9zbWvnRgtg=; b=Z3dEdG1RWPrN5oUxqBD63pemypSVtCfPb/FXdUZGIhF2/1hvS8MG8zcHgf6nH/1+TvndZF 3EnEjiVYcQa27xecWiHBRKV2eJ30ioRPItS/egwZYe/K72ERJ5IA3GPMhydI17usZ4TavS M2SfyqdEueVykyg/0HfuOUTB1MuVMWo= ARC-Authentication-Results: i=2; imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=bDu6Z0zn; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=XpaYXvx4; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf03.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=1688363948; a=rsa-sha256; cv=pass; b=M0eznt8jHB1CeQJP3VPUSl570vVn9WGnKjA8MqBenbIlTqw9heu/g6vPHjKuMOavVME141 ROg7q5VpCe37orkunIOx18rmRlOFZil8Ndv+HfITTvOhzdg9lHIMgiX7IstAqwSP+GV8S6 hV0vpMKLG7FeQuv++IibNB0FcHgOn6c= Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 362MW8di027336; Mon, 3 Jul 2023 05:59:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=bMN5wxrHdDVf4pWWBhvN1nIvgXVXW5I+t9zbWvnRgtg=; b=bDu6Z0zn8qpX9Vc3p/R2eN+c1Zrx13TQPrD+A/DGnKDaf4vX2lUw1FNrsZRLSDdmV92d Ik05U/QuXfXQvMmG9oX6QNaLXJBmDHXCOt4t3CjnJFrjWEFhkigYJ8x8aGReO+MD52we i0L87yjvrfWkY5//CQa9yT6vKdFYzVLD8VhomQMJ62HmSogEVwoI65YhUIOB+uQt5Uk+ LZbRkHoA21h0rVlaSqGtGw/0Hw4mdiiQe3gEmXeGjB0fdaivreHPdOPJMvt4/h/ILqf5 EUboNdhHpqtug/O+YKnDqVubFbEjoiwWUhppRdHHehk4PxGTbPxoelN1Rn3BwT9wr85B ow== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rjcpu9ssb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:59:05 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3633xh1p039614; Mon, 3 Jul 2023 05:59:04 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rjak2kv7c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:59:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cdQ76AFjUgXUSkWNYcfQswr//rV4CnZY/Sf57HXHxxgkkqL/dzQTOaG5P8g5u1yaPOAlCzmaK/2f/rtA6XRFIj5OQ8yUTe/0AFryaCxQw/DvSyT3w54Pq85uJ4LK/0lGnvBm9AJo47m92+NNCFQlTLx5RYdB94YvzfRJnB7fpXSV/oR/iNpDBmg2SjRRzjNq2V/E83FSA7K80PQDzGK4iqt/F6KZx36s8ES/MkulBC95xCYBGxmW6eNm8t5LFcnM4uyYizZH0ckoAoe6+VR1Xuq4g7vf9koh6r3oxKj3kxBxDMuIDyLO9LSOnpxkg2aUXqR1Fa6E94KgparQ3YdCBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bMN5wxrHdDVf4pWWBhvN1nIvgXVXW5I+t9zbWvnRgtg=; b=Y87FZubXHC3mO4OxC1j5BNvtaWQtnj+6EXKj7DcbB9rR7iCwIHIhrj/Jfdb7UavWw1HqZ1+O0Icpf8C8oY1JQDtHCdO71gbUuQPIx7L8occ5dL1UVI9l2N0ahSfY9LUztZrycZzU+GRvA/jX64U46j96FttceKwJFRb/1Y6cU5/JEzJq04rqklmjUtv5I73OQGX4tb7wPYvDoRFE61cAhs8Gdc6I3e9PAtAECpaki9kvIhB8Wmzj6uvTpaOdTKxF4ZuP2N7zMJNG+/qGhQuYPNqgabunhIlF17au7qR6vBsSeYtypaLcp6K9Sg2vPxu9ZtFfo5SyvK+eEmxAmuNyUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bMN5wxrHdDVf4pWWBhvN1nIvgXVXW5I+t9zbWvnRgtg=; b=XpaYXvx4qrvBM1fQeD7m/W7g9s4kuv/yp6IySf2AH1mJfEqForhA01sBvKGhwHC6ek4xmrttmo5eWTZMbE8tHjz03QiClrixG+Th4sDIllyvf7VejE3rQjDjfXg8Ep8HZLmNWW/6eLoJbM/v/TRkRa7TLSYQqgkccjakurzUITU= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA2PR10MB4697.namprd10.prod.outlook.com (2603:10b6:806:112::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 05:59:02 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::d9c0:689a:147b:ced5]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::d9c0:689a:147b:ced5%5]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023 05:59:01 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 2/4] mm/memory: convert wp_page_shared() to use folios Date: Sun, 2 Jul 2023 22:58:48 -0700 Message-ID: <20230703055850.227169-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230703055850.227169-1-sidhartha.kumar@oracle.com> References: <20230703055850.227169-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BY3PR03CA0002.namprd03.prod.outlook.com (2603:10b6:a03:39a::7) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA2PR10MB4697:EE_ X-MS-Office365-Filtering-Correlation-Id: b95c54a4-6470-4175-9d22-08db7b8a9986 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kj35FeXl8YgzuILauz5aoZbt7w9KZYeJak0VmW9JcF1EfUccAaJeet4ZgWKdrwXqDiXx0F7awSmiHGx4kbuSuDr/s/lfgON8/G8oqPx4En0ctrg4h6zorD95iGONkCVfiOyyEkC5XpNR7xtcgta1BU5w1DU54/Cq052WcCOPFa5fAwx3+PGO0eUn+0x2vp8oHa00LZi3VlFOadnOGABGv/6uiAVKdkE86Kg0ZhK+mx0c2ElM/bcgarl7FZ6Tg5CBGBLQ4ag5oEZ3kJxGYpqY0N+BrJ41xf+6J3Eobk0QVzRXIxw756PRNkA5Otzjuh9yZL9xQf7hxDtkVoCTWXLn1K8v9CJMREk4ftQWCsE2osIBjxYSSU7M27Z0QsZxP+G8F96My5GIWQBiKT7MuowqYK/MpLzZtx1BcvtfLA61ic+GfKZFG8ScfwbkCRCxtKLjc6NzgFmRkI8fFCczwou/qwYo8dPQXzmjuTSy1vHClXMzDFpymbnXxagkEF78O4LbArzUTSt8JLa3obLfkgo7ruDalc6hcHaTI647Ol/YJHyRHC6Ylt6eU4LVCOGZtlQH X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(366004)(39860400002)(136003)(376002)(451199021)(2906002)(478600001)(6666004)(6486002)(86362001)(41300700001)(44832011)(8676002)(8936002)(5660300002)(36756003)(316002)(66556008)(66476007)(66946007)(38100700002)(4326008)(6506007)(1076003)(6512007)(2616005)(186003)(83380400001)(107886003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Hb9r1nAaluz8shVTeEGmBZy4THvww/GH6YajXOWhDaFzC1p5OIZostO/zDHD71XVDcTrj61HIpE+FnkttTqWT93mmZwgy5rtKepwRkvfdjZ+HJUX86SmRroWZM/895N0PtNoOEElXf4tfMpXCVcWfhujyDWaVeigFNlPzANvSDcBYMlD4NMFxhBpzM+kvxaw8afUXOi2pVPK4seGCEfYiniqAekUO1RyZ5nj1kgEN03VYvSVFDCnnQGTtDYDBjFG6lH/gEkDEQ0dduBOQsiz2/91Y3UKRyYFSw2GoDiq8JUgqcV06k2ShEcOW4MxxtfJzQXdXVsWF2IHbdyjh2wVK+BtUsUpaiyDUyQmjW6rT5A2SFqn7iKpke959sAQweXJtsYm+wnSWcrxaSUIhfIHBjHlirO2pcufiC1+elNkexu/nDdzM5yPDcsgFZLF4E3dwgo34yehuUn5bhlGxENC2SIU3jVO2Elq38bPVKwstPxn244tCpm4bMDONaa4feIlNSF4P9lb9KVfAH/68GRT8cFMwtr1s9NFIKfcmJ9td+WzKb06T9zO3bw4o1M/Jt8ysaadliDYqklKMAjAT1xo2ZX08e+G5Q1FN26XvTwezuqh9lVNFiQO5m1NersHFbTSnc4jduBfEUfLYGbDw4gwXJ8H7V42oECGzR+CmD+iIU9Qx6OlZTUIrZl9/ilO8/HU0U56VRf8n4gDHH4YKZBIYSEi15oEKf4KgkmWSE5xg3WxepjBy60n3yyoYz8lbF9geMW3NMGfHVp7W/fMT4gVPXOK4mD4S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LB32l4NG5w4cmco6s53uSqnCYvkxfYuagzkRfaTIXpPqYGjFEboVVImtOe6t5f6mLe2x0MhK6YUHjfw9TtHUI0MqBNXiPlwiGj2vFRSE7p8E9R72GoBVxF2/szbswobjN7ZIuztYSOBxfbm7FjYA2RP37LQ63Gk1yrx1fGNCe4wHV6/Xvbtm+pyn7xWbAwIdPj0mTAD+WR0V0V8mrv7ubBU6YuvHsXpVHHwAZQ8GayEjCiLNsunMJdghdcRO9BFzKowAEOYf2VP4wbwZn/bSTGSsSLDFp3K9+VvQMyOqyMPXKCxYBdBvcTbs1zcV2WaFSOV2WusJhJt/4yhx3tTIc65SAXoH9l7sqfLnm5LGukwWeFXHeMtKZQrIzzs8eF/uagUF8o+jgtxchVlK62319fgpTAln7ZcqIvg290SuYS/tJjrzXzao/sdrh8K0mUEyd/CKvGXYXpA7poSVzVlaeDg8YcevGW7u5t2sRcKThp+DKaCFeqJWydJT6FNc/zt+Hty+byHiIbY4DahyobS2YXOhYzVCd6BcVPka2cTPmSPxnzVXrZ5yTrcOpqx7QDI0yTIk7Xnn0oD2ZuxMDYQ2T0JhCQBmPwfNTNRkv4jvbS9R2hcRoNg59vd/O45+AENwMsYPvU/XwAqL/povU56ZkxOMyGTIVeSudYWKJN9AcivrPW6V48oBKt/xQaG0K4bvdgCr8w5q2F6ltrBXpEUNMtWi60FW1gJ6JnDt X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b95c54a4-6470-4175-9d22-08db7b8a9986 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 05:59:01.5989 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9sw1m94o8qjv0ozpHrl71pOoxev4eHJI7iHnItIQHJFYv7hoSd3cMZh3x8ctGnrpGmiGfpQa5r0yERPfKScyvc/jjZoga4qPZpPL6/4FsDA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4697 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-03_04,2023-06-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 spamscore=0 mlxscore=0 adultscore=0 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307030056 X-Proofpoint-ORIG-GUID: 9G54wqyZKX08ZeGYeSApwjCptShlxvou X-Proofpoint-GUID: 9G54wqyZKX08ZeGYeSApwjCptShlxvou X-Rspamd-Queue-Id: BFD6A20009 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: nc6ez8rhp5mxip4h4oottez4nucwgz78 X-HE-Tag: 1688363947-338365 X-HE-Meta: U2FsdGVkX19hc27NxEubS7AZzOpkRL+fW07lg3FKiRlqoEceabx8JD9jsIo0jk3PrqeM/p2P7y2iM5k+ouyK/gJNi5Jgr7VNTtyNMgL7SwU8JKoMn49aKccVWwA4K8oYo8Bino7wh1oUAvzcsAhHftDG3yNw6fJ09Vr2KHiwN06r7ESWh7JCzKRZw8fGSGAfBYycSXI1H35bDq7y3TqGn8Hpem8dsoJmM2DmcOfyaqVJ6opNpqt1WypUFW5j3FmB2i7+lT8P3olfxT7s2c+gB37UEkTdLP3p11j7M2J96iGPFkBaqlxaTLOVb8Osm/laBN8mWBhEWiR2oeJ3OJK4QPb1ZJJOiDqTy28R3RXcQCkyoyJhG/wBYiY/9rNo2Xt/ANHCN+rLyvhHVAbqwY5szyNQYQymLBVAyTmR03NdS963zO/iHbL4UCrWVXQLjohV2KH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Loop: owner-majordomo@kvack.org List-ID: Saves five implicit calls to compound_head(). Signed-off-by: Sidhartha Kumar Reviewed-by: ZhangPeng --- mm/memory.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 098fac2f5efc0..93480e846ace6 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3286,8 +3286,9 @@ static vm_fault_t wp_page_shared(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma; vm_fault_t ret = 0; + struct folio *folio = page_folio(vmf->page); - get_page(vmf->page); + folio_get(folio); if (vma->vm_ops && vma->vm_ops->page_mkwrite) { vm_fault_t tmp; @@ -3296,21 +3297,21 @@ static vm_fault_t wp_page_shared(struct vm_fault *vmf) tmp = do_page_mkwrite(vmf); if (unlikely(!tmp || (tmp & (VM_FAULT_ERROR | VM_FAULT_NOPAGE)))) { - put_page(vmf->page); + folio_put(folio); return tmp; } tmp = finish_mkwrite_fault(vmf); if (unlikely(tmp & (VM_FAULT_ERROR | VM_FAULT_NOPAGE))) { - unlock_page(vmf->page); - put_page(vmf->page); + folio_unlock(folio); + folio_put(folio); return tmp; } } else { wp_page_reuse(vmf); - lock_page(vmf->page); + folio_lock(folio); } ret |= fault_dirty_shared_page(vmf); - put_page(vmf->page); + folio_put(folio); return ret; } From patchwork Mon Jul 3 05:58:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13299595 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 CD4C1EB64DC for ; Mon, 3 Jul 2023 05:59:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 69D7C8E0092; Mon, 3 Jul 2023 01:59:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 64CEA8E007C; Mon, 3 Jul 2023 01:59:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 49F588E0092; Mon, 3 Jul 2023 01:59:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 38F5E8E007C for ; Mon, 3 Jul 2023 01:59:15 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id F2845160667 for ; Mon, 3 Jul 2023 05:59:14 +0000 (UTC) X-FDA: 80969247828.07.6C69385 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf11.hostedemail.com (Postfix) with ESMTP id 902624000A for ; Mon, 3 Jul 2023 05:59:10 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=F7nQkhYX; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TMQOWs3u; spf=pass (imf11.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"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1688363950; a=rsa-sha256; cv=pass; b=AGfHKFWayISTu2TFBMmSgQsKz7VGowMeCqpMDOAGiY04BdleG10IJ8qpn+ChZM4TV9kyRr r1nHl3ShpQSM2jXsGOmUt+8xxOVtWuBBiosJ5MJEs+L+F8sIbmfLY8airGtnzE7zA6+JUL q2HTu40R9zmWpseicMSmlrZ+JHnQ2ss= ARC-Authentication-Results: i=2; imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=F7nQkhYX; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TMQOWs3u; spf=pass (imf11.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"); dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688363950; 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=gFYk9aa5kbnZajo5uK0L2ZV4PacQ7xs/SUS137pU2kE=; b=syyH89qqVputW1RZ7qhMeep2BRcLcQilnxFhadaFJ/2o2VdYL/+Ma9Eg1njx+oOqNOzxUg 7lYuzFN98xnSpL5GEJr2we/x6b8ggWZfLYEb3Xa0wNHPFJKaM7KlBoEOa0UCVfXqj9wBDx 3s/P5L1qtX68vj+nusmDNlKoqRoXMUQ= Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 362M0IrP009736; Mon, 3 Jul 2023 05:59:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=gFYk9aa5kbnZajo5uK0L2ZV4PacQ7xs/SUS137pU2kE=; b=F7nQkhYX/+L469mNz++FGGTzynh8Aam3rZeVuJ253RqtD/PTWRd6iA9313m00h8uIE2M 8Bi4ljW3UEEil69+MVrCWqqaRKa0Rn4F6bI8j6VFznLIs3qTACXNIuC0QpBlNi90PDYE eXqCJ0VOfuDvTkS6HYpxPFYn8msepEVLqHXtnNoIxOeYdsuhldC8YUb8EAXt7ZAwzp0a Mbqrys/NH8joQY5dUwNCuJHnnxNjvpWcVvxnVD2kF5sT+f9o2aCdRCvA1OE+pOC3PnbG W29n4WoeJh5pGijClfthdfRh1nYCk7j4ixIpEVIaVwQRMHKY+GWENh71NRgOBC1ogH6y kw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rjcpu9ssd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:59:07 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 363406s2020201; Mon, 3 Jul 2023 05:59:06 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3rjak2m4ye-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:59:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j2x5z+QyxmQCkVay8U05dK44UdxN0THzvWpl+/4IxvwORjdcMDhZbAaBriUTWm6mMbt8DFb93uQtoq6jx37Q+qC0wiX53djR3xW6+/lXPc0NvlRHwm6NtqOTCKktEn21fqyr1g+fedaVv+1spiysZwRgP+Fts2kQjlqJ5bYeUvk4BKThMrW90Gg/upSz/hTurOGN1n5KEZlF6y4PgdKOSpiG1Sdpf0dKvNAGHKzp7q65p624z4tw4x2zZVE9n3XOSpBDgsTJx/zjP1iEIVzKO4w6aLNCI4l4L427qZ8fOkci+TK4MgvjgppYc68XIu81lXStsRSHnPY8A3uLP7QKeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gFYk9aa5kbnZajo5uK0L2ZV4PacQ7xs/SUS137pU2kE=; b=KFucXsfjmrot2/lthEteci15E7RYHuTCVmJmTD+dr/oHZCtb0EpqqTT3W1DKIDa2HvOgiHjNWDKXN8QOlvqw+D4KFp2myz62eG+nowuo9d8GzJ/vxmjdWTZz5Rp/1l/q66u0VWWlFFZStVygvQXTFzWCxfcfS2D14X2Lx+8MKyyyzmAZj623J+K3R7ZUnl1VDsti8yNpmRGpJu2iyLKwZJ7Nm/1Fl3nduQlUZQ1TI0zJkh15YywZ9cfT1HG+DTH18LoAxPB06NizdRjmRC/skvvT/apAlBYhVGJZrTwNV7jZso+NO0hol/qgRYrrKnMpTp0BY/joNebkwx5Uu0l6Kg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gFYk9aa5kbnZajo5uK0L2ZV4PacQ7xs/SUS137pU2kE=; b=TMQOWs3uV9Io4DHAVHSZ+6YrabTltXLBhzCYmC+bqRrXU90fKOD6tAunCR5Gfxee7OY+oO8KwaCY9G1xmp1Ugv9u5PUB2VYkXDnzS5sb31QEdIa2WzzdkhxyU4WscpmHIS3C5RhrbwQPX0M4BkwShTObTivdo20W7nX1GJdRqH0= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA2PR10MB4697.namprd10.prod.outlook.com (2603:10b6:806:112::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 05:59:04 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::d9c0:689a:147b:ced5]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::d9c0:689a:147b:ced5%5]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023 05:59:04 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 3/4] mm/memory: convert do_shared_fault() to folios Date: Sun, 2 Jul 2023 22:58:49 -0700 Message-ID: <20230703055850.227169-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230703055850.227169-1-sidhartha.kumar@oracle.com> References: <20230703055850.227169-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR11CA0088.namprd11.prod.outlook.com (2603:10b6:a03:f4::29) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA2PR10MB4697:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f8c906a-e5b8-4c31-d6cc-08db7b8a9b3a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B8Akol0YSu5KAnshkV8ClRUIP8QP4iqvjj8rKG2+j4VoKqny2oTb60faR+VblMYHcph6RlNSEi1YdRLKzoWvUPwftYXqFSYUUxNwsOmms6IZazJCmUbyvwAi9Yy4DvG9PGIKajN77k162vf0cdeEBlPWuIXrjpju3vDqnblJ/o4b8JD3GTNhPcBAGiF6dCHVQAxAk/g5aXOOKG/M6D+FFREgH59UiCtDlv/c46Q/31NKSGkE7YLycfZqgqQEJeL8zttsomm3GJ7PIPeO/T7LwDdEkGYELxM2DDW33nPMzxZBhyFxHkrQBAOprVt7xLYxxHDp2nJUtIX6Fxg1pfMOJmDGWVs8J1SGJ7w7hTLeoCJXTm1dTqBTmVS4/eRmLAg2bABdXW4zGpeuLyuj35eDpsVQGxCUEaJelY0e/9YRfQ7pnMWR7dZh/MJATmriI7Pw7UfzBkPN5NNY/VPVXSbZm1xls1rmQAT3r7kdDwE/p24WqUgqkYa1+xukTDxrI1AKwD9wVkqf2jSQ7T2LHZMHhEqkGOy5kJpXv9KTi0/f0HVvJv/qTesjr8uCyU/hEXuR X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(366004)(39860400002)(136003)(376002)(451199021)(2906002)(478600001)(6666004)(6486002)(86362001)(41300700001)(44832011)(8676002)(8936002)(5660300002)(36756003)(316002)(66556008)(66476007)(66946007)(38100700002)(4326008)(6506007)(1076003)(6512007)(2616005)(186003)(83380400001)(107886003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NRvIhPAVMg2MbRf/29IPgQoNFRuR2wzrSV1/AvV0dxJ/c9vDhTgjF+AE1cDk4uSbfcn9ZRnVqTk60JiUmzfDFHlO+C6t//Q5XGWagmnZUlguZQvE4FNrbczmJ46PxJkDVnrPEMzolAK+8j5EypHINdDnKdWPibv+N67RC42da+ZNVdQ4NRYVZ8qy91jOx8JALz3sqqHegWEkNtKzoy4eabZogmTbz+wxa5nJstAB1uyR0MAyD4kWR+ydHBsC6x9H7iAr3Y+hGMsiekBcNWwYFg5znl8BS1wWiQ7aumAEEGA7/v3zNYEMzLIIoEiWxilXazSNE/lT7ZpJKv0wJ+mlxbZpLAqp/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5hlFgSiXdn0k+WfNhXpQCZl9ynFROhqdN/NfpI3wVYAqgZfypB1Tc0qxiyv9bNbmWmN7m3hIojZRIzPyZGeksKFwaVkfJUlz3Bvg0ARJxqHSvyZ9M9mII5WRO X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0f8c906a-e5b8-4c31-d6cc-08db7b8a9b3a X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 05:59:04.4576 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7xN6c+Jc65DBGxZ0k7dpf3fSslmU277nJEaCKQ9ifOSX4mQNJBxfTWKOU6aKOBvTtD0XDOz/N20w/iTUuxa/SDP2LTxcLVpVbfL/02DA+0s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4697 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-03_04,2023-06-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 adultscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307030056 X-Proofpoint-ORIG-GUID: gJ9jXKm5Dfz6Ib6NFElSeh6loN7MmKkc X-Proofpoint-GUID: gJ9jXKm5Dfz6Ib6NFElSeh6loN7MmKkc X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 902624000A X-Stat-Signature: thmi84dqhxxn6kq4dfwayuuhtzbnzs4d X-Rspam-User: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vc3hBUX5zOWG04cncAgsG3wtQ2mqGl45MV3Gpla6nHxCYo7BTDSzG6BFKJ8g8tVfbrBA53wDK8RwaCPYMc1bBjkQXCsxX9t21mrPAcMopWSn2ZUlHS5wEeXIuVUxV2Rrtj+RwH8rDpre90pHjb0S42gIJ17FqqQMN2mk056UPQ3eVFGHIjFWtkxuFh+clu+X5vGCjBzwluMSe+NfGzb8mWLkuKnDNJTL2NqVV2E6w4U3L1LYvA/UXsfGzY1XXVYjlfLG8v0SBvtYGJ7dVNqxqBNpsUiRGei7OrQAnrdmcc1QoIptRdpap6asOkjWH69ro1h+KqqQeE0IP0tNRX2oeyRj3LNJC4Bc1O9F8R/fSw+eTnZwXoUdO1Iz4R73yvXzbzkrM2bdjLFx 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 Reviewed-by: ZhangPeng --- mm/memory.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 93480e846ace6..33bf13431974c 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4594,6 +4594,7 @@ static vm_fault_t do_shared_fault(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma; vm_fault_t ret, tmp; + struct folio *folio = page_folio(vmf->page); ret = __do_fault(vmf); if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY))) @@ -4604,11 +4605,11 @@ static vm_fault_t do_shared_fault(struct vm_fault *vmf) * about to become writable */ if (vma->vm_ops->page_mkwrite) { - unlock_page(vmf->page); + folio_unlock(folio); tmp = do_page_mkwrite(vmf); if (unlikely(!tmp || (tmp & (VM_FAULT_ERROR | VM_FAULT_NOPAGE)))) { - put_page(vmf->page); + folio_put(folio); return tmp; } } @@ -4616,8 +4617,8 @@ static vm_fault_t do_shared_fault(struct vm_fault *vmf) ret |= finish_fault(vmf); if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY))) { - unlock_page(vmf->page); - put_page(vmf->page); + folio_unlock(folio); + folio_put(folio); return ret; } From patchwork Mon Jul 3 05:58:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13299596 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 64B59EB64DC for ; Mon, 3 Jul 2023 05:59:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E64B78E0093; Mon, 3 Jul 2023 01:59:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E14E18E007C; Mon, 3 Jul 2023 01:59:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C40758E0093; Mon, 3 Jul 2023 01:59:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B5D208E007C for ; Mon, 3 Jul 2023 01:59:17 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7A09D140735 for ; Mon, 3 Jul 2023 05:59:17 +0000 (UTC) X-FDA: 80969247954.15.5246EA6 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf11.hostedemail.com (Postfix) with ESMTP id 22AEC40005 for ; Mon, 3 Jul 2023 05:59:13 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=jliCc39L; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=nrGe8yxg; spf=pass (imf11.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=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=1688363954; 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=mWjQpZo2a6ZCry9xshQ+oF9KkRkC5CiVlfyKFHFCjOo=; b=DHrmkeEzdqWW5R3oVEZZzEJSFSqXCUPJibMeE/Vn6xl76utTEn5Au7+ztogRWZeL1aWH87 WZeTwQJNSjzlbdfC0np7IWdAnlnOG9I9ModPfT02clXZoG8L4mITFf1fv5VI5nsl3Fj8Is CCjPtuZiEbb92nhgdwp9dFrsFrS4GY8= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1688363954; a=rsa-sha256; cv=pass; b=L2spJh96GJCT6kks/ia5mm/nJW/7ReHxLVTok2HTtkcvrFtvSdjrntv/y9HmzqcJJEcqTy 4F4V259y+6c9Qca3zQZ7BESJbUHy59BjyCkorX1j/MGo1WSRpPavVOPkQklpndRaIOxkox fl6UcXw5bNUpQ1UVCWGvSrlNOybBWVk= ARC-Authentication-Results: i=2; imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=jliCc39L; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=nrGe8yxg; spf=pass (imf11.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 362Kmxhr017325; Mon, 3 Jul 2023 05:59:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=mWjQpZo2a6ZCry9xshQ+oF9KkRkC5CiVlfyKFHFCjOo=; b=jliCc39LISMvdZaP8bIYwVGCPZCXISSwiwHGfHRhSbCb2+fZo+I7F/yq82ZPrJvMBLJG l1U26Q9NmAv+KvT0jKMZw6cEhUIM031Jv4iwXFrqfuXKRHVZRPsGfpUGUzKtiCjGV7lq cIqzpOE5f2WvjLhuxjU3Htif5O77136PrHImnN5fM6Syft+FwXozjjhUEKZkpFhTTMuN GTeXH1KK+yU0mrNK7RAqEdpPeug9qg3+Tq8GcWNFPaLI0aXrHSE8Ii351TvRFpoX9tCc Fe7vRcDc2CCUFj0XMB9cuxRdArhCyUfEjwqZGX0NzPudZ58zxGSa2Mje7onUW0H2h1jC 1w== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rjbrt9tqg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:59:10 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36341NvC038627; Mon, 3 Jul 2023 05:59:09 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rjak2kv9g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jul 2023 05:59:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MH3FlEQ67bWA18PMv1MRGSwxAcnaijJ4iafaTpRZm7gAmTXAf0rLFMhOJV3U8RhOkGGn6tAlIr3UdR0hvBbNgG8N5JrZcv8rVOJm+Xx842mOwqnhYWAjMSB0J6YbMgJ2+vNo1k5YYI6tlw+bAhpQPFFgNIVxQylIJArPBvLEzdYqeeWPssEHwHTGfGvUDpf2pxSrRVAPny9MfM0DDcq6PsCs8M1/67NkRPU7AQLxajuRTEg4KkUrI0VrDs66yOtHNUCkL/+Rg4dreL/PTKvxz9FmdXFUM1arhiIfS2uGhglbZ8qQVU9LrhBhHzspBg/NyUyjfY9PxJLMIwKZDr+YMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mWjQpZo2a6ZCry9xshQ+oF9KkRkC5CiVlfyKFHFCjOo=; b=D1CIIZldfpm7nXyr02FbZYL8BmDaT+nODbqHxZmlozGAZCDClm/zMm3ML20BOfjX08eAjQImHN0p1XkQ+A2oaLocbVYUpQoXMRupG0oN8MkyUzDq8JBO3aZtdO4tU4uEVbQ5P60u4s7wumvIUKfk39ojkbu4/gEOT558SzfSsVuIsbf3fMu6eos9s5MlbjXwXAhr7kOSNllXXY6FOSZq0v4oK/NT7803xkgooiAoyMWF/c08fTP2CeU5JMW9IPAkUUX8WlmE/IvYsspQFAWyi/XyH2BpbqzX3mxRYVmhXyiJ017++Eak6EdFR6Pp1ZLORplodGtbUu3pkk7adtbNVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mWjQpZo2a6ZCry9xshQ+oF9KkRkC5CiVlfyKFHFCjOo=; b=nrGe8yxgYcjS6jdyXaA3OwdxZ68eRvBX2f/IwD+E/df420KqgJjrWAS10ZXWoQwcdZkx83VfP7/wby3GHsoc12FQbXx+nfYh4+xz2BLd66tLz01EaTJaidFV2+GEdBPq7+J8zn5OohmBs0RGTfaOJSJp6wq3F6HFnAd1+hppIgc= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by PH0PR10MB5548.namprd10.prod.outlook.com (2603:10b6:510:db::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 05:59:07 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::d9c0:689a:147b:ced5]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::d9c0:689a:147b:ced5%5]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023 05:59:06 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 4/4] mm/memory: convert do_read_fault() to use folios Date: Sun, 2 Jul 2023 22:58:50 -0700 Message-ID: <20230703055850.227169-4-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230703055850.227169-1-sidhartha.kumar@oracle.com> References: <20230703055850.227169-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BY3PR03CA0002.namprd03.prod.outlook.com (2603:10b6:a03:39a::7) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|PH0PR10MB5548:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ba42725-885e-48b6-3d09-08db7b8a9cb8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DQUoLkhhr5DsQDs5vLzMaGRONzdcH2qgy7q8gqoP05rg3r6Bb15RvXd1G45fqlBz2gKQ3SWCFd+JER9KpIlXjmkFJiYDvevBA7xWKaRbmOdRIf9HXIDj24Y5lMeeJ6Bv/e5md0zVH9dSsmdCcosGYjN9iYdui2PjZnlAybYYKW1nQyZMyiVxu1xGhdoXUEoZGAKPRXiO0Gir2PD4aV96KbT4Gdk9Z++P4sGXWQWDX4N+7N38hlEtrpcjk4S/HkUGMbdijmsTQNEtJgnvszRHPmFdikCRNayITy3cLddOXvtchSWV02vq4nQlh8gsCsdCtg8oZaRB39Zao6bOvIR4Z5TIZOY1BcRyOUlhecuXmm4HDGWdaFSJNiZsSW+2QkZ0//xCceH0hpdwkDpp0NApF2WC9hQOMgVFUlbNunbqengvcDc29j+k9AlockHFHKh91TOZLgb3oukkgdYKMRpEWNoljBVfNTzmCDqE6s5CV7Sd8Ov+cnwZg7bkAoNIOhawHuZqMABDhyomy+QzgV+FgAP+ql1tgZtnMgTq97ik10UerzeqKQnSxat/w9CETKLL X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(39860400002)(346002)(396003)(376002)(136003)(451199021)(2906002)(41300700001)(5660300002)(44832011)(8936002)(8676002)(4744005)(36756003)(86362001)(6486002)(478600001)(6666004)(107886003)(83380400001)(186003)(1076003)(6506007)(6512007)(2616005)(38100700002)(4326008)(66946007)(66476007)(66556008)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tNDugnlBGdz8PLbf3FF7c8UTx0EK7uotQcSoT6RgZNbH25zd6EtMhyDBGE32uH7chw5Z7MYTZUbe6Yu2Pn0lLs/0EtNx8yJyegXw4nJTOenmgYCAYwGU74mjtA6Bb/DvJCdx5o1xa7UGWiuhCGHnw4OpWrroVU0z/L4E3VmnCPDRaT0RoqRa1nzSPsRBRpnn3Uu7r1NG3/7Merg9hLdHILh1CPcaz2ZWT42csPyfP47KBlagcwx3pYj0ISh17hqnPsWuf/SjCRg1DKW9Wwa75hTp8/49Um6nZGZzeAQU2ov2GtedrdkYkICReZieHmx8tpN3B1qA7ExKGzO1v5o6oRgBkdf1tUkmm8iUxamGgEl6gIM0uDoBjCr40Br+UfSuLTkRqfixQyTS64uPkotl1GQWmvzV4Kl/o2a1LxRa6XmC2aNXbQ1QCf//UM6XdgACpQSCcT7wzJnphnIHdeOioy1iXbrB6g8BBskE1B4CFyHXi86tDMeVsO+etkF2tSIjDhKcrnJcZ04YEIpRkt/f+UjNtIqNwxyZW74+g7uxeIBFd4V6hVJeyvocX9cKGFnY4q08xNbNrqjJHnrlI2HuM2pJDjmopBMa1rkkCMX8TRXFHRCull+TdqVtwvQd5EEKp0T+ZXOXQinjyJX+Ytt0TIbzqBvq+GuWdkJkydEHo0Xb7B5dnm8OAUIrKtkDoa44UlVIgsBIKvxoLzhSE0y0ff1gb63bu9Q6A9n18AfJgAsGeV4ONCHIArMMzVUfv6+bBtYzOW1MZH0Qx36245aJmLNe5IkjGodpNT9RLvTtpgXkgiuuk2t3i1XPm/njD77+lwWJi1T/EoaaT9vAFMzo2+0vmO0yFJh3t3jkQcaUNEj8pIw9idzfteCPYHlK8i4BcTogcm8eKndjVQbj6l8ejA7z++PEuHPZ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zQfGl8IWiswh/okj0GX34qUDnmBGKm/UpXn5lftKd6WHS4sh3Go53hjfeS7UeC3CPpzNQwLPEDCg9ZdjWyGiwef8S/9zr0/aoBbhdRlsQbivo5UaHIurEcg7P08g86IVgStPwJGIDQXspg+ZSNUTgb+1IxvKwp9uXItFPFgg/tB2Qa7CkTAMI1uK0jvr1bQHDwEMHhFZjRvn0VzF8aghIote3+LeRDZk/0HCUyZ5XLn9c6GcugBD9/FlgR1Srrxfp1zBbqTEr+AqYL2aOTJVeYiWSXuPRPo2P/mqc/f4uKtTkH5SRXNuAGA/GFvsZGQ1t5BkIOpfLDDfX6v0+svG2I4MjFCuJCs3dKPXXLRsCT4spSDXTMqeiUN3PE9cWPVi1uEFPQsSkH4IaTGI91fEF2hxL6QeV/jjzU3WjKSkASCa9r3JJ6VJyssgtltEd+yL71oODhorWAgGbq+j0bFPgJoCHeCNLaF/ugO7TOXaea9GBsXEKfyj4AH3TtAVDNgF4CvAjF49kn1SSVn3INmfAFccYOSVAHeWtnBGEK2+Fat36lVa+ib4jZ+G4I2ttomeRfLfN44qjZ6e0AIm5BFZoPm6GT+lNY4hJsXMDXyCAY X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ba42725-885e-48b6-3d09-08db7b8a9cb8 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 05:59:06.9136 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2Zf4r5vNmlvAiM9r5sTB8vGAot5HuNAjQPxQu6Q/lTKpApx0V4qa4ApOYNxY7ZGrGZ489XbjDCdpeXx4hUwWgJ8ub4Wy8rm7xV03FTYU0hY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5548 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-03_04,2023-06-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 spamscore=0 mlxscore=0 adultscore=0 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307030056 X-Proofpoint-GUID: BNAt60cMlimAfNfcHa035vsMOJJClT3M X-Proofpoint-ORIG-GUID: BNAt60cMlimAfNfcHa035vsMOJJClT3M X-Rspamd-Queue-Id: 22AEC40005 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: x6imcomf9pgrbxy5x876677otgjgexhh X-HE-Tag: 1688363953-275634 X-HE-Meta: U2FsdGVkX18M3Jcl742PU/NI7LutARBZoTx/UJ/6Gnf7QySuBw4CrfLOpYOfI8RkqZJxfM9cGLJlvslOSpj7dTUafkq5bsLXYHjI2+5EbZIv8Uptcf7dAXB+ER9H9a+28JCHYi719518HXrqpalpP+1v8V26B0r3ZxYnReNZ7iADEt0dgZUrRJse5RTKfJCmB6BOxNNXFKV7DVDesrvEM5NW77wH60sdssbLRznq/Q1ZaSWn4ZOW47Ac4+9NeJLnhpV3f3bBmxJ2UugISMT/LvVtGTWTK5qxGall8kip9A+rsNymqnns7PFzk8gVTfzJb6CVDqr7G0Buw0cEvu2WeiN6m3EbJnJJ0OIOczmQ3P6e8hZXaiDScFx5z2GrCWi11LPismjh7igm9T2SjYN3Y75kHj2l/SvCdESw75enJCm/LoVYrgsj1tPU6xLGzEfthkqWyggtD3/Cns2zH+KWehcjsmPvM4BIZmm0mgKGNyMNDcedMUVw4NxmfKLBCgwFgPlkTsYlyOL1wmVLsE3dDoOWL1ztAxsi9zksOWynie54dPMu9wFLIszZoYAZE8DOOFrXpaP5P/X3In/2v6kXs6Eb///N2IEP358Gp7pSqrA6kMciC0MgsugBV2vbRr0mecgCCAeZ/+a2sPFn0ln/aq+Yl0HX12JKSPwLbwzO0n39OBRP9LHe/tOrT9YqCP+sEOT751qLMZS2lWggg9+qkhrtg4dYOpDJrb/uLFOAMTdPukvMjGZNKyLacihaDF+OJUuII2OfHuJVPFTlOZGuyZ1r3Qn4hfyKNi/mXPFVflZhYMRqOxsDyk+kNmMiDj4RizaFFNHwTw+p1xRob6fBO0IQUN6WjESrf2rqk/55XVh/WCW8/B/wuHqhGAooXT7I4wlqS8tCHhTHTmRbkA4OFt832SkB1UYIXgkYMx7kWMDUEfJ/yFURdSlrgX95z/MUMlnlrNQiwIdDuY9mGpr 88k6iUEH unyR2KX4tMrRxAFpFw48AvD44Kdgfi+SSDt0PRuZ0x1iJwJRpYXLaMJgwp3x2sqRkY/hfmNr6XTC5TE01AxyHyxoizw9HPlL1v9TrNcTdftEDWWbe9/lll2rEmCC9/pcpVp4PoijT9PotmM680zuMX9yBog+Btgc12z0pJqZslHcT9UQ1BMmGDR1naH0qDsbol/9yLzOX8Y0o4J8JtnRwxkuYsllSzg7eKMUpIzklLJ7YlM2fII+o7qJhRZ9sTMyUPL5zr7Wzgh9K86HKwxlI8tfc7SUGgKQOqx8TisKHEvlosa7RyoeeP4LdxMF3AHzRYKR20VvNQNHsqkdYAJq6NjGml8LWCwt9FYzVtipOvbx2sDkArPEjop7ag19thGMaK675hqfYKVpvv45IrjK8I5fJ5oDd3KXRAyznaf9ULHQNBD/CNbzMe4n1s5C2mlMT+X/J 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: ZhangPeng --- mm/memory.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 33bf13431974c..b97c66df4adac 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4528,6 +4528,7 @@ static inline bool should_fault_around(struct vm_fault *vmf) static vm_fault_t do_read_fault(struct vm_fault *vmf) { vm_fault_t ret = 0; + struct folio *folio = page_folio(vmf->page); /* * Let's call ->map_pages() first and use ->fault() as fallback @@ -4545,9 +4546,9 @@ static vm_fault_t do_read_fault(struct vm_fault *vmf) return ret; ret |= finish_fault(vmf); - unlock_page(vmf->page); + folio_unlock(folio); if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY))) - put_page(vmf->page); + folio_put(folio); return ret; }