From patchwork Thu Aug 22 19:25:40 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: 13774122 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 34B48C3DA4A for ; Thu, 22 Aug 2024 19:27:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F1BF680058; Thu, 22 Aug 2024 15:27:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA35580057; Thu, 22 Aug 2024 15:27:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C0BAD80058; Thu, 22 Aug 2024 15:27:04 -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 9BF028004F for ; Thu, 22 Aug 2024 15:27:04 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 3AB841418AE for ; Thu, 22 Aug 2024 19:27:04 +0000 (UTC) X-FDA: 82480864368.03.A64E597 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf22.hostedemail.com (Postfix) with ESMTP id 94058C0018 for ; Thu, 22 Aug 2024 19:27:00 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=k6CpqPnD; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=yVQ0IEDa; spf=pass (imf22.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724354756; 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=Lq7kRWDy/JaP69JbRtRp7VUtMeb++6kHnahDgE9Gb+s=; b=7PfGFQ3351RX8Nqc4v1bzYl6rteQX7swTv/0KB2LCaHFZMkSKMK6xFTg5UGXs1W5ltpaDn EyRP/gyiqwBP+exYYFXLc3vpEA8ahWHAMHyt8iC1cqGaw+RRi6T9RK05RQWYA/XZmOf4P8 qzxOVU94hCnafaubdxYPe7LcLdjDHPc= ARC-Authentication-Results: i=2; imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=k6CpqPnD; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=yVQ0IEDa; spf=pass (imf22.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1724354756; a=rsa-sha256; cv=pass; b=TcEaB9LX303rumLG51Snyy0QhYQKDH8hoFZJJQFHUdP5M24vVo7SCxqPMUHN5/qmWPwo3U fq1Un7MsS4ho/2y54JxPl/EYB5s/vaZyVYXp1BPVXGPrKd4PKcalL76SIedNxIf5+0Q85K kF7kdjdzDGCgt1g0+XjYzlNoHPtv8KQ= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47MIMYVF000818; Thu, 22 Aug 2024 19:26:53 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=Lq7kRWDy/JaP69JbRtRp7VUtMeb++6kHnahDgE9Gb+s=; b= k6CpqPnD8aSWktIcZ6TwZNm3udxyuEOGh+VUcTGWfCToMmHA8w7rT4WZ3v8TDIyb UBLs6wcNagqFCws8HhIpe/Y2h9H+RL0ZRnCunuGpuLsoghC/GJfFyF6ttzumxMeH n6rgmswEhQ+MY3cmuqQvipK0nYtCAt+6FH2iuqGy3xOvSH7f7uVrru5oif02qUsB JzYyJccq0CdBEEqOxfJKHNvOQroatfAhnosEV4QwjtVO1Ffd3WLkyl6KTCOXdcf6 9B6kKorbGRMOHYbtqFxlvLrfOeSvRZ/cvfLg5dm6S/xP7PTcufrPONX2ddE8KyQH o3MOml8YGM9dYxSnTej5IA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 412m6gjwrg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Aug 2024 19:26:52 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47MJJOnU005646; Thu, 22 Aug 2024 19:26:51 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 416bcu08bq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Aug 2024 19:26:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cG4FSBgOOC96TlP4ZY2TaYtx8TvbwmppN7jCy1lp2wyuB6usjzs05fuMCDDbKH2toAIn/PGqp/OumPz3jIjbQD0d3O0uFDcAdStZwitIoxCCTW64+jmWEFpMJ4dGfEHd6SNbMdh206MZ1d9JF3DO8D4QR6Glbg6LDWKCDtzALg+VhTb2znFlQu/kU8b9bc5VFce7uR0TThpzheTTkz8xawAN+1MADOdmKWOe+Tx8Elvc5phToFIRMY0xA2MilYbYgGVyNjb3EbHBxLqsJDxKUJX639i7CdjnMJbDQLY+qI4hjM9HMe2PbuvBXvRZlPr7tbvN1WdodU7UmYZWOP/dyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Lq7kRWDy/JaP69JbRtRp7VUtMeb++6kHnahDgE9Gb+s=; b=uUWdHQ9lY6D9buLCU0lQpTzpm3M38JUgPr3VNoeAx+YpDjxqlp6KjprWPLvLZtZIzfmhEe1c6uOG9M0jeRy7oY9fOHDdvp0b46GL+X8W73+0Ay+/agiPmznow8133Tz2ro61wkVeHJHdbJs4HEjX1ICdj1ZBRB3HSUftRCj4Tenr5XVyvUK9AqKo8P+a+9m/MVRPuOHJu/ZCvlldyuU2Kx1gU4+pbDAgn9UdZdqV6lgMoiLUhtWJ3BhnFdxbnAS+ichKuaxWTBsykXOujQQQ5waMQVG9VZIXmfasc00tjHqCRDolx42gK67+hyiowTqJG5Yx6W38mCxxb7x6JQIPig== 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=Lq7kRWDy/JaP69JbRtRp7VUtMeb++6kHnahDgE9Gb+s=; b=yVQ0IEDa1c2wt1248cjptMsTF7Rw+vjLFXFsKpL75cow7ddEsh+XSA2phTcsAVZWkt6f7TkAp5skfLAxMBcvf5giwQu4rok7GNPSyWCNiMoIO/fmrucC9bwid3D4MINfjFDLLl3j9IRTX0DcUOlQt4TtQ9Z67X2aj1s+RlUUxLU= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by CH3PR10MB7761.namprd10.prod.outlook.com (2603:10b6:610:1bc::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16; Thu, 22 Aug 2024 19:26:43 +0000 Received: from DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490]) by DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490%3]) with mapi id 15.20.7897.014; Thu, 22 Aug 2024 19:26:43 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Suren Baghdasaryan , Lorenzo Stoakes , Matthew Wilcox , Vlastimil Babka , sidhartha.kumar@oracle.com, Bert Karwatzki , Jiri Olsa , Kees Cook , "Paul E . McKenney" , "Liam R. Howlett" Subject: [PATCH v7 18/21] ipc/shm, mm: Drop do_vma_munmap() Date: Thu, 22 Aug 2024 15:25:40 -0400 Message-ID: <20240822192543.3359552-19-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240822192543.3359552-1-Liam.Howlett@oracle.com> References: <20240822192543.3359552-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0017.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d1::28) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|CH3PR10MB7761:EE_ X-MS-Office365-Filtering-Correlation-Id: 912e77fb-540c-4d1d-99fa-08dcc2e05aee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: Jk93jM7BbsHqigYiyMUBREvP2TNhUYzVLD3hN+6xM7hLpqDsr2IzEjJEbN1L3aTEPsVvuDlUF7Ahi99y2dooPpDq7+CpLf3Lm4JxnVRDKhojIFCOjAR+s+v0j2NA+DwQ0DFLaTQKFiGUGt6ge6bT/dQKAx5EJGd77GvqT/9FfsbVFufz3QMqvLLaMqkgoLbi4L05yYwUs9WRUZTEtyE1q9vWuhGN/aJ+efPo0Tgod0rPqO8217i7gznvvZLhbx5ivsMnWvpW05cOkmgHbnc+pstCebpe2OqyM3BNIQBk7O4rSycEGjRTsLEWJRDwcoNxaz/nCvBSQiDlUrczfcHkjsPHy776VOanr6g5QBPpvn1NaFhz2bEB0rhB7KPjXdsCqTuVrPSeFrUSzYX+VJgMzgjiyZS1O52q8WamTR06kffpGfj5QZWjWqm8kZvgc8LVzFwkbpRsnnEocQhtbKCDO55X8i90KsctBUVCWENaTWJdDiBNnie+Mh2Vb7xrUX0dxG6juj2JyGAyBZKnLa0HNFVm43Ew19/KfrDJce+NfqmYEEbM1RB+ufMnn5V+/foSmAZfCZeUQGUbJ6SGxzf1/Byv0iIqfy43C6kpGclxQmcxj3EjlU6gihuginy141s2wwmb1bzGdXjlzoqSsFAIexf3mAh207/bGBrQPq3BjaTqe3y1seE6bb+1wqD/ty8CVXvhL8+EmCwEr+pGA3V4wQeGBnbldhtgP64dzWqiLwJL9FRM5UAlAKfw8UQqaUCBVgx6/1y4TtwM1d64F9aLflTtSwlZklXsqyD6WRu4DGwOMEqgwNapj7pWA/gh595ZFt1hu9KyvcO+mg0OcM1wGrEy3+qcsmAxvfRm5n/cWnKcJQLcEC85Aa9/i6J6dtsZuLakwPnU3LKcQ0szfjXBiOsRGmbxGfEp+HOoc1OON5DPmqMwCykZcaH40Q4vw9AphsRLXlRZrsoXCP+rG/sQXc8OW1vAzF0jJiOiOs8UKCuLfjWz7fRrJ2kKUoRNYRkVrebJE+iKH5oZRJYAAKrSVkP9YUcIxkWrBBM73lPQzmtGbKAvaj5FPCDUz9NKo19tc8pk3FOvFftm3x9+T9ndRWi7DoQjCBXnUJn0DGQJElbZXKvsJ6rZrrqdx7n+ZZ5WLu71kRpGclMNBKE0SQmgIqWAeeG1atYW7DZdnYCaSiyI6gV5hjOA4nnGIqoLXLMVNiaeybwFu/GxGcVajnPoG5XEnOuVeK18bc6dOF3j8+m35bFkWzFNyc+kqGMyhq1NPQUPxuwV2BkHWPmBJnIFIvJJn1ca+LCA0nFhcAFRBI3XgtkGKa6Rds2OxMb1MldohguUOqktvexNSnzU4Iei2Q== 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)(7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kynkB7Ree5EiqR/nCqaSEiv//0jODJS1MvLXBUFBXB9NODsbctMGF42XDH1pIjnuGW5THlWwmAyPUrfONlfW34zeC7ZuOcQElXRsuqBCe2gM96sjY1whX8zrPk0dc5/zkad5xxqHFu3hTCmqlK5mv49PJ0Vf/T8z4tvklOFykyhOgw+LMS87P8zZ/2RDvfsdemidwDaJDyMqYQZuelkzG6tRYlBE6o7PwJdAnANp2z1derCvUhZNKKTgErk9pOp2g4y+eDGjR+fSUbczCnp+QfayMGuZ668TJe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Q0tav5xpmzFu9KD5QskLC64qILHrk/31WWsnEx8mxtHNYtNretcHu6jccRtzbxgEKWlFxob/z3Va/D2bDrZU6Fm86Vl3dvcrVLRo4lVzzdbmWvOFMalKDR4cf4LN72u/P9nDS5IttM/zM7ZZodd+RS9zONe04obMe6a616r9EUWSNzaZF/fyt1oLxok9Iu4klmXbY6uf4yFFuiE0KFoKFtEfqD2c+bzn7bS7abCc6/8JAFy6pQ2QQ5Ctn9A0eyQERSEvKVGq22/M8t1sjw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: EP9KscxNfeGRCNLd+Poc1wZzUFaME12Jzp2pCLD+d+oKZjEExIHSHXn2RglX9IFpaMkdm0J+JHnOt/OQgp6kWFIleqyA1c3+TpRYv0Q9U+39RIfw5yb3zb7Gu3q/03zojzQLRvubfU+mIb+8u04cgiYtc1TcFst2c0Hb0x50kacz2Le2Ahzan533VMP9PDq5LZy6U7ByV9Yl0LR3/JFLkQWgbTHOw1bAytYiANX+POXYtHjykmeB0M22KlaH+gnh+LWerbm+TJ8pO3YIqaMzXy2GbpGqOpJO+IcjzfkLjV3w1oa4GuQGhBnqVjX8N/JpkhRe8aBDombR/0BjvyNwENlP544dxl+vAyZmfkfKxwcGaWEiKvDDYMPiOB8SLcVn062PtOG1QYuQ7BZaEJVa+W5jZB+DVrvDzYBsYg5qxMf58dzJiWwZzCZ0hNlaOHtJpn3PdvwfiPzlrAH0KMVgvb3HRu0vSKQMvtqmWplPqGfDeSOYDwdBDLd6nopQnBE+cSpEvuUTt+/chXVFVBoVAjBZHVsa1FZ8g9UGD2V5keHnitilp7xtWwz3dIR31PCOPBB63yKFMgPv04uSObXGCOOV99eM7CjuLrLugOfPSOY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 912e77fb-540c-4d1d-99fa-08dcc2e05aee X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 19:26:43.5711 (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: /3ifNBehNGlnfbd9s3Y4W5JgQIqLdc5TsoQUm4lqdBWNc6NZ+rAFH98+tOhlxXX/dhsvQqijpZbN2bSySbSL3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7761 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-08-22_12,2024-08-22_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408220146 X-Proofpoint-ORIG-GUID: Heg3FD0VzmWVWVKfoCUx9ddUPeAg4YOd X-Proofpoint-GUID: Heg3FD0VzmWVWVKfoCUx9ddUPeAg4YOd X-Stat-Signature: bzfgomg6141sohxwiaoggwdqa5k18huf X-Rspam-User: X-Rspamd-Queue-Id: 94058C0018 X-Rspamd-Server: rspam02 X-HE-Tag: 1724354820-58885 X-HE-Meta: U2FsdGVkX18sZlZ5PlCb6kXx7jWIH/5DfDkbd8hs7Q3yL/IkVwrIEg/N0qaD0pSTFaFtimKctdfJyivn2+FBn8wNKPmlaP8DxWqtEzrfBWkETchN7E+RxpJTY6jZWZSRmDteVvYYo7Q/ljkGgZfEVvBRYla0r3RuXTEn0aCuEhFuk/UbetP/yoZPF0M9L6mAJSBLanuXNs91JrxX5xqFIDgZGAiGp4JOnFnImypH6MNGbC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QrxiDN4Lw2NpuLi95XTIosES+KuFAY01aUaudeS+Za8Usq544DyutZI08whwyWAnayV2lBYvl0on2jXYcB5Z+SZeWdIOO2d3K1S6SbGcqmWEJM9efzgY+OVcgaBQt5foaEA9TbmTB/E6k268ekw6/c6PhBb4Fnl3Ao0LWn4oZcgREm8zokPq/Mo= 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" The do_vma_munmap() wrapper existed for callers that didn't have a vma iterator and needed to check the vma mseal status prior to calling the underlying munmap(). All callers now use a vma iterator and since the mseal check has been moved to do_vmi_align_munmap() and the vmas are aligned, this function can just be called instead. do_vmi_align_munmap() can no longer be static as ipc/shm is using it and it is exported via the mm.h header. Signed-off-by: Liam R. Howlett Reviewed-by: Lorenzo Stoakes --- include/linux/mm.h | 6 +++--- ipc/shm.c | 8 ++++---- mm/mmap.c | 33 ++++++--------------------------- mm/vma.c | 12 ++++++------ mm/vma.h | 4 +--- 5 files changed, 20 insertions(+), 43 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index b1eed30fdc06..6f1835e3b430 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3292,14 +3292,14 @@ extern unsigned long do_mmap(struct file *file, unsigned long addr, extern int do_vmi_munmap(struct vma_iterator *vmi, struct mm_struct *mm, unsigned long start, size_t len, struct list_head *uf, bool unlock); +int do_vmi_align_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma, + struct mm_struct *mm, unsigned long start, + unsigned long end, struct list_head *uf, bool unlock); extern int do_munmap(struct mm_struct *, unsigned long, size_t, struct list_head *uf); extern int do_madvise(struct mm_struct *mm, unsigned long start, size_t len_in, int behavior); #ifdef CONFIG_MMU -extern int do_vma_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma, - unsigned long start, unsigned long end, - struct list_head *uf, bool unlock); extern int __mm_populate(unsigned long addr, unsigned long len, int ignore_errors); static inline void mm_populate(unsigned long addr, unsigned long len) diff --git a/ipc/shm.c b/ipc/shm.c index 3e3071252dac..99564c870084 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -1778,8 +1778,8 @@ long ksys_shmdt(char __user *shmaddr) */ file = vma->vm_file; size = i_size_read(file_inode(vma->vm_file)); - do_vma_munmap(&vmi, vma, vma->vm_start, vma->vm_end, - NULL, false); + do_vmi_align_munmap(&vmi, vma, mm, vma->vm_start, + vma->vm_end, NULL, false); /* * We discovered the size of the shm segment, so * break out of here and fall through to the next @@ -1803,8 +1803,8 @@ long ksys_shmdt(char __user *shmaddr) if ((vma->vm_ops == &shm_vm_ops) && ((vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) && (vma->vm_file == file)) { - do_vma_munmap(&vmi, vma, vma->vm_start, vma->vm_end, - NULL, false); + do_vmi_align_munmap(&vmi, vma, mm, vma->vm_start, + vma->vm_end, NULL, false); } vma = vma_next(&vmi); diff --git a/mm/mmap.c b/mm/mmap.c index aa4aa49f3b97..51ab0bdb856c 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -169,11 +169,12 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) goto out; /* mapping intersects with an existing non-brk vma. */ /* * mm->brk must be protected by write mmap_lock. - * do_vma_munmap() will drop the lock on success, so update it - * before calling do_vma_munmap(). + * do_vmi_align_munmap() will drop the lock on success, so + * update it before calling do_vma_munmap(). */ mm->brk = brk; - if (do_vma_munmap(&vmi, brkvma, newbrk, oldbrk, &uf, true)) + if (do_vmi_align_munmap(&vmi, brkvma, mm, newbrk, oldbrk, &uf, + /* unlock = */ true)) goto out; goto success_unlocked; @@ -1478,9 +1479,9 @@ unsigned long mmap_region(struct file *file, unsigned long addr, vma->vm_file = get_file(file); /* * call_mmap() may map PTE, so ensure there are no existing PTEs - * call the vm_ops close function if one exists. + * and call the vm_ops close function if one exists. */ - vms_clean_up_area(&vms, &mas_detach, true); + vms_clean_up_area(&vms, &mas_detach); error = call_mmap(file, vma); if (error) goto unmap_and_free_vma; @@ -1742,28 +1743,6 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, return ret; } -/* - * do_vma_munmap() - Unmap a full or partial vma. - * @vmi: The vma iterator pointing at the vma - * @vma: The first vma to be munmapped - * @start: the start of the address to unmap - * @end: The end of the address to unmap - * @uf: The userfaultfd list_head - * @unlock: Drop the lock on success - * - * unmaps a VMA mapping when the vma iterator is already in position. - * Does not handle alignment. - * - * Return: 0 on success drops the lock of so directed, error on failure and will - * still hold the lock. - */ -int do_vma_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma, - unsigned long start, unsigned long end, struct list_head *uf, - bool unlock) -{ - return do_vmi_align_munmap(vmi, vma, vma->vm_mm, start, end, uf, unlock); -} - /* * do_brk_flags() - Increase the brk vma if the flags match. * @vmi: The vma iterator diff --git a/mm/vma.c b/mm/vma.c index 8dc60dcb6e8d..91b027eb9a38 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -658,8 +658,8 @@ static inline void vms_clear_ptes(struct vma_munmap_struct *vms, */ mas_set(mas_detach, 1); lru_add_drain(); - tlb_gather_mmu(&tlb, vms->mm); - update_hiwater_rss(vms->mm); + tlb_gather_mmu(&tlb, vms->vma->vm_mm); + update_hiwater_rss(vms->vma->vm_mm); unmap_vmas(&tlb, mas_detach, vms->vma, vms->start, vms->end, vms->vma_count, mm_wr_locked); @@ -672,14 +672,14 @@ static inline void vms_clear_ptes(struct vma_munmap_struct *vms, } void vms_clean_up_area(struct vma_munmap_struct *vms, - struct ma_state *mas_detach, bool mm_wr_locked) + struct ma_state *mas_detach) { struct vm_area_struct *vma; if (!vms->nr_pages) return; - vms_clear_ptes(vms, mas_detach, mm_wr_locked); + vms_clear_ptes(vms, mas_detach, true); mas_set(mas_detach, 0); mas_for_each(mas_detach, vma, ULONG_MAX) if (vma->vm_ops && vma->vm_ops->close) @@ -702,7 +702,7 @@ void vms_complete_munmap_vmas(struct vma_munmap_struct *vms, struct vm_area_struct *vma; struct mm_struct *mm; - mm = vms->mm; + mm = current->mm; mm->map_count -= vms->vma_count; mm->locked_vm -= vms->locked_vm; if (vms->unlock) @@ -770,7 +770,7 @@ int vms_gather_munmap_vmas(struct vma_munmap_struct *vms, * its limit temporarily, to help free resources as expected. */ if (vms->end < vms->vma->vm_end && - vms->mm->map_count >= sysctl_max_map_count) + vms->vma->vm_mm->map_count >= sysctl_max_map_count) goto map_count_exceeded; /* Don't bother splitting the VMA if we can't unmap it anyway */ diff --git a/mm/vma.h b/mm/vma.h index f710812482a1..8ca32d7cb846 100644 --- a/mm/vma.h +++ b/mm/vma.h @@ -31,7 +31,6 @@ struct unlink_vma_file_batch { */ struct vma_munmap_struct { struct vma_iterator *vmi; - struct mm_struct *mm; struct vm_area_struct *vma; /* The first vma to munmap */ struct vm_area_struct *prev; /* vma before the munmap area */ struct vm_area_struct *next; /* vma after the munmap area */ @@ -113,7 +112,6 @@ static inline void init_vma_munmap(struct vma_munmap_struct *vms, unsigned long start, unsigned long end, struct list_head *uf, bool unlock) { - vms->mm = current->mm; vms->vmi = vmi; vms->vma = vma; if (vma) { @@ -140,7 +138,7 @@ void vms_complete_munmap_vmas(struct vma_munmap_struct *vms, struct ma_state *mas_detach); void vms_clean_up_area(struct vma_munmap_struct *vms, - struct ma_state *mas_detach, bool mm_wr_locked); + struct ma_state *mas_detach); /* * reattach_vmas() - Undo any munmap work and free resources