From patchwork Mon Jan 27 15:50:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13951574 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 BC0AFC02188 for ; Mon, 27 Jan 2025 15:51:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 464E528016D; Mon, 27 Jan 2025 10:51:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3EFB6280165; Mon, 27 Jan 2025 10:51:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F23028016D; Mon, 27 Jan 2025 10:51:13 -0500 (EST) 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 EAFCC280165 for ; Mon, 27 Jan 2025 10:51:12 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8A08645ED3 for ; Mon, 27 Jan 2025 15:51:12 +0000 (UTC) X-FDA: 83053670784.28.1C79103 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf13.hostedemail.com (Postfix) with ESMTP id 42C962000C for ; Mon, 27 Jan 2025 15:51:08 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=GYuKPQsn; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=MvdJ8K+e; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf13.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.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=1737993069; a=rsa-sha256; cv=pass; b=e3nB+l/pMJfTUVbaIuaI6S9az5wTSZOYq4gFQ1y70S9Yn7x06eeaWSEtRYhFpnm3/MU/tU o4SX479LotDB7wZHYNjvKBNMRyM71g0yDBzJbL4H8GzecNajn8EGyjXOMaDTaY+BTRQNXy Se8UacCfW9TlStyb6cQJWzh7DyR6jAY= ARC-Authentication-Results: i=2; imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=GYuKPQsn; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=MvdJ8K+e; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf13.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.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=1737993069; 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=/VvC9n0IZRJ0jJSpoWkiyS/174pwxw9wCsUtgnzGgUE=; b=R8Uc/zHo+A7Ca3dfNT3GFcRI7f0lQeijFg3/u4RRdiDAl+NlwGRDMCrUHJEMr9FEEcL5Uf oo+FHea6dNc5y9i7ngtoh4MCAT3EhM3CC1c5WNs5Lnkvzb+UaCyzJzD7DFs5COsDWPW8g8 zFNqLwOOjcJrlN3aE9YFQA18KSRXhns= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50RFVtUK028529; Mon, 27 Jan 2025 15:51:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=corp-2023-11-20; bh=/VvC9n0IZRJ0jJSp oWkiyS/174pwxw9wCsUtgnzGgUE=; b=GYuKPQsnDcYKU/9ZjhubTFqa6Yg95gHJ e0KV6VsEkp2wUX0yiMuF6X2wkKc/LIYTE7nHZ06xn2QaXbm0Tp3sxreNnyP0R7zi QxMkRwytqEyuG1viwsZfzh0Lv0Fdps78mt7Gd6Jkvkjl5ALYbOSMhd5ALLxMEK7k 25NTQjVo5VaqXmxpo6iQSfyyzMaZ14P/jk0loi6LBWMer4Hygg+7gzE8vJJNqIbY 2A4qoVnZLTz2vmvOstQzTJXj7/IggyEqbCtQb+Y/uVe8jlTStoUmWFScTZ8sqGZ4 HxfJPH+uLsQVVarR4DZer5oqle/ChL8W94YY//3KxmAteffGe6517A== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 44ecv581jx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Jan 2025 15:51:06 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 50RFSOpC005390; Mon, 27 Jan 2025 15:51:06 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 44cpd75syr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Jan 2025 15:51:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=moZNI/uGsnWUwdHeWpl08PmYNd4Frtr/5HisDO0eTTPqDzFYdGJFn0IJqBZwkVBAbHId8j+cawWYBzurJ5VD8H6Hl1t7jcaOZnQXTPNOd6+7RmKGAc6XUzdxzTkveKUCNiLs+Be9fA0wm2BnpTUfyToZkXKzwCoAzoyIQi9qLfixVoyjsgNHWWDBJcY1gsuM5eZgLa/RI2imgN0YByltGrYArFyTIbv0LWLhpSii9pUxawywgnw3wZYLiLZNcUSOfZCVxeb0DjoG7ULgr72oNmLPAdjaRyEUJF0fOv+Bdl9lQBY8+m4z4hFp/lCK/7m3ByBmRl0p/UXaUbUajknUDw== 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=/VvC9n0IZRJ0jJSpoWkiyS/174pwxw9wCsUtgnzGgUE=; b=e2T4jBsQa77R9rHQrBvxm+clCTYgBDJZFHKojOl+5D1hzjHPWKLddQ/wooGqaPGISsnedp5zaJKuHLOn9YWlkj1Ank2ZfFkr3J5Fy+xQx7IIDufqJo0FIOP/hoxfQTO1lTcZo2gfGz0RRCsKda+QHgGNDxDyRQo5Zf+rjvIiPlGbIg5azFraNbzdCHjYp9JxUicVDyr4cbXsMssoZSdWi/bmC6yQomjbjCuPrfxl+rMRnD4h+pwOWP7eYOUHiH3b7UIziyWkMrM6e96KrYpW4uX0zYRrXrgjqnydB5WAZTL7iSQhqm8D2u8Pq5D2BCyqacLN58WPXLO+BDRyeZ5WqQ== 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=/VvC9n0IZRJ0jJSpoWkiyS/174pwxw9wCsUtgnzGgUE=; b=MvdJ8K+ecMZrovayVaDssg2ykXHU9q7pZ3C3B6w4qmGklLYgHFJBnI5gkT3yg48ww0Waht+8/NIedGFvlkbIlFy72nsuekxiQVfa3WEXFP3g4d13OTceTJs8yc3/oUNdEU2V395qBmPD8yT2BWs6PfxOWKWI0g1Xn89QoCf0ROI= Received: from MN2PR10MB3374.namprd10.prod.outlook.com (2603:10b6:208:12b::29) by SA3PR10MB6949.namprd10.prod.outlook.com (2603:10b6:806:319::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.18; Mon, 27 Jan 2025 15:50:59 +0000 Received: from MN2PR10MB3374.namprd10.prod.outlook.com ([fe80::eab5:3c8c:1b35:4348]) by MN2PR10MB3374.namprd10.prod.outlook.com ([fe80::eab5:3c8c:1b35:4348%3]) with mapi id 15.20.8377.021; Mon, 27 Jan 2025 15:50:58 +0000 From: Lorenzo Stoakes To: Andrew Morton Cc: "Liam R . Howlett" , Vlastimil Babka , Jann Horn , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/5] mm: further simplify VMA merge operation Date: Mon, 27 Jan 2025 15:50:39 +0000 Message-ID: X-Mailer: git-send-email 2.48.0 X-ClientProxiedBy: LO3P123CA0016.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:ba::21) To MN2PR10MB3374.namprd10.prod.outlook.com (2603:10b6:208:12b::29) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR10MB3374:EE_|SA3PR10MB6949:EE_ X-MS-Office365-Filtering-Correlation-Id: 73aa03e4-ba0e-4439-30dc-08dd3eea649b X-MS-Exchange-SenderADC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5nBgdq4GeFgoKb5Icue8iUsgN+2zZyD3zAdXRJyXUD48qI2G2yS/BoiCmi2MNLCsTBw8qWeZmZZNQjaSu/kuHGJA/zcw6muTO2EQKpgwLaQI+lSwOtvVEWljRUTYMgjQ3moqY4/hSuSiozelSGhHhdxH8qqYVbwq49D0CWm+Ow1vz13vDxjIRrH2kz/ls8nt7gb4UxtMwUkln8Lu7n2yC5W0+pCaf8eawYDeiHOravISDCIOcelZlQcvpsCZHx+RhgrLExdRe9NzCFUU9pG7ixMDnLNVcLbqT0723dO+u3+XnNQB9lpFauLBD1cfFGiQ1SjNgKvmAUHNBZfZysB86Jgr+1l4zlc1R/vuELbjpvsTlpJw+Ur5r3nPkGEFUKfSN0h3gL+TLNtjJwZZA1/cCsXbGvRlVch8VlNgpLG4RAz X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR10MB3374.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: 4DZHIzSQOspOOcLs7jZYRh37Qpj62qzlAR7LFSpEDvwQUccRCqyzocM8NultIt+zXYR07P1U97cSh1pSsPR+Qi+X+3gJ9s1SpwpvsXo4X/397J4rY7cXyPaRusjTm+6S9QQPyM3SHjmLGLIIiRzm/eEif+8zLRy6RWki0h+u/ieHBGG0KxAx2wHWv0G9tv8NL+A3Fw3x/DiBSQ/KoLM4MBLVkpUE0ODGk8GPixi5Buwk80fuKnqRGwdykxW8BFTBI8AuKmIjzqzCVInkLPr7+rNyVxKsZB0NS3uukYq+ejLdy1h2xSzyR+ZBImL7W3kMgnzoFZVhBI8AXZ/w4x5n42mBrGcnVSGT5k1w0duxpWF7I2bfwCV3zRUv2QY+2EFchEDhgcTcyCrjakkhart1KjCZ0bMkeeMlnGGZa6+5BojgvIk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jiiTD0AaQSPJjgf4KLYJfR7frx2RQ7eBi8939nWywwxT4CY3eOZc3MC2eSa3twoL4+jbpHsWFV/48tEYgFltTxmFG8tmliRdVGRZaFpvwcDA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: adIOUy1SedORxzfSshTJgq5zGzdxmnTQAbxBmHyPgz1+hgdFR3xdXIsJh2xYaqTge/IAFwQur0cyo1jqC7KfK1L1wuJnlPso3fNthNnCuZJT4SNmX6WC7jxa96hp3Gvt/m5hYhkhSBvFQhMTiDwLSP5ufklFva/ignJI4tDY0hd8FgTHVkAJWTXxPCVDgoniSDVh8LR9FhBhU+XbEer1dIhe4xsoslQnPBPiaqWZJrU0brOuPNdQ+7CV7EpaAm59C2yyEMtI895qWc2G/c8vtMWsiciioZgjcj4vr71UuSfiEcc4xE5NoINgdK4+YHqYQXzDd50HbLO72G+ErKdMXJSC8CUVO5BvxcDJzxqCGez//lmxsg5z5Gb7tLgrZj4mqC7dvmf48WZ1RuwY7to3araJPQctJlsfXg8QhVQ/hQH5T1Ag7TDFuOSfKc7NMq0PwyKzUDUhS1+TWfvBCXsmA0ADXhl03fPAULVWTQNDRKxds7s0ym6M6WL5/1i2HOhiix+i1zjAvNO/yZ2CM6r0XLJRHKzp345HU9BsYbaJsyXDsLXViLrS8LLAGo6e2sIMWMsCMReIV44Jl+WvxDR/TdysYmeOWDvqmkoFnfI5PWc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73aa03e4-ba0e-4439-30dc-08dd3eea649b X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB3374.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2025 15:50:58.9353 (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: x026P5if+WgveBWHAj+X5wpYo21ggyuLFLJ/fjVRZ6vipybrdwhCLpDe/jB0/oeMfb1V6sOx1zKmyrdlJidQlYVAPvCQpupSNru0i/GGUpE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR10MB6949 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-27_07,2025-01-27_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 adultscore=0 malwarescore=0 spamscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2501270126 X-Proofpoint-ORIG-GUID: -ESX1RoN5hcraLP6GUF3iPw0qqKkvpSd X-Proofpoint-GUID: -ESX1RoN5hcraLP6GUF3iPw0qqKkvpSd X-Rspam-User: X-Rspamd-Queue-Id: 42C962000C X-Rspamd-Server: rspam10 X-Stat-Signature: jxudde1kotami65t6zpqez43joyu4eyb X-HE-Tag: 1737993068-794301 X-HE-Meta: U2FsdGVkX18YtSbWw9uM/5z40LrwRFBY0eGeEyW1MBTX+7tuFXX5XkTyUYUCs0DnRWevJ+yvh3WMWpXmou2UkHOh1cB1K9QGLZHZIKn2IznZ5vDQVCAUvEB6xK6p/TIlMvW6M8DpjvsQ2NoUtu3CfkmYzXAAkgeiZLnSfJbyOUwVYhGhg2BQtUX1jXqeaNghnBJzd4GVmhOtMw0KKciIO/Hl8ju+NynWUECNjKzBOpwhIOdD0VEBdIB0TwZpvqIl9s1bAYjwmwxG9IjNW+I754YwEsoTi9fv7hhHPSJMqbMT6qusbuRMt/y0FRX7ewv/9gMF48gZJsJreynLge1c1vOCF+jzFSi79Vhuf2VG8MPjNZrISwPBFvKFCKuAVT3nGCjMF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tqvDA4VlVLclrdBAMy9a9WcIZKzu1vkJ6VZUIzzrx8t1YYOE4znqwHJyPrkveqSLa X-Bogosity: Ham, tests=bogofilter, spamicity=0.001516, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: While significant efforts have been made to improve the VMA merge operation, there remains remnants of the bad (or rather confusing) old days, which make the code difficult to understand, more bug prone and thus harder to modify. This series attempts to significantly improve matters in a number of respects - with a focus on simplifying the commit_merge() function which actually actions the merge operation - and importantly, adjusting the two most confusing merge cases - those in which we 'adjust' the VMA immediately adjacent to the one being merged. One source of confusion are the VMAs being threaded through the operation themselves - vmg->prev, vmg->vma and vmg->next. At the start of the operation, vmg->vma is either NULL if a new VMA is propose to be added, or if not then a pointer to an existing VMA being modified, and prev/next are (perhaps not present) VMAs sat immediately before and after the range specified in vmg->start, end, respectively. However, during the VMA merge operation, we change vmg->start, end and pgoff to span the newly merged range and vmg->vma to either be: a. The ultimately returned VMA (in most cases) or b. A VMA which we will manipulate, but ultimately instead return vmg->next. Case b. especially here is confusing for somebody reading this code, but the fact we update this state, along with vmg->start, end, pgoff only makes matters worse. We simplify things by replacing vmg->vma with vmg->middle and never changing it - this is always either NULL (for a new VMA) or the VMA being modified between vmg->prev and vmg->next. We further simplify by placing the merged VMA in a new vmg->target field - whether case b. above is the case or not. The reader of the code can now simply rely on vmg->middle being the middle VMA and vmg->target being the ultimately merged VMA. We additionally tackle the confusing cases where we 'adjust' VMAs other than the one we ultimately return as the merged VMA (this includes case b. above). These are: (1) merge <-----------> |------||--------| |------------|---| | prev || middle | -> | target | m | |------||--------| |------------|---| In which case middle must be adjusted so middle->vm_start is increased as well as performing the merge. (2) (equivalent to case b. above) <-------------> |---------||------| |---|-------------| | middle || next | -> | m | target | |---------||------| |---|-------------| In which case next must be adjusted so next->vm_start is decreased as well as performing the merge. This cases have previously been performed by calculating and passing around a dubious and confusing 'adj_start' parameter along side a pointer to an 'adjust' VMA indicating which VMA requires additional adjustment (middle in case 1 and next in case 2). With the VMG structure in place we are able to avoid this by simply setting a merge flag to describe each case: (1) Sets the __VMG_FLAG_ADJUST_MIDDLE_START flag (2) Sets the __VMG_FLAG_ADJUST_NEXT_START flag By doing so it turns out we can vastly simplify the logic and calculate what is required to perform the operation. Taken together the refactorings make it far easier to understand what is being done even in these more confusing cases, make the code far more maintainable, debuggable, and testable, providing more internal state indicating what is happening in the merge operation. The changes have no functional net impact on the merge operation and everything should still behave as it did before. Lorenzo Stoakes (5): mm: simplify vma merge structure and expand comments mm: further refactor commit_merge() mm: eliminate adj_start parameter from commit_merge() mm: make vmg->target consistent and further simplify commit_merge() mm: completely abstract unnecessary adj_start calculation include/linux/huge_mm.h | 2 +- mm/debug.c | 18 +- mm/huge_memory.c | 19 +- mm/mmap.c | 2 +- mm/vma.c | 322 +++++++++++++++++-------------- mm/vma.h | 58 +++++- tools/testing/vma/vma.c | 55 +++--- tools/testing/vma/vma_internal.h | 4 +- 8 files changed, 276 insertions(+), 204 deletions(-) --- 2.48.0