From patchwork Thu Jul 4 18:27:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13724180 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 237ACC30653 for ; Thu, 4 Jul 2024 18:28:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A3AD86B00A9; Thu, 4 Jul 2024 14:28:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9E7A36B00AA; Thu, 4 Jul 2024 14:28:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 778256B00AB; Thu, 4 Jul 2024 14:28:09 -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 5406C6B00A9 for ; Thu, 4 Jul 2024 14:28:09 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 107B0161354 for ; Thu, 4 Jul 2024 18:28:09 +0000 (UTC) X-FDA: 82302904698.02.13C74F2 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf28.hostedemail.com (Postfix) with ESMTP id B23CDC0022 for ; Thu, 4 Jul 2024 18:28:05 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=SEnYnF7x; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hOH2ZfdE; spf=pass (imf28.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1720117673; a=rsa-sha256; cv=pass; b=iZJVXD2l7HbZtyzjHGAGlYJGPjYJqbSzB843sGSugti0/bbqA8bFBSwOAo3AIolsAkdK6H q8r+pxCPZ46ZBw4vPsNclcZFsFjgjNiCaiT0aWzwoA2mpUQ6NudAqt/3VR9aFIjITzUhUA l/BHe6apLvovGcuGilhXbNAeqXMcXFo= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=SEnYnF7x; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hOH2ZfdE; spf=pass (imf28.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=reject) 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=1720117672; 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=hlZHpYovIetZlE6yqUMS7duN92CEaSAa4tUxocsHEbE=; b=AH8oNvbtv12RzTksQxutR9b32vYNNAndVU4exZv83oiT21WM52P0eNmEBzWmhbNmg5X/Ps 08ho5k6yp5JU5zg7XBAhUBG46oTGu0YUpFnKdX8L9mf+b8ZMOdbrl6U9d+b+ciUz/dkZgm auU1M6JaOuymE8rks7pvGS5MP/DnH3Q= Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 464Dn5Yj016715; Thu, 4 Jul 2024 18:27:59 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-11-20; bh=hlZHpYovIetZlE6yqUMS7duN92CEaSAa4tUxocsHEbE=; b= SEnYnF7xaWZrmfqMD2f9fA7AMuAHjBD36vNKR/94PVzw2441kEsAIdJzt9dWXMQx XPi0ggwl8Cs5PB5XfOKgCfE04JZsF7vIU4hv4t8E1wK41igy80SbR6DjOq3I4e/A DEPOyydWUhvzc83EWBsvKkp59EKsPjKSoNxcL+/7/HGjwsSITj9HVn7iGdGJjHsK GaPb9IpG0D5EVGThwkpO5s7LTw7Ge9JyLOa7oG2vQmsuxTHXSs0qCdWArdWZEs/V t3n7s0ZOOfWl4C4UCYg37vLvpasjfcq+xcY8+dCWjprH1EnsTxpRytaGg3/8Mwv5 QV7lTZuKV/a7tZrcRnrn8A== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 402attjph1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2024 18:27:58 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 464FsRx0010337; Thu, 4 Jul 2024 18:27:57 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4028qh0phx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2024 18:27:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gsn06GdbM9iTo5q4h+44qL47/71VSbIIFIFRpDxvQz6y8jKejrrYMoZ6s35ZAWKZc0HNvEmGIQVIq6tnBmHL3gD+zVR+W/CWgmRj3vMgNQ+Jcjb3NrVHrXg13zfd9blWOlPfPqHCL2Hu1dVVhth5pUT4+QhdKXnhDgXByFWO6iHP0l1/5qOAcHFr1vWU6x25SWpi4i1pjlcwnPMP1mQxLID5cEqqrIcn5TXch5f/nN1RgQM7HzSLI0m3QCFqkI+Fs/DgtyK1nKYbA2X/rJTyZ2fhOI3IgPhCDzr7WBDLQnSgFn4eP8d7r9VJP5zemTlP0OinbEoVTyVIOn21OzmACw== 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=hlZHpYovIetZlE6yqUMS7duN92CEaSAa4tUxocsHEbE=; b=KwOFavltI+HN/UaCigcUVbItezQf9ADXsFjV4kZzQkJYGUTIJfNL1Bh1XVcsQlTcG4ZM5vRS65FHfsWG7f7z1lzmk3fQMo7fWkyYAyccY1+XP5VjG66wnrAP9VGSaHfgvaZnquPCbyn8qhOQLEf1cukPyGsgA/gzwuArn/pHDhYnftolHK3/G94TuIZfM3VKrA7E9l5yYUBXcCFHpw9QamtXPZpPQRWQQkaodVFqTllJVx709wtBK+LMJe39v5JghNtZD90q8Gy08vmq5doH4aADaGS1Z5tsz+2JceGOcvSAO1lAyDX2nD5NL5UvmB/xVTudwWUI2UKayJ8XskkHyA== 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=hlZHpYovIetZlE6yqUMS7duN92CEaSAa4tUxocsHEbE=; b=hOH2ZfdEo6uMKslJsTPdpm5cez6fpcbauUs3qxGOUKUR8nYX06Pvf2CoGSbfDZj5Ifgt2YcPnKlc7RSX0SDHU96Q1d2jzwELkDtdWHJJ2+vwaeMJD8MTu9D9ESTFnKqUFJ5O0M8Bu7FeOhjQeY6BfcNOOPtZrBf+yZI1QCJsRs0= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by IA3PR10MB7995.namprd10.prod.outlook.com (2603:10b6:208:50d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.25; Thu, 4 Jul 2024 18:27:55 +0000 Received: from DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490]) by DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490%5]) with mapi id 15.20.7741.027; Thu, 4 Jul 2024 18:27:54 +0000 From: "Liam R. Howlett" To: linux-mm@kvack.org, Andrew Morton Cc: Suren Baghdasaryan , Vlastimil Babka , Lorenzo Stoakes , Matthew Wilcox , sidhartha.kumar@oracle.com, "Paul E . McKenney" , Bert Karwatzki , Jiri Olsa , linux-kernel@vger.kernel.org, Kees Cook , "Liam R. Howlett" Subject: [PATCH v3 15/16] mm/mmap: Use vms accounted pages in mmap_region() Date: Thu, 4 Jul 2024 14:27:17 -0400 Message-ID: <20240704182718.2653918-16-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240704182718.2653918-1-Liam.Howlett@oracle.com> References: <20240704182718.2653918-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0322.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10a::11) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|IA3PR10MB7995:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ca4abcd-45a9-4d85-8275-08dc9c570533 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|7416014|1800799024; X-Microsoft-Antispam-Message-Info: KszkA+GMZ69LE67lNtKGRY35W3+eaqRTrBlA+UWCkwVMbC0ihTDoRrpTNUmgUv1N6eC03VXKvK+A/7VZg55mUafjoHCvnT8NAURxsHB6oIEQW8w98Soc2Y81RVfxeCPBkWM+ll/G/+RJjKQhae6hVdGzZtsvra2dazN/GRglhLSD7P2K2joauB9JlU69WrbemoxWG5fEzdnILug/s3ue/2CoVNXo139LgQtvs+7VY3WfR19K+BXUP7O5Z07MKfmAmE8LZugMFclmYvWxZWZ8Tkuw2O6zg3JpnkSteJ2g8bMkZ8uqPQeOnnG3jJ4khCjQRt8UrHBXASGoAMbhHyq549h/Ri9U69ROyyDla2SVYluM7bXwhN89MV3KVD7fzSOWSSmhThbsEXyAGWBv5CFQBkKhtmOrNN6rKio3Q1EEWywnSdFfBg43GqURWY9ufVezSd4ESfo43NGpckuppH/BBSp/ftlC43LO7Pd4aaAUMTM01Vn6xv0GJ78n+eDGo/j/vVQlR8tvUomu2L4ns8QDIOPEJo2J5t23bvAa10FD+4fXfMASEh75rncyxNgpouvVDWILN4hPsp+jZNRTfcz9+7Fei5l1GMJineV57+bQFOECTUoXIkWcBJInhU1MYRYzhFHGGP53kY4dJhrvSauVtkm9cSto74n9getksdBUCFKQOuZijkkNjEBpsI0QVLkw5H7Qn16U11N4hH14XlSe47YEgMw2HTANhaJ/wbwf+kolVd7J0irRkbWvtW/9D3RTNQ3RG6BZJ0U7A5KePmK8V/1z25W8sItLAIQSJE/g8EpNauc4ZJngT+uf9SWrxcaQkUD3NFsd/1m5fkvQTIoVvdBAZyDX0C/023QxSoDIW3f4rAEOs5iukRjGo3cZap1Uh2eVqXqe9UHnjRKnKppYW9FbzQW7/WkRSi1YeIMkUg3tcBiuQh8+foVHE/NimukZyYrodXjU/HIc25BCjpISuJZUndE2psrI8nyhkqweiYSq8SziXkkQLnK/zGqm5gHuNPZabFozt3CQS2rMOFLqn5qKFYpG9RQNwlGqbiXEKaTwOn0zKvopeNLseeffBj5UptdKwHKci0yoOQ3cOSYM802+0cT7vQBMC+Ii2wdUitwuQ1owy8f0ZbdPN7o/FbgX0/UAm25pQ/hfV+lCXYzSylGGbDxAG39KWmsFBqIXCgf1Rwmj1j7cjs6EXQBODbcK8DzLgOyyvQMawIVfkDYQ2Ys07zVkAIMBn2WcHciFl7xwTArAepRSGG81uDThFI3fCYT/Upt+WS/MubeIvNEaEPqC8Lj0+haz6NUrV9oCv8V7/9KHevsrFQqRHVvbw8L7i6e8/YZAztkocVrhNeFwOA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR10MB7933.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(7416014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GQWzJz7q8MYb3fmFx2HvgSFaRXauqRnR6GTWRVn958Aqt4kcqWJYBSoFtNUR+mTsqsa0Qu48etqXM09/9agvkfpcS/3Vu9sfrPdx1NyhCQB7NxAAgkQ3Dw6w0Zr8z6zTsa+heqv8+7oht+gr3FsLGYyIjZ8tuHnIS4bS/s9pWlIzKXcRikG7A7WCfj6KOX4p80AolgeSBXk/WWSL5nUROTJUx40UV5dsFXSZLPs0POHRs8ahF6Atx3uiIpPfdZnNcwuG6nwlKYQd/NZjuoSsxqH8xi/RQKn+CrbAbQpDbeGCJjKQnZCTZ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4YmKSXrougrRvnu/XmBMFgOOHD6VLX3dGmIsYYXzPMf8SOul5DyKE/CvQPOMPUBQfzctHHMSbwKEy9eGUJ3Q93GLp1OsRm6BgpU49d5a10ObOwKrkQtx+1zLlB4gCFMSp1xvD5xcA0zi7iODfUOP9iiJVqYxq/3tNM/YJVVj/dmD4pQBV3c1kPYfcVuOPYWVywhlyFJHV8vRhgCh4uOGBW6u3zxfJl+cU6YJDO68XHhRfw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: +ja5hMn8VCw3yBEdNkL7nbgqUz3ydt0gNFhPTav7ZgFyBgcQmiw2Grc3Hw/UqI1Hyi0l7RKwQGSdf5Gb7NBcXptj3xwZ/eLSjMj1blefVw9WPTeSOrRbYQprtlPPFQytrouyEtnTmyfxWZtnxp8lNNgyqnrkGKEt4tg5TyH1DG7d0q/knakXvmnDQh/ppgaJA9FL+vjFvMBu5p7ffdtCpXtKfmyMO+7ecoBKe+/uHrpiBaMCDz/wuhS5heK1f5+kHnyibX89Gl/Xmois5GroVn7dvCbmvh6r5+KS7BbdzQJyF5VoJ5ZdOakVHUoZN1b0gobnP7hH/N2m5gkW0q6cW2kuFP55kGIaccd/lAmgfgtu3LRewkRTjFV/VcbT0tGbGtDZY+9ABrWIf/RuBPkDYhy7+U/Z18MFR5YLYxMDIB2O8dCn5qKLGR9QPTiW0igNrgdWmF/mHYcfZS/oRtM9sHaa7j+MGePlHzgo+35PVICvIuFgEN+W3fBOCpXrg637U+My6ChQ6xfgNWdKSnHmzflEI8azEe1zUHauAH9ISS5DmmXWWs7moZvK0LaosDEQDnpjZ8PTBiZQgVczbb+3fdLPYmodKiItPD7Nvr4b6uA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ca4abcd-45a9-4d85-8275-08dc9c570533 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2024 18:27:54.3939 (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: Fd2fusYWnCfFmLQ0sdahcNkoRKYo3I3U9wIquWfYT5M7zrhesOhCHLgJvEjPFabJ6Hz+gz+JIqfvbEQ3/1E75g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA3PR10MB7995 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-04_14,2024-07-03_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 adultscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2406180000 definitions=main-2407040134 X-Proofpoint-GUID: IqP-oJW1nGM9zLSDfg3g7zc6hSrVDmTG X-Proofpoint-ORIG-GUID: IqP-oJW1nGM9zLSDfg3g7zc6hSrVDmTG X-Stat-Signature: 6uz5rmnn8p3wzxuewyfaocmasbrzjn96 X-Rspamd-Queue-Id: B23CDC0022 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1720117685-843446 X-HE-Meta: U2FsdGVkX1+QS+yuaiS3jL6XkxbVN6dtxwev7COts1V1CNcp8tppF52Nv8vRt3ukqFTPIt+8jABaqFt3p63/jIu+I7ykO4HG6LdAqCoaZFfm5Jec98pQwUHGICJdnXgZBNA/pWONZQbiNzGa2sL59XNPfPanV0/7KBDHSKeqgxE+p4meHP1cONgnwBV2W55v7Xa28G1WUEhm/oejOmD5shwir3n9NJu+oPNhLnO9Tp+bej++Mx0eUTAoAAcYshUTA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+Uktt796Y2DuX/GZF6PurB8akeSmIvw/tkftzC4TjH5HuxTyL/bQLMS0VRNWP2XrXYwIHt7xJLnPpfyZr/yRGMynxteBq3341L6NjG+i84kHw2z3DsbbaxzljlqdyE4WQu8snmrBTq0XMg/yJ/Hkotr/SHPMmGuUxnfXWdG+cGsURir9dB/UlLXwnDmfqGLxT9vTi7IOGYnRRc3YI4CHJ4avxT2bn7x4xEdfctDzHsgzXzrLFCvMddyDM= 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: List-Subscribe: List-Unsubscribe: From: "Liam R. Howlett" Change from nr_pages variable to vms.nr_accounted for the charged pages calculation. This is necessary for a future patch. This also avoids checking security_vm_enough_memory_mm() if the amount of memory won't change. Signed-off-by: Liam R. Howlett Cc: Kees Cook Reviewed-by: Lorenzo Stoakes Reviewed-by: Suren Baghdasaryan --- mm/mmap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index b14da6bd257f..b2de26683903 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2980,6 +2980,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr, } else { /* Minimal setup of vms */ vms.nr_pages = 0; + vms.nr_accounted = 0; next = vma_next(&vmi); prev = vma_prev(&vmi); if (prev) @@ -2991,9 +2992,10 @@ unsigned long mmap_region(struct file *file, unsigned long addr, */ if (accountable_mapping(file, vm_flags)) { charged = pglen; - charged -= nr_accounted; - if (security_vm_enough_memory_mm(mm, charged)) + charged -= vms.nr_accounted; + if (charged && security_vm_enough_memory_mm(mm, charged)) goto abort_munmap; + vms.nr_accounted = 0; vm_flags |= VM_ACCOUNT; }