From patchwork Wed Jul 17 20:06:48 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: 13735732 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 CA2D6C3DA5D for ; Wed, 17 Jul 2024 20:07:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 054F36B0083; Wed, 17 Jul 2024 16:07:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 004586B0089; Wed, 17 Jul 2024 16:07:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE7586B008C; Wed, 17 Jul 2024 16:07:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id BF6236B0083 for ; Wed, 17 Jul 2024 16:07:30 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 4657A120BFB for ; Wed, 17 Jul 2024 20:07:30 +0000 (UTC) X-FDA: 82350329460.25.3B75B58 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf09.hostedemail.com (Postfix) with ESMTP id F01D614003A for ; Wed, 17 Jul 2024 20:07:26 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=fL5IL6r9; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=DBwalxUQ; spf=pass (imf09.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=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721246827; 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=zM+ZcfcI1/W/iwJL/DRKFeE/ijBASNw1rbaQIlYapWA=; b=kHjzGv5sE5po+A35d70+0ekdzLA7I/b+YnTQ+fazpO5m69yijcYMHd8T1AjPKNzDFQ0P/+ fCs1CjkhawLD0KGP8dHRVhzYBuqtT+RZXAlBE2HMGL8dCz7KFW+R46U29RFL6FgcLqKust d6RzS8qx6ljbrCshxi/JtiaiHtPfW3U= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=fL5IL6r9; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=DBwalxUQ; spf=pass (imf09.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=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1721246827; a=rsa-sha256; cv=pass; b=CZqmLdrqAKPorIdgSWmrFdoL+aQiAgkuZ+6FJl+ES9MqVQMHwx+hQzufnv4rgByQBV1SF6 TMt/ZGxH9AGveJ3IXrIEPl0jOszz4svWU2gtXieWbnpt8taXgNaXDVadJnKJ2CGShZZsSf a+r3UmNKdQMDqpSG9r+VQLcoLYmkztI= 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 46HJtmfe031588; Wed, 17 Jul 2024 20:07:18 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-11-20; bh=zM+ZcfcI1/W/iw JL/DRKFeE/ijBASNw1rbaQIlYapWA=; b=fL5IL6r9QhHr+neMjSsbhIZbJaoJBf nH//51xkj7yr+vukw6a80oe/KESqUP8DSYBIwh74IcivzGgyaH3PS87lC94wqceC 9m4NZRcpFmvjnHjznhx4faSD+FE52uvtz9YsX0zhMtHjZxK8qxhv4uoc96adT8At xO/xw3umuBnM8ep27uRM7hD53me61VpRWBJmzymbq/QP42UcMJF+6REqWVJepNcV jg3QoMXIkKSShvgt0ASKPIFJDs+LQSw7OKlU1IraVDn3W8ZvOlak+g4uAR2pIV8m Ewdv51QFsCjlfZnOzGEmlmcj5rf5DAsJdDHtFVmyMeYl4YmpJdkKLvrg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40emhpr0q1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jul 2024 20:07:17 +0000 (GMT) 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 46HJ2AaZ039525; Wed, 17 Jul 2024 20:07:17 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2170.outbound.protection.outlook.com [104.47.58.170]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 40dwevghs4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jul 2024 20:07:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=S4RKIeRj+PGAZHNMQBhAh0NVaf85p7tlexTI0Zim4PERk2TFfZ/7ppErtT+TX63pxMBjDd/lU8wv57dOjYjr6+BLuUuL8zF6x3Z5hBDlNnf4RNbeYbNFwSJrHvg72zhKmwN0wO4z1ckJo3jNflO5v0liynA7tBIpzxVnQB2F6bNG5VGkNhkrCJj4ql2fr3YsDLhGa9FecSSV5jXyWIlJ5IE+BUnVYAkWP07+o52pQCHhf2/r7IUna8uceTVP3WPgg/r+hW1H4HQaML2d1dQKBSuFNhnK1/qSDmyXdCOiRRR1CAPfqq76gPeUsJ9dwIRqpr3UM0GvoX6ow0lK9HqQ1Q== 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=zM+ZcfcI1/W/iwJL/DRKFeE/ijBASNw1rbaQIlYapWA=; b=uTFRJWPbpG3/qVeTOlni3jBz+IGjG/ffa4CKL6kgABDt4Ob766LRXUd2AvnDA1e+q1B6bLv8sp1lCCgyOJrZtqSlV1HVN1lqYUXqMoperanx6GcBQh+JPZR3mrjl2pnVgIJsxwPvOpEm8b9Q0UDklsbdDoeZPtoHMh1ZhJtQiJ4g5oXPSG/YY8uNRRf8NaHhPoiDa0xbhATkojXTE5GHPDbcc1MwAy92FpUAkHVbRmPQ8vfFaSTZDG6Vx5JK+jQGHeQ9JnMg/6W2XWfBlUtyCcxdkn2epuTMhG/sSQU3xxUelTKXg5AzaQBbOYqf70blhD5ltDDJZt45M/CVEpaCjQ== 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=zM+ZcfcI1/W/iwJL/DRKFeE/ijBASNw1rbaQIlYapWA=; b=DBwalxUQolHjTttzf3pLmqo+D3XcreqRim3jaQav3W7secEWBS+xB5ryepNMY/oT8HgyhZSA3/HaB3kgpM2AQK8krFzBpB/frGRwO8pN1+1FIdLl2VGMNZnCO/NvQCZe4tWkxrw1lMnw0otAeWYnT4yTPh55cpIexsJ5eKcRe9g= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by IA0PR10MB7303.namprd10.prod.outlook.com (2603:10b6:208:40d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Wed, 17 Jul 2024 20:07:13 +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.7784.016; Wed, 17 Jul 2024 20:07:13 +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 , Jeff Xu , "Liam R. Howlett" Subject: [PATCH v5 00/21] Avoid MAP_FIXED gap exposure Date: Wed, 17 Jul 2024 16:06:48 -0400 Message-ID: <20240717200709.1552558-1-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 X-ClientProxiedBy: YT4PR01CA0264.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10f::25) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|IA0PR10MB7303:EE_ X-MS-Office365-Filtering-Correlation-Id: 2157cff7-4992-46b5-ef5f-08dca69c0c5f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: lDk21RplKTegMuakdCWBO1Qp77+pvbtqFAHuS9cvxMGAAR/vCZfNOTF5J0EXKsoHmuBwnAwLtCVF+GtP2SSFUyMgUO9AmYauDqM8biC6SWGjdD7osQ5Xl74gweXuyWsVyxlm809rBgQiV6ibHSvjMcKoTt92XAxfoUzX9hTu190Y3TeNCpsB1jR0XwVIOn9Nm3H9nCBrj0hPXzmUW0EyIEzUMcV4waNxw87STUOtzvVlE0YORJNbY20K00o7hr2GkfMZH04RK59zbyZ7hztnfqw4OL1HUNatvmBYJ1FhNvkr7LY+P3hRtKa2X3dbvs7EYqo3NeZRrQ7LcyZfFeVW9Q2Cuky9xS0MEENfpVDFK40pfBwFsri0+2ArY+CmcFcQvCRJzHAIOnADRMoGlmQVR6Abc7ntWT4mcxcrd1hzPnTQi0iz1PV8RqgMSFpu5uj/xDLH/ailh9zKbVw66d3Bsg+8zw3wIy4McoE/IFk/kb8/DDc+SmXQfI9OgG3V92BoyI+wj/R/Xay5iQa21RL+jh6yjenuaogtDg2JzNUUWLBYT8UT0Si3kVXNdGwf/twmMFtsaKaS5wJ905rmMKfnmsPhICH2nyKKKLnj16FRZxH5l/CQfy4KMqiwY7LIww6vQ+B08W4DeGMwldnCFUWwxaXk7WVlmAUqcASwSzb/pH5eqcfrPKwDdLHPKpOBSvSi/Y8kpWZHvDALdOJGBO91f4eXMkOrc041YBtaZ3Nzyxp/+fRfPAIIoG6ViDHEIkKr59vAMUCpXOb4W7uZGF/8hYhadfNgKDqlqIq93YE1OeposzxFKaURdrpyAbKNJlyJ/NWotA0tqm1XyyMT1q6VI27LSo57TkMFOFsezm88wQ/l8znLBnWDmLevs2NKjwLD9nJagxWVxbGlfUo9ztJ/vOiVrhgZXI6Cg4o969v6iSpsKCbriNULNMKebBnn8GSxVc5pp3IdRjfBFtBFN2DTtbGfzWY6ZD930Pcw33GFCX3Tw+otbPGLiN7xKZNvLh0RZ8I9hkDOssMJJ5GtE83sRrYliwAJuuZplphziCT7zsQ7GiaFCk5Fpt6sjfN3FS9Y7P8GMcOXXlXXLzhocT/ASuhdROaEDZtFPGgKGpUTkuu3JVbivpnGj/t34g383dQ/t+u1ThyXdtvnK+IEfOGQCH69tMkGn68am2BEOoxdKNLhjJg4FMBq6ZZovC1FVxeeYJGe9qZm7CqcVOCfQM999sTJuEPA9fQ6QDK0CcUQ5phlmJI303scRpXAC29gPSqNcdhVi7hL76DPBW/I2p6/ueSexNTf35CwvOWqnmWgZWEmc8u4Pcr8jo5NYiBwZZ4I 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)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MMUq4drGwmhimGREw+XdeuY4AFW9SmR+oCHprkpseg7b6CxPqvHiyHbtW+zKdfSKnajiNj1fy+IhetrroAkVuqYwtmlsk9tDuTpEf5a93JPkD2K8pt8GabZFpEXE3ylH/hDJRRTgnpinGn4wuxiIfrqQOs4Y8AaqoS6ncHs7Uu8NHRT6dmaTAGMokgyMIwdP6tEdmo775dv4FpQKjIC9UryVM3OtBhoHjoIl9M5v4cauXN67vk7ZugGIPX3gQ3CFaeIXhIfsjSsk5yTgYGeGWVJC4Vsln61jvSjtR9O4OjZOjFD/rxEO170pWovFBNIv6tas+dV3vmgqJQ8t1vsWH3xR1dcOPHF00kOMgHXhMtLelxEWUsqejomGkq35sy5hP9otIRZLw2XOU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2LfINop2ilTXHds0s9lH5f4UT3anZRULnH624sGE5TaVNl3GyIpaojp26ATOZzEhiT331z1D/mgxlzDcol445D2HS73q9TtI94Ac/bxPX3pMXQ1b+x X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Att3OP5s2N1KQuRfvhW307vwR4lsOD1p8Fs0K2wYtpICeAbRyaXWVIIzUfz4SKq7Fd5DhY1kadF+vg8CkDCRoqHBFsOMfiXsjYzQpZp3sez2lVp4HWexo2Yy+9XU0TK+gNk3+QitcW6o6Th0AcfLq3A5B8xRurawASh6Rw/Q4MQYYwGzFTqZFu9pUxDGOHdy7OB92DAYcUtAU+ig2N5Se7d1yvWAkG0VThkiAp8lpEpB3Hf3ty3U001qUpaqVrmZeT1mgnZ5aaAnrVThyhBdo0zwgeDKLgAzGy7iIai0nW9AxKIh1QU/xpCDXEexWAg3XDOeIckVCpfG91x+hCrDpi7YwRMaLHUqozRQIYQIXu/iPGe97EI+o03cBZdNHFPA0HMt+D+3Y8+8YcxsBBvQsqCbUMnAfUQ1GsWvVS8amDRsMI8VM6ml34/fRg0nPtS+mqAsrhyME6/5DezEDeVL+FBtES3p1roPWC0mmW6Qjlb/X99Qa/wfWhQyn3YRgezBkfKQqBRwgfuKUrXgTzHTMCjT8iEW9fDQvcsZhJP6xgGRwltuZhr+9MLs+YfthuqHXozofWBkGiZ57ZI+5UANb8orcCnapHjSPxyR0yCyzb0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2157cff7-4992-46b5-ef5f-08dca69c0c5f X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2024 20:07:13.3669 (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: srvhUx9fwqR8VM89P849Fj7Rq1iqw1k4Hbc1W9y63Xgi7aVphlDL5mQQWZ1F3rBIrjFmsrVeVbRVMijUvxsnoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7303 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-17_15,2024-07-17_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 suspectscore=0 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407170152 X-Proofpoint-GUID: 2vMXHqMolQce-5w_9vzvLV8l3auM0RwB X-Proofpoint-ORIG-GUID: 2vMXHqMolQce-5w_9vzvLV8l3auM0RwB X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: F01D614003A X-Stat-Signature: 431c8a33no67xse1wayz6umcaztzdh3q X-HE-Tag: 1721246846-611669 X-HE-Meta: U2FsdGVkX19ZEpBOpDsAkwymAzj4DvLSX46eHyCzLcYWf8rJ3tnSsSCh22Juj7cKGfngSpZ/DStiwYvhc5xmELWpXxd7+7nNH/SmprRGF+VuYzEAR/oMxmRZKKKoRAEFevqcoLxY7Eqc0r2AqdqtIjLQ1KlVgaCiHLSQ/oxiGzO4hDFB4hQkWJBpBQniqwaNFE3fxXZgQM4YJNqTYJa7NMq022owI+bQ0iEbQbDQEDLEwLWBt+aNUIVZ7PpFR46/psGC8kspar3hcPPNt1D6C0KL6gBToYbcJnYHsv54SMsYH99w9wGSp0SHdoJDEutIKa9z8LkrY8Mk09gBIG4hAFvqxBbcgqk8CerbTZovvWt+3kfgDkx8rhra+EM4/DKSnPfCs2ixtFA26OzhYN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8rpcNpCyc30i4E16oj1xSvR0xLpj8IVPOf2Bsh4mNn+SZWePepd6HjNxfTRSE5Cq2Zu073L96OTqHpT4PwfceBoVv29soCb+PCBF 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: It is now possible to walk the vma tree using the rcu read locks and is beneficial to do so to reduce lock contention. Doing so while a MAP_FIXED mapping is executing means that a reader may see a gap in the vma tree that should never logically exist - and does not when using the mmap lock in read mode. The temporal gap exists because mmap_region() calls munmap() prior to installing the new mapping. This patch set stops rcu readers from seeing the temporal gap by splitting up the munmap() function into two parts. The first part prepares the vma tree for modifications by doing the necessary splits and tracks the vmas marked for removal in a side tree. The second part completes the munmapping of the vmas after the vma tree has been overwritten (either by a MAP_FIXED replacement vma or by a NULL in the munmap() case). Please note that rcu walkers will still be able to see a temporary state of split vmas that may be in the process of being removed, but the temporal gap will not be exposed. vma_start_write() are called on both parts of the split vma, so this state is detectable. RFC: https://lore.kernel.org/linux-mm/20240531163217.1584450-1-Liam.Howlett@oracle.com/ v1: https://lore.kernel.org/linux-mm/20240611180200.711239-1-Liam.Howlett@oracle.com/ v2: https://lore.kernel.org/all/20240625191145.3382793-1-Liam.Howlett@oracle.com/ v3: https://lore.kernel.org/linux-mm/20240704182718.2653918-1-Liam.Howlett@oracle.com/ v4: https://lore.kernel.org/linux-mm/20240710192250.4114783-1-Liam.Howlett@oracle.com/ Changes since v4: - rebase on akpm/mm-unstable - init_vma_munmap() has an else statement to set start/end to 0 and mm to NULL. - Don't drop unmap_arch() as powerpc needs it. Relocate it instead. - Call vma->vm_ops->close() before completing the removal of vmas, call vma->vm_ops->open() on abort. This fixes ltp hugemmap06 test. Liam R. Howlett (21): mm/mmap: Correctly position vma_iterator in __split_vma() mm/mmap: Introduce abort_munmap_vmas() mm/mmap: Introduce vmi_complete_munmap_vmas() mm/mmap: Extract the gathering of vmas from do_vmi_align_munmap() mm/mmap: Introduce vma_munmap_struct for use in munmap operations mm/mmap: Change munmap to use vma_munmap_struct() for accounting and surrounding vmas mm/mmap: Extract validate_mm() from vma_complete() mm/mmap: Inline munmap operation in mmap_region() mm/mmap: Expand mmap_region() munmap call mm/mmap: Support vma == NULL in init_vma_munmap() mm/mmap: Reposition vma iterator in mmap_region() mm/mmap: Track start and end of munmap in vma_munmap_struct mm/mmap: Clean up unmap_region() argument list mm/mmap: Avoid zeroing vma tree in mmap_region() mm/mmap: Use PHYS_PFN in mmap_region() mm/mmap: Use vms accounted pages in mmap_region() mm/mmap: Relocate arch_unmap() to vms_complete_munmap_vmas() mm/mmap: Move can_modify_mm() check down the stack ipc/shm, mm: Drop do_vma_munmap() mm/mmap: Move may_expand_vm() check in mmap_region() mm/mmap: Drop incorrect comment from vms_gather_munmap_vmas() include/linux/mm.h | 6 +- ipc/shm.c | 8 +- mm/internal.h | 26 ++ mm/mmap.c | 580 ++++++++++++++++++++++++++------------------- 4 files changed, 375 insertions(+), 245 deletions(-)