From patchwork Mon Aug 5 12:13:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13753563 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 97B24C3DA7F for ; Mon, 5 Aug 2024 12:14:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2F7006B008C; Mon, 5 Aug 2024 08:14:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2A69D6B0092; Mon, 5 Aug 2024 08:14:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F9036B0093; Mon, 5 Aug 2024 08:14:25 -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 E061C6B008C for ; Mon, 5 Aug 2024 08:14:24 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 6DEB7161C03 for ; Mon, 5 Aug 2024 12:14:24 +0000 (UTC) X-FDA: 82418084448.03.BE3CA0A Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf21.hostedemail.com (Postfix) with ESMTP id 1FCE71C0013 for ; Mon, 5 Aug 2024 12:14:20 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=EldSn5YW; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Ha6ks3Jq; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf21.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1722860054; a=rsa-sha256; cv=pass; b=gZt921AJSMSFYxprS/oSrECWreOaiBwBe5xXLi9u4EKwv/c1DjgxdrMp0FUreMazQlr25e 8qfkFopcV+B65IiWndtWjDbi8JAFVH56TbURE7XTpFSDPfhQ87JdCJmTlrwXK3hg5m7l8d Sh2f1UxbBVK6nJyibhyzFwWRn0sPerQ= ARC-Authentication-Results: i=2; imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=EldSn5YW; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Ha6ks3Jq; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf21.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@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=1722860054; 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=cmA0sSzWLBBHHPYNAAlVaWgReAkK72HcEFMcZn7yt7I=; b=egHsAeBzEpeWCPs2pWfAIYQih12RHYzalfECQhQI0pTE1mUCRwQyZIVI7XBwDTgXXf0Zfv 0WqoEbiqdllCYUyVhPrN3/BiAhsbHygdYvojz5aJK98pSX1GS7/A5y0vXJBOTUKPJXvokV olhV3N0vaDLVlD3L6tVNIhjlioqo7QQ= Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4758fb3j027500; Mon, 5 Aug 2024 12:14:19 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=cmA0sSzWLBBHHP YNAAlVaWgReAkK72HcEFMcZn7yt7I=; b=EldSn5YW2qryNcHfiQHRt1qmQafawJ rn7bdY+Li4KtUmup8nLgzQ9e37k5MB6yOrTQT3eakGy4ehVbz2ht+BRP3pcSfOD4 bWH9t/f0SaVSvyx29Ydf0j0t0P8uq5wcv7wi8zUB/Oh5r3HYtc41Eny75mhkM6pL JY9E0DZyER7FcvD+SNmhKGfqclT8tqSpyPMM2ZSIviQ2K+6tLHukLHaoEvYXFB/o u76k1U0J0tWdP71Z7hTk/Ia1IimW+oFZiw1sVZn9e7OLJRzb03sES8oSTKoMyQt3 0V5U5gwa8w4gphZIedLQqbi90TOuyrMIxY+o+M3Lb2axOfmChcttR4iQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40sbfajgjs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Aug 2024 12:14:19 +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 475C9Gb7018638; Mon, 5 Aug 2024 12:14:18 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 40sb076nvu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Aug 2024 12:14:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CkVsNw+reN5ZXNyY5L5yqSLpXbhlOLxmrSgRS0qfI9Xw7CpEv0Axcaw4FktmJpQ0XYRSWSD6n92O+odbybfOTS8uipAFxVtscI1RPFy5U8RASkgHJ0A0i2rlihd2JFkLErrBArS2g3R3VRMjFBA4/t97I323Roj+8IQ/g0l0yw4KDrd/OeB9Mw2DkUp2zxGVs+6vz1wtj+AGTWp3FdNKpRUnA76KDIDJ/odtSeOKfUpr3rl0PbK79YwxNF2uT7cLpJ+GQyRRYNh0v9UvOvXCMbwfpGAsZFyPWY9A/RWH+btJ9QpAqw9KQ2hsZ0Ou1j6DG5TcsPMuoWeITJHeXQhR9w== 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=cmA0sSzWLBBHHPYNAAlVaWgReAkK72HcEFMcZn7yt7I=; b=UbM1vISn6sB4GOV5kknVgXyc4lDfuhVY6wuvLABRILjr7/rJlTdblxkBJ9nau5C7KSuQ3YkQ74Q9PhFNCCX3Vz7ynvTNWzyfaHf0NazEVyZzMtqZ0oHMACXNjOWLnWPtpPtr/njgFXSVXt32s+GWt1b+MIcPnNyT+r5RydaTkG1RkkwpqqPIpaegbtg3mtY7uyC0eMVcIfLSGU6IGzcWEcLjA8c9/H3MaZ6YfVe/GABD4Di3inncTjY61Purg/M5jr/VRVZrVYQVBxkLUPLDLWkfNLjRtA8cDytZMkcJetBtVAwnWdGZq29qu3pd7rPNB4G4RxwaDzYbq6djFE6BwA== 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=cmA0sSzWLBBHHPYNAAlVaWgReAkK72HcEFMcZn7yt7I=; b=Ha6ks3Jq7cUUBqCc7U3ZaEQFtjDSjW/ho15XYCi9vMRwQjvrDqSrkvOrz3luHv5RKkbvsoa67mK8ENx93R6j8NIZZSyCPB2dJaQ5Pmio9+GX+nBarWt/2jCXeIh/0BDdZzMlPuSWVf2kXSL4IGcrKTYpGVpe6DJtixw9CDMKtGI= Received: from SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) by SJ2PR10MB7760.namprd10.prod.outlook.com (2603:10b6:a03:574::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug 2024 12:14:12 +0000 Received: from SJ0PR10MB5613.namprd10.prod.outlook.com ([fe80::4239:cf6f:9caa:940e]) by SJ0PR10MB5613.namprd10.prod.outlook.com ([fe80::4239:cf6f:9caa:940e%6]) with mapi id 15.20.7828.023; Mon, 5 Aug 2024 12:14:12 +0000 From: Lorenzo Stoakes To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton Cc: "Liam R . Howlett" , Vlastimil Babka Subject: [PATCH 00/10] mm: remove vma_merge() Date: Mon, 5 Aug 2024 13:13:47 +0100 Message-ID: X-Mailer: git-send-email 2.45.2 X-ClientProxiedBy: LO4P265CA0071.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2af::13) To SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5613:EE_|SJ2PR10MB7760:EE_ X-MS-Office365-Filtering-Correlation-Id: 1bac94d2-f467-466c-9b64-08dcb5481e09 X-MS-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ToLeH8vn01sFdLjPhaSz0dX+UXvk+vk6uxCKHYEpThN+D1Hwmj962HAib1Gxmcn2dnKbgTDWdzkKeUCsvauOsjK7AojipxwJdmgc0NYSZdle7BPgO9Ae8Ss7CZpHHDzahvPH0dF/kMXQnnh+HtPN1CqP5Nl5BxJkpuvL6t6KeIqy54VcKtsndn+uzXTZK765HqViFzvTzs/glPXW26oKbjr4UPhGH+61hbbFVA/gA1EWS4CZlGESqJWvnbXUz7QSZa2AyeZQr6t0npDB/VIi+Dmiqxvfks/enIeJHwbNYaKiQTj4QJ8ZAkwOMwKuMX/m583JP8DxsDLJzB2Psdl3y25T3how8TdLhAt9u4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5613.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ES68WdKMcxFkd0FPwiIIaPKBcSoLpwaYExHru5PFY9aE4h5w3OmjxPswXkeWOLaOKqifEon3MOAbygXn6cTCU+9l3zVFa4tEG2lAaWxyKkkSZ7gOTvp54AvHf3m8zD5wLe62/ZATcHVqdlRXEgutN5iS+s/k9rUlytr8AvCTx6dHCCHgBCGHB7yvYEWy8Xx+DRFErffQM8mYj4DB38OrFqGxuTlwxhjy89EBnoYzMNlGlJU3TYSMqGnY0GI+XBW9jGSKLIi1XU4ajFwNQNX0wnEeQu+rYTsiMWPsYV59+7UumIGTS5vQLspbfICXwkUMtLujpf/2gj7KtsflQJyRiwnmlkiuwUs6dGQXmAmADyZ6gcGVl/Vesi5HX/UYoTpKfCy81j5KINIG7+GQ+5944NflD0FN9HMh9Yb/xT6fvAaUBgiC7srMm/2d4s+S18xDpqHqZrKEZSdtUPAj6YTK0B1kXwgpVyTA+KLvmwVGRhqXDRd3xwIbL2YfEC5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NaW3bqXDbLXrneBKUviDQtpYDPh39obMD1brm858bmeMnBnd7U4TS6MOEbAmTu7gVVw2HvbJnhMkLxxcXQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: g/KUrTL10kc+ujawXv8dzC1f9nPUahps9fCVGc2AkJj/Raeu4GsJE6+0nmvwN12OWt1npPkU4lvrd/uUpswhDgizZHL+sK76KiMORPthII1q2G9i3axoOf8jJkK248DR+j2pd7QUo60O9i8tydNKtirBDU4p0rj5vGUKOHqXekkBMwP7f+LxkdmQaFqrbL2lAtylthS6y6ljxuFp4deINWI61RuPgsoMrRED6pZaLtsMP6ZnXz07yEfVRaptSoLiMTduCu2gu/NNfu/kb71LDmYOx0QpF9eVj5HgyIu5RvhtVpohTux3SYakzYG19u2bx9n7ZUK5++lnXPdGQ9LJ652iHHlATEPiiPC0Pd/TyeXgd8DkCd6YFDvfVMEdBrbeR6qU6XCG1HD0Aqpnsk8gWJAXaRC3/HF9tKvIN28sYd+Q7aM25lXH9lVMMjqpf9yH2bKFHep5IWfupZ459D2aRJ8zleGygJhTwH0sGmLPS+fwumJ4cepI1WNc2KpB4mxceBhX4higAZB4GcMY26Y499XZfEyjebS7BxXGPgEdKF4tXRnh8cmeDa77jecXw+xhnxmArUWGIBCRfMKxJQ2lLnRuVCxOeuQ9wIJP6q3MDTM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1bac94d2-f467-466c-9b64-08dcb5481e09 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5613.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 12:14:12.7416 (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: yLHSNHF9Fqb+INKZrjWBg31rsf6E4IsWLXGg8bD2Eoxp7EHyusY6cdWqvO8cdLAIYntjuIxKj4YhVF5EHvLNzeIrf/3xbNjBZi7T/wUF4uc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR10MB7760 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-05_01,2024-08-02_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 adultscore=0 mlxscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408050088 X-Proofpoint-GUID: iEdfQxuRDS6F_9_EC3g5f1ssehUAJHJ1 X-Proofpoint-ORIG-GUID: iEdfQxuRDS6F_9_EC3g5f1ssehUAJHJ1 X-Rspam-User: X-Rspamd-Queue-Id: 1FCE71C0013 X-Rspamd-Server: rspam01 X-Stat-Signature: eets9kurp4nihwm19rmd6qyj9se43wgp X-HE-Tag: 1722860060-531096 X-HE-Meta: U2FsdGVkX1/eSI8UupGYj7kLm1oQGaxE+Uue5p2GIR1CJfM83+WDy+Q09WjaNBFHoIpKw+DMJ8v/N1PyNlYnpxWOB/RShQoomBkRijwXQrHd8IPxhC5DTTnF1Wr8dAxQrlDAPlZKxmaJ7zzeWaLi/MQ0pFD+iUFvsni5Vrg2vD8kdijKQukywmocaL6yx6Q5iZrbvM0cXVCWNa7lj2Uvz3gvfJQ6ugt1UPQdEVp98JN1+mCaA2exzdljMJ5ZYasA1lMqgiLnwSDoP8dkZrh4LtzLM44OgyGhDjYH0DBKhYn17Aq7+oYbnxSMn3Ex/F96R9JpsiqS4DtVd9rNB7lla4/yQuGuifESEN0VBrBgH7EVC4rbX9qXdbBi8bpPbb0KoVTzCJf5/DV9/Tpo54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PYcITi6L8iNkSTxU2RZ94kgrBpxMQAkX71TT/QY49+20tK6918+BXQzSOxQnqE3El8DX3zo0MTD7C0IdCpfk= 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: The infamous vma_merge() function has been the cause of a great deal of pain, bugs and confusion for a very long time. It is subtle, contains many corner cases, tries to do far too much and is as a result very fragile. The fact that the function requires there to be a numbering system to cover each possible eventuality with references to each in the many branches of its implementation as to which case you are looking at speaks to all this. Some of this complexity is inherent - unfortunately there is no getting away from the need to figure out precisely how to execute the merge, whether we need to remove VMAs, whether it is safe to do so, what constitutes a mergeable VMA and so on. However, a lot of the complexity is not inherent but instead a product of the function's 'organic' development. Liam has gone to great lengths to improve the situation as a part of his maple tree implementation, greatly improving the readability of the code, and Vlastimil and myself have additionally gone to lengths to try to improve things further. However, with the availability of userland VMA testing, it now becomes possible to perform a rather more significant refactoring while maintaining confidence in its correct operation. An attempt was previously made by Vlastimil [0] to eliminate vma_merge(), however it was rather - brutal - and an astute reader might refer to the date of that patch for insight as to its intent. This series instead divides merge operations into two natural kinds - merges which occur when a NEW vma is being added to the address space, and merges which occur when a vma is being MODIFIED. Happily, the vma_expand() function introduced by Liam, which has the capacity for also deleting a subsequent VMA, covers each of the NEW vma cases. By abstracting the actual final commit of changes to a VMA to its own function, commit_merge() and writing a wrapper around vma_expand() for new VMA cases vma_merge_new_vma(), we can avoid having to use vma_merge() for these instances altogether. By doing so we are also able to then de-duplicate all existing merge logic in mmap_region() and do_brk_flags() and have everything invoke this new function, so we universally take the same approach to merging new VMAs. Having done so, we can then completely rework vma_merge() into vma_merge_modified() and use this for the instances where a merge is proposed for a region of an existing VMA. This function completely reworks vma_merge(), eliminates the numbered cases and instead divides things into logical cases - merge both, merge left, merge right (the latter 2 being either partial or full merges). The code is heavily annotated with ASCII diagrams and greatly simplified in comparison to the existing vma_merge() function. Having made this change, we take the opportunity to address an issue with merging VMAs possessing a vm_ops->close() hook - commit 714965ca8252 ("mm/mmap: start distinguishing if vma can be removed in mergeability test") and commit fc0c8f9089c2 ("mm, mmap: fix vma_merge() case 7 with vma_ops->close") make efforts to relax how we handle these, making assumptions about which VMAs might end up deleted (and thus, if possessing a vm_ops->close() hook, cannot be). This refactor means we do not need to guess, so instead explicitly only disallow merge in instances where a VMA with a vm_ops->close() hook would be deleted (and try a smaller merge in cases where this is possible). In addition to these changes, we introduce a new vma_merge_struct abstraction to allow VMA merge state to be threaded through the operation neatly. There is heavy unit testing provided for all merge functionality, added prior to the refactoring, allowing for before/after testing. The vm_ops->close() change also introduces exhaustive testing to demonstrate that this functions as expected, and in addition to this the reproduction code from commit fc0c8f9089c2 ("mm, mmap: fix vma_merge() case 7 with vma_ops->close") was tested and confirmed passing. [0]: https://lore.kernel.org/linux-mm/20240401192623.18575-2-vbabka@suse.cz/ Lorenzo Stoakes (10): tools: improve vma test Makefile mm: introduce vma_merge_struct and abstract merge parameters mm: abstract duplicated policy comparison mm: abstract parameters for vma_expand/shrink() mm: abstract vma_merge_new_vma() to use vma_merge_struct tools: add VMA merge tests mm: avoid using vma_merge() for new VMAs mm: introduce commit_merge(), abstracting merge operation mm: refactor vma_merge() into modify-only vma_merge_modified() mm: rework vm_ops->close() handling on VMA merge mm/mmap.c | 115 +-- mm/vma.c | 1399 ++++++++++++++++++------------ mm/vma.h | 104 +-- tools/testing/vma/Makefile | 6 +- tools/testing/vma/vma.c | 885 ++++++++++++++++++- tools/testing/vma/vma_internal.h | 10 +- 6 files changed, 1799 insertions(+), 720 deletions(-) --- 2.45.2