From nobody Tue Feb 10 04:12:50 2026 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F7BD3587D3 for ; Wed, 21 Jan 2026 16:57:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769014640; cv=fail; b=X92Z8zHFO9NENXQLUQPRJOPz3vXFNhsFQjGaiuz1VLAJStWyY8Wh8xxDtEomK27D4YGeC5T3XaF55gNSLzk8fYtyBb4kyRLIzTrkKgFwM5RMIBWKPwyky+dR7kLFzjdOq7pZsU6xizZw+17yddvcDWp/rf61O27dIIggxEaORfk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769014640; c=relaxed/simple; bh=BDrFDkBat8MATdocoahHvYfm72NFuwQ50spoKWVsobo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Mz3wasbVKD1sCLRYbabgO8K6uslJLgCS8H4v9B9+em2SnlWOMJmxC2DwcjSeGO60rEyh5DwlL7LZGjVHTtqHJvP/l/YjW4IzOotB5eDgZcDHLjWp4xEQnp232/KdqSb12EG8lnBmZmNY9lF67/UaIg3YIX+UrpITNx2f38yElDk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=f/GYMYaG; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=hQRoUMzp; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="f/GYMYaG"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="hQRoUMzp" Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60LCiLQs3523936; Wed, 21 Jan 2026 16:56:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2025-04-25; bh=MR7uPXwZ2+qW4GqAtFuWdYc76VZrpAB9Uw8TQSQ+BO8=; b= f/GYMYaGiho/iDqBong25LEZ8oP7WNoWX405tUwbofHxzgRHmRJ/mHXTHACPhYyW 8A+kQFChVcsvEOV0ETJ95rpmjCPx9M+66DDZ7hRqDQY0VYK5E7A/Rwtpmxn5AzZv kFA0FO7zj1UXfCQ9Grzy9V1892robdjvYIRuHTfTs1FlNf3Zw7G9ycMZlYk6ZUZj j1i0knqUYHHDSzQWAorjg4KklLd2wcTrMOPe0kM3E1PD4yPBBlWjXfVgRXgWGzrk bR4iOoIe7wtxZ4H/VvOQeezZE8yA9TOLaKxWXT1SMmyDwB/wvsSzMplRLPvvqFJP /tIIU6whR50CYnp857d4Vw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4br21qee63-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 21 Jan 2026 16:56:54 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 60LGKKs9008437; Wed, 21 Jan 2026 16:56:53 GMT Received: from bn1pr04cu002.outbound.protection.outlook.com (mail-eastus2azon11010004.outbound.protection.outlook.com [52.101.56.4]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 4br0vbhsfr-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 21 Jan 2026 16:56:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qMVuL/JUImnxKBmNEzrxaIngopcXnDXdKyWybbED/ck3nJJnzKl86t/2XclmeqJDFUryQfGsqBVks5otY66N0fVL+ChzQiwhkAJx/bNe4cHVVkCeFQ2/XVfVKwBkKzuqy02Hw37jJ2XBIQA2+bDNtwjAsRT2u8rCy/tqkOHbFIQ0rAJ69oa5DAp8JshHWP+uesJMrHoJ5vYqe/50pAWUzm7td1bnEvzHK7Zw1XW1eystVS8DVSWog/S/5CF3Ss8q40gRaJ0EGXQKjCnWI7a111rXXVUU2L4Gh5ZojtEYd0msnpJU3keyo7AG909rNEdPTFIcjHpSHVxcwQd81sIR+Q== 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=MR7uPXwZ2+qW4GqAtFuWdYc76VZrpAB9Uw8TQSQ+BO8=; b=MPcDvXQFz4frFm2L006U92KWKPJYysdfwVBUz3v2DIVlhXQKjH/25DCgtj+mjk5E/7GY8EhjiSBxmcxUWvuC1FAuGkSDRegAYiC6RnBfsSNW/ZAZhm9Dgd45fmoqW6TMkwOgImZ8xeyzH/9d1biEUg2N7uJ/j3ENcReDyA26Z3rLD7Q1+J9SlbFRvIY8dQsv278XIrFr9nzRtQQt6dmRDsMGTtOP4EbxMQ8tiw3aZkZd+ni8NEcotGhO24pJRTwA8WXmBb5xpWr2LZxxmOTmr+A0benbvXO3T6Gflk+i68gLEAsCjAHBiHKDPd14kKCH2m70vz3Pljpe4NuCH8pyqw== 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=MR7uPXwZ2+qW4GqAtFuWdYc76VZrpAB9Uw8TQSQ+BO8=; b=hQRoUMzpP9aEMws8ml3F0M/cbymoijJZRnvBem+RdCmv/QI1L5BuoBsUr69YCfV9wSlDw02KUozQyF+Rw5kUpHGdVFwBbfCwh1isyoiT0rSC9iqu/HTbySucFkbJ49m2E5+y20PwEXBZL0WmoSLZ9sIZLvomOV0t1dO6Qau24Gc= Received: from PH0PR10MB5777.namprd10.prod.outlook.com (2603:10b6:510:128::16) by SA1PR10MB7712.namprd10.prod.outlook.com (2603:10b6:806:3a3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 16:56:48 +0000 Received: from PH0PR10MB5777.namprd10.prod.outlook.com ([fe80::4b84:e58d:c708:c8ce]) by PH0PR10MB5777.namprd10.prod.outlook.com ([fe80::4b84:e58d:c708:c8ce%4]) with mapi id 15.20.9542.008; Wed, 21 Jan 2026 16:56:46 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Suren Baghdasaryan , Matthew Wilcox , Sidhartha Kumar , Vlastimil Babka , Alice Ryhl , Kuninori Morimoto , Geert Uytterhoeven , Arnd Bergmann , Christian Kujau , "Liam R. Howlett" Subject: [PATCH v2 02/29] maple_tree: Move mas_spanning_rebalance loop to function Date: Wed, 21 Jan 2026 11:44:59 -0500 Message-ID: <20260121164526.2093265-3-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260121164526.2093265-1-Liam.Howlett@oracle.com> References: <20260121164526.2093265-1-Liam.Howlett@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: YT4PR01CA0274.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:109::27) To PH0PR10MB5777.namprd10.prod.outlook.com (2603:10b6:510:128::16) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5777:EE_|SA1PR10MB7712:EE_ X-MS-Office365-Filtering-Correlation-Id: c07f6fc5-b4a3-425e-d0a5-08de590e0fcd 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: =?us-ascii?Q?RW8TBlm2F3H+HAh4ulHDO93W3ROQiii+u4hjAOcXbi4RJdzZYXExgb6N4m6D?= =?us-ascii?Q?3T6aMR6xGSLjB0gR4VT/DnCSi4hAmk40hw5xmNR5b09ZoHroxpFG8eBNcFxK?= =?us-ascii?Q?bA11FgiQjt1R+FgmB9NpMBUU1xnw9AL2Gl+kdI6T4bxwRsYBnhOvHRcAwpxt?= =?us-ascii?Q?2G4b6VZKogROakNXgiEJ2+h04EBXzGOPfcCeNJQfXOwc5cuWf4iUqaZIV+4X?= =?us-ascii?Q?rs6p9qMQdq/If5PzK6eCu4p+sq+umVR1hEFwnPDxzC2+XuhE0mXMbSxIUdiR?= =?us-ascii?Q?NNeN9YGvKSpKxGL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us-ascii?Q?AR6tb08919DpTOidtww6q6Jb0HYC4r8dbFvDUOXDrDhAe1ei0fCNEW1aNUoO?= =?us-ascii?Q?ZtkgY22kqmqaNoD6Br/DV5Ou1BGmhVScJZDYq3UH/FDgNmZuB0RwJkK30fdd?= =?us-ascii?Q?F0xEo+etYgHMb993lDeLhxB3SHhEB0ttgNzoS0XNK8Td1SGSGov37PKApKE1?= =?us-ascii?Q?rttfWxxTyLOoClLYE8/Io26CSfzkyRtW+m2BWTgNRU0TV0ccvFhGHaFi+c0m?= =?us-ascii?Q?oilZUnEaKwdFtMokTVi7PWBLf2q1wyq8usoXOQ3jkKUp/jpwvPVIh/GoXeZ+?= =?us-ascii?Q?imheDESWoMILtnsNBerju0xB1FC7zfDtI61F5a6waN4NxtoZDNQg8CHsVXVM?= =?us-ascii?Q?NAcwiyX24Ye4FkW8W/g=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5777.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: =?us-ascii?Q?t6nN7v6yoqzYmYFW5ZSUe/oq0Zmfr7HTRyNp16Ec5wi21sfHlgEw/4+BXWqF?= =?us-ascii?Q?o+dzthEHf9mdtyobdDVPP4/3+GSxXcH9cERUmY6gTbrB5a/hb69OcXNFDAl8?= =?us-ascii?Q?d9VDBu7nNJazq+k5raGvGsiDWPcS+6Q7SxG4PDkZY07mYOhgvItMgIXCb60s?= =?us-ascii?Q?Ea8Do1ddhDgJuhHjM6JVIxznGNNUbLvTqXwa2KXpyu8MFFqn+5pn20+2zVre?= =?us-ascii?Q?pLyhiN3aWvgjpRhuwUPu7gJCduIMPI4kH9XTkXdULu8SO1a3xsbXyIsBes/2?= =?us-ascii?Q?iAq83KV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ascii?Q?JXVyyqlfbRXq6VNepgB48e65gFXoaBLHs5Pf1NXUrEKfOWC7nJ4XU27p7e6J?= =?us-ascii?Q?TSZ4wwMCLrRWv4Juyht3VI/fe1AzaNZpMnxYTxMNrxScsvT7OuxcbgVuhna2?= =?us-ascii?Q?xqUrggfqmFjn3eoxouzsJwldz2GnwyDRE0Ji7sZhGNTlPG7wptaTC4zulYcA?= =?us-ascii?Q?tBIfq/eQwyVFn5e7pqR5b6+vt6cwc6NGDImOJWDY0EiHGbH57E9YuqLNrAVX?= =?us-ascii?Q?w3yUcehV2mn/axxWjOa939LDWNZvqLUimN3hj15ycB2WJq8E2d2AE28NOP8X?= =?us-ascii?Q?E1KDlGUSmcsOmcDVw+zBPcr8EgkrxfcHfo5HXK/7jl+e2zdcwZFs03Ae7m0E?= =?us-ascii?Q?XlXDddUb4hJeKGe4maymwyJVDrag918FzzcPcw0CtQdiqIC+y2kmpkpQCMt8?= =?us-ascii?Q?VJ2f4nB4DcdU9Am+Xr+H2VKO20HI51kHiFRHYykfverx6NkK0yFguTjz20gq?= =?us-ascii?Q?ig5tfP1GN8cL7YemkSgXMienDuteTGB2GJQoYcYNIbIq/g7R+IaYBPv7ftJn?= =?us-ascii?Q?n6s0LUjX2w=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 5KID3C8Q7K/5zIAn9G6e/L1fE7h7h8pUSYTtfeb5UfpKhT5yFCewvJOlv2eH6GUgGMDjKZvSUSKJIsSX3C3Saj4lt/5Xrc+QYSHj4oxj3uvHLwWnw+Afc9U10VWzveIfHub0HegTIpJMV4PjjP9qJp4arJdPH34x0uj1s8hNbMGswSIiBC0+LGalaI16DDIB3wnOLZAX03u6wyruWFWuRQsJkNMqqwDfGbw/KidXHUOHDntHZ3oSTvMkgEksLwXlHmOC/QTZjtOf+ceVPYLbFJot1CDPgfV0r16KLuVRsW3t3bpMSekxSYysWe6lOzO3TcwD1p8Fxk+5XaxnHzbdQ/4crXtcYPdnqs7sMINZTEAFElbF72yZIVubb/VNVOH2OCQDbNX7GwQK73P3prgF5tWzGq/sraTDJ35tzogxF9F4fkhmS1TQhnMWTRjEyu5zO6904QOX+pm/V858EWMYUXonbYjvnpMf60N9JaPJbFQTlrjb5k1S/LqGIDUH/fxt1Vxk6jIo1PkpnBqukhcv9a5yphdG4sk49VFXyGXGWY4lkqh/yGsI6BzLYzdOnq9LTRnWLAXZXNJb/8WE1zrN/aCJzS0pTdwqTj33mg5gWs4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c07f6fc5-b4a3-425e-d0a5-08de590e0fcd X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5777.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 16:56:46.3994 (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: RJ/pOYAyE+mYsYtJQw+6qPTVDb3CtBGV6Ak6/ps9gP/IZCgTJwqMcCvcVBZrQgRbfsH2T6JkKDKFPUr+Tob2Tg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB7712 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.20,FMLib:17.12.100.49 definitions=2026-01-21_02,2026-01-20_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 malwarescore=0 bulkscore=0 adultscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2601150000 definitions=main-2601210142 X-Proofpoint-GUID: BOl6E3kzhWbjf3R9ljiIaxorA0qJQkON X-Proofpoint-ORIG-GUID: BOl6E3kzhWbjf3R9ljiIaxorA0qJQkON X-Authority-Analysis: v=2.4 cv=QdJrf8bv c=1 sm=1 tr=0 ts=69710556 cx=c_pps a=OOZaFjgC48PWsiFpTAqLcw==:117 a=OOZaFjgC48PWsiFpTAqLcw==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=vUbySO9Y5rIA:10 a=GoEa3M9JfhUA:10 a=VkNPw1HP01LnGYTKEx00:22 a=yPCof4ZbAAAA:8 a=KfpCAqERy7lSuQKxsjcA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTIxMDE0MyBTYWx0ZWRfXx+wn7X+S8zuX fnve1L6F9lBqgm96QGrBYVxq/SJPiN5u+Lc3NRj90n72FTZvg6Ss55b9KbmI42o8T11pr++7q7j RWH+PzLzbS89J8guzPJtMFfY204/dRd9yfeXlFS0IHhSjztpDerPBJZnMVncjuKLnovVchUO+CN 3h6BG90eWfN/w1EUOfW9gUfm71CQG7fb1v2b1oPLJ0jz/Z5Sn/c2ngNDWAZfbLCF+1lTRTvpwu7 RFXON11cL/UBZMoV8GuhwdDZEdL6r/Qux7kj13t95EApKdlYCg62AQsmS2LUBp6wQLCXv+Z/SMa T34fGt/pt5hdQoHU552JZrSazJI63M5tp1NUHrq7L7zce76ivSvrX0GVPhti8CAXPavZojHaVKR fFEtsyByNu4jROwly1c2zCqivG/s6wK5ZWd5owGhVRRJskpKQO7rjm7tlNnz5QFI9Oo6l7S025V /K7mpoAhJpW2chQaFQg== Content-Type: text/plain; charset="utf-8" Move the loop over the tree levels to its own function. No intended functional changes. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 108 +++++++++++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 50 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 0e0158ee7ba55..70ad474e6ed14 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2595,49 +2595,16 @@ static inline void *mtree_range_walk(struct ma_stat= e *mas) return NULL; } =20 -/* - * mas_spanning_rebalance() - Rebalance across two nodes which may not be = peers. - * @mas: The starting maple state - * @mast: The maple_subtree_state, keeps track of 4 maple states. - * @count: The estimated count of iterations needed. - * - * Follow the tree upwards from @l_mas and @r_mas for @count, or until the= root - * is hit. First @b_node is split into two entries which are inserted int= o the - * next iteration of the loop. @b_node is returned populated with the fin= al - * iteration. @mas is used to obtain allocations. orig_l_mas keeps track = of the - * nodes that will remain active by using orig_l_mas->index and orig_l_mas= ->last - * to account of what has been copied into the new sub-tree. The update of - * orig_l_mas->last is used in mas_consume to find the slots that will nee= d to - * be either freed or destroyed. orig_l_mas->depth keeps track of the hei= ght of - * the new sub-tree in case the sub-tree becomes the full tree. - */ -static void mas_spanning_rebalance(struct ma_state *mas, +static void mas_spanning_rebalance_loop(struct ma_state *mas, struct maple_subtree_state *mast, unsigned char count) { + unsigned char split, mid_split; unsigned char slot =3D 0; unsigned char new_height =3D 0; /* used if node is a new root */ struct maple_enode *left =3D NULL, *middle =3D NULL, *right =3D NULL; struct maple_enode *old_enode; =20 - MA_STATE(l_mas, mas->tree, mas->index, mas->index); - MA_STATE(r_mas, mas->tree, mas->index, mas->last); - MA_STATE(m_mas, mas->tree, mas->index, mas->index); - - /* - * The tree needs to be rebalanced and leaves need to be kept at the same= level. - * Rebalancing is done by use of the ``struct maple_topiary``. - */ - mast->l =3D &l_mas; - mast->m =3D &m_mas; - mast->r =3D &r_mas; - l_mas.status =3D r_mas.status =3D m_mas.status =3D ma_none; - - /* Check if this is not root and has sufficient data. */ - if (((mast->orig_l->min !=3D 0) || (mast->orig_r->max !=3D ULONG_MAX)) && - unlikely(mast->bn->b_end <=3D mt_min_slots[mast->bn->type])) - mast_spanning_rebalance(mast); - /* * Each level of the tree is examined and balanced, pushing data to the l= eft or * right, or rebalancing against left or right nodes is employed to avoid @@ -2672,10 +2639,10 @@ static void mas_spanning_rebalance(struct ma_state = *mas, =20 mast_ascend(mast); mast_combine_cp_left(mast); - l_mas.offset =3D mast->bn->b_end; - mab_set_b_end(mast->bn, &l_mas, left); - mab_set_b_end(mast->bn, &m_mas, middle); - mab_set_b_end(mast->bn, &r_mas, right); + mast->l->offset =3D mast->bn->b_end; + mab_set_b_end(mast->bn, mast->l, left); + mab_set_b_end(mast->bn, mast->m, middle); + mab_set_b_end(mast->bn, mast->r, right); =20 /* Copy anything necessary out of the right node. */ mast_combine_cp_right(mast); @@ -2708,17 +2675,17 @@ static void mas_spanning_rebalance(struct ma_state = *mas, count++; } =20 - l_mas.node =3D mt_mk_node(ma_mnode_ptr(mas_pop_node(mas)), + mast->l->node =3D mt_mk_node(ma_mnode_ptr(mas_pop_node(mas)), mte_node_type(mast->orig_l->node)); =20 - mab_mas_cp(mast->bn, 0, mt_slots[mast->bn->type] - 1, &l_mas, true); + mab_mas_cp(mast->bn, 0, mt_slots[mast->bn->type] - 1, mast->l, true); new_height++; - mas_set_parent(mas, left, l_mas.node, slot); + mas_set_parent(mas, left, mast->l->node, slot); if (middle) - mas_set_parent(mas, middle, l_mas.node, ++slot); + mas_set_parent(mas, middle, mast->l->node, ++slot); =20 if (right) - mas_set_parent(mas, right, l_mas.node, ++slot); + mas_set_parent(mas, right, mast->l->node, ++slot); =20 if (mas_is_root_limits(mast->l)) { new_root: @@ -2726,20 +2693,61 @@ static void mas_spanning_rebalance(struct ma_state = *mas, while (!mte_is_root(mast->orig_l->node)) mast_ascend(mast); } else { - mas_mn(&l_mas)->parent =3D mas_mn(mast->orig_l)->parent; + mas_mn(mast->l)->parent =3D mas_mn(mast->orig_l)->parent; } =20 old_enode =3D mast->orig_l->node; - mas->depth =3D l_mas.depth; - mas->node =3D l_mas.node; - mas->min =3D l_mas.min; - mas->max =3D l_mas.max; - mas->offset =3D l_mas.offset; + mas->depth =3D mast->l->depth; + mas->node =3D mast->l->node; + mas->min =3D mast->l->min; + mas->max =3D mast->l->max; + mas->offset =3D mast->l->offset; mas_wmb_replace(mas, old_enode, new_height); mtree_range_walk(mas); return; } =20 +/* + * mas_spanning_rebalance() - Rebalance across two nodes which may not be = peers. + * @mas: The starting maple state + * @mast: The maple_subtree_state, keeps track of 4 maple states. + * @count: The estimated count of iterations needed. + * + * Follow the tree upwards from @l_mas and @r_mas for @count, or until the= root + * is hit. First @b_node is split into two entries which are inserted int= o the + * next iteration of the loop. @b_node is returned populated with the fin= al + * iteration. @mas is used to obtain allocations. orig_l_mas keeps track = of the + * nodes that will remain active by using orig_l_mas->index and orig_l_mas= ->last + * to account of what has been copied into the new sub-tree. The update of + * orig_l_mas->last is used in mas_consume to find the slots that will nee= d to + * be either freed or destroyed. orig_l_mas->depth keeps track of the hei= ght of + * the new sub-tree in case the sub-tree becomes the full tree. + */ +static void mas_spanning_rebalance(struct ma_state *mas, + struct maple_subtree_state *mast, unsigned char count) +{ + + MA_STATE(l_mas, mas->tree, mas->index, mas->index); + MA_STATE(r_mas, mas->tree, mas->index, mas->last); + MA_STATE(m_mas, mas->tree, mas->index, mas->index); + + /* + * The tree needs to be rebalanced and leaves need to be kept at the same= level. + * Rebalancing is done by use of the ``struct maple_topiary``. + */ + mast->l =3D &l_mas; + mast->m =3D &m_mas; + mast->r =3D &r_mas; + l_mas.status =3D r_mas.status =3D m_mas.status =3D ma_none; + + /* Check if this is not root and has sufficient data. */ + if (((mast->orig_l->min !=3D 0) || (mast->orig_r->max !=3D ULONG_MAX)) && + unlikely(mast->bn->b_end <=3D mt_min_slots[mast->bn->type])) + mast_spanning_rebalance(mast); + + mas_spanning_rebalance_loop(mas, mast, count); +} + /* * mas_rebalance() - Rebalance a given node. * @mas: The maple state --=20 2.47.3