From nobody Mon Feb 9 13:35:35 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 104F33859F6 for ; Fri, 30 Jan 2026 21:00:43 +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=1769806845; cv=fail; b=aZV4EDGj5ZMALjma3FAt91QfTB8HVzPEKk0327DySgGAxikwOmvP3t7lvTuoXCzmLsAbdRT4U61f1VjWwV7HSt+vZJTUMMi1VJt5qFFzXkpL7Smku3PA4qKPV3Q0r0UXh0P1jh0FTdl8pnJrhPQnePtCjb76h5qVh+7dP2JuywA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769806845; c=relaxed/simple; bh=BDrFDkBat8MATdocoahHvYfm72NFuwQ50spoKWVsobo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Hqb1WFEkz0yYGkShedbLQ+u0m+RnLOQWVu66LzjEfzdb+CeFkM1xJ9SbUazleA4uWU7DAV+p+Hdeu+7pM2jYnV7KMk+xlfB9QsQFAsggMNQOVnpxBZrA3Eanr7pi36OuqGtZo7RVzPIYb9mF3n1jgaxPTRMJRfXMmh5lf26Dvzk= 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=daVAtDFb; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Mc1V5h/+; 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="daVAtDFb"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Mc1V5h/+" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60UKE3Vf4029215; Fri, 30 Jan 2026 21:00:08 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= daVAtDFbQDQ2OhaehDQ5RPyWed7dwOwvdjyqgl0kKU/+vI9vGSWV33+cQAOV09d7 A+IKMo9MGyCTNpagITKwMWJuBOLPnxX+26tXpxSG+qWQbJIBqEqLB9q8SOfU7ucg GIBgJPk/AcTVcOCYWS6JzAumfpXfdWTaXrPG1KAcUPUHD09OXsDf+dQgIWEcDhj4 la86hM+OVknsfiJHVjek8npFJtTNk1ULJOiFeDOdztbgMJR0/qUY9ZOCDBf+zHiT G9C+oEzW/AE16yX/4752OhDA8PKEMB9V05v7t9UqrT0EEN0K8reGGxHgH1wLMvYB f4yE1JjmTUgAuCNvDqY4Rg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4c10668cex-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Jan 2026 21:00:08 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 60UJkq9S010432; Fri, 30 Jan 2026 21:00:06 GMT Received: from dm1pr04cu001.outbound.protection.outlook.com (mail-centralusazon11010036.outbound.protection.outlook.com [52.101.61.36]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 4bvmhe6d7v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Jan 2026 21:00:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jpqPFDlxHBxfcemBYLQ7HLPGqyO+EnCskJQdtc4ukqLYykiCaV0XZj9cMQS6qAakL8AGGSH2/NkPX7+aH3w3Gedwl6fkR52of2b6g1BVO2EUJfXQ57lnhFv4wn6+D7hXCaDYfBvQ9mX7IkWuGIGdtYcLcQNjMiEnPf1wOVFdSfVbcEEHJzm+Ys57siHKj6aFU4CTY814EUrG38KQWUCz8zA2+LO7BXPRUByJtoD3Ol9sGmgqLBeMXRjnExvarbDsvWHjZY334LGk4A/qwT2Z3o9WtVa/AzNZ9WKDKzA4ex0KYYyiBaFJ09dXZnCX086eumVCrI+v7htcL3UbPr1SPg== 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=OZugpBjrd4XY5YpglyfBfYgHj1ZiA5omWSo0CONhHqWRFOjln6WbxP+ftMzRMJVOuEGkDX/CiE7CxOJh0RUS2aMbhrMuvcTRsoVcXHLrYnVoAkyzToU0qig0H+jiJYTkXuoR7+36SxH91aD7nQZorMBawkT5RGwDJfPC91zpJKYpNIyVzqwN8WNRqnQnciOz1LbKAbqdh/Ydm7m58N02INDnLWBDWnHsYWjgzvwepRF2DyxGuhA67EsHzXxBMTO3odyJAkdurqxINljikP0BQwrlgn8izJUpcd9wMr8G2csG+ToTXpvVq70+MEiqbf4sHCsQd7jfRIJP8lB9IB6lNA== 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=Mc1V5h/+eoZmKzAfEqpnlGEjppfPg0fEL3gzn+gp8ccRNbreuRusVbAyGi4p79dS0PPKsFB/PQODgQxXvYk0wGduiK0WevAE98j+2LjLPgUDlPj4/GBVVLKkPQn7ZjXsKCjf+zXllxIO0G8Mq56MFvTrr+FIsqJTbCZa6NYEDHA= Received: from PH0PR10MB5777.namprd10.prod.outlook.com (2603:10b6:510:128::16) by CY5PR10MB5961.namprd10.prod.outlook.com (2603:10b6:930:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9564.11; Fri, 30 Jan 2026 20:59:59 +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.9564.007; Fri, 30 Jan 2026 20:59:59 +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 , SeongJae Park , "Liam R. Howlett" Subject: [PATCH v3 02/30] maple_tree: Move mas_spanning_rebalance loop to function Date: Fri, 30 Jan 2026 15:59:07 -0500 Message-ID: <20260130205935.2559335-3-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260130205935.2559335-1-Liam.Howlett@oracle.com> References: <20260130205935.2559335-1-Liam.Howlett@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: YT1PR01CA0081.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:2d::20) 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_|CY5PR10MB5961:EE_ X-MS-Office365-Filtering-Correlation-Id: b6bffa4d-0671-4b79-9a11-08de604287d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?iWsoMHQsyhe/96v4nGw41iNAZD4KTpz1NUzK/cUsLOyjV8V6Q3QQCvQXiiYy?= =?us-ascii?Q?Hut90WvzCs7pLYN+8mJ4BBLm7IHPrR4fh14MAu8eeUmUNNY7eiDfqIO1/8DT?= =?us-ascii?Q?N/AM1Rfrl9FOQVoxWvZP8KShVGzUreNHziSPZizD+YfOGoCz6z3BwNOAyyF5?= =?us-ascii?Q?hW3AZNy4PXpE2gAyECQhFlRxa47YLpIPuiEbOJIQUHEc79kUXo2i1FSK4tBF?= =?us-ascii?Q?ugkNbhgK7wc9ExoPL+FyWwOJ8PRhoBbZNercgMhoGq5706caajF7fFDyl7mN?= =?us-ascii?Q?uDu6KHjOp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=?us-ascii?Q?5E6YdJC+SVjT6Jx+4YiXTsT9jfSY/y+sozg0YN3T92kKPA4C4HAuVEM4K/tE?= =?us-ascii?Q?V7BSa4xOCgL+hYYruq5bK14YfoJ1EucDgJCbpG1Hl8UN7CN3ziHN3d3/jA/D?= =?us-ascii?Q?/RYp1bhQeSBgJj3BbRrz+x4TiItxiHeg9bOYUNVfLQ7wdBYyZjVQfGeRUBxK?= =?us-ascii?Q?Te7sU3v/5tK4ki/rNs+6kUbjRXs2smrw/vniHv22CStirkJ4DSEs1PTETG9l?= =?us-ascii?Q?5mEL4rT/jP7RdoBE2NzGAeeCoYpTOAxvIvs+Fo0nbN9UOdQXXY23uEw63Ym1?= =?us-ascii?Q?nrto/evBxvntuXNUSBgn5JczXCET0sytky+2rER6nejmagSzETtgUFxS0b0u?= =?us-ascii?Q?mHnQuClgimY0V2cpTsM=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)(376014)(366016)(1800799024)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?qDbrsy1hVOsh3qQMS4rxEHHu8zMcBmZCK3g1cbr5IlUIMiUxvh22fAo4ZVKb?= =?us-ascii?Q?YhkinMK5rOfgOz3HciVPFKR2NlHkceT494dh8yO9FFCM241GD6Kb3E2h6Ayw?= =?us-ascii?Q?eIpT8y1DLJ9A+tsnaBjtq+WKhlDg/PntFLxNS7/oXhkoi0dlDMT2V7NGJa/Z?= =?us-ascii?Q?d73Se4Tmjditgk8wZJP7L02YXdU4iei2GWg47V0fX613Etxw+hmZ/A4Fca1V?= =?us-ascii?Q?knJqxARtksyqszecNoj8WqFmTna7mcaLif9OMWsAoVxHczfgYPJtf1KM84el?= =?us-ascii?Q?z3Qmxlgds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EXm1M4wD?= =?us-ascii?Q?m4hKX6cKNneyddB3zrYjGXtNUGEeRt6muMRlhA5TbdxndKIwYlf3A7xkaynM?= =?us-ascii?Q?/VbyTAG6RycDIFWs+rXAXq9mWhfYVKes/jereQpDz3Rk+Irtj4F+BpZU8JY3?= =?us-ascii?Q?pyMu2XxrBIUJVaOz7Cof73kNd3f8wX1pp2EdgInEXa63x2rPyXt0IfxZnMM9?= =?us-ascii?Q?cpso4rYwwpFv2C7nEO/SVGWc8uZ7U2LLWZlmtXSel9lTrL9V0lWiYXdWWAcW?= =?us-ascii?Q?zF3IXbLXDO8kjNKNOWDShTCOR0aAlYeyHDgmikaulJ+5ZNqS7u2K0bp0cggI?= =?us-ascii?Q?METQhKWDtPnei4iFM3iK/SXd9hKk49MAYMxdsdT4spYjwi/fQOXpDgLXxxrh?= =?us-ascii?Q?W8Gj+9Bat/kl2tQ1N+kB7/W+ZdbVC3N7tQPMmpU0mVh6ccJkBRMi7GEdSMbV?= =?us-ascii?Q?XNYoM1jxtm+jrOeGjeqzioKcm+8x4ur28qYKUVr36+EuvRu1AdQFrFYoG8Du?= =?us-ascii?Q?lPp6jP1JVk4vgbqNA2A2e/TroQJFYjdf/iLTkIu9GmPaMDmGFu046O2wTBLv?= =?us-ascii?Q?x3y1J9amow=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: w3LfaRyQX/FbF35RyzcjujiFyOWkkLponl511M/1F08dk1r1OHVVHNOyZk9u7rrrESWox/QBXi2jicwZKnubaaeURVpRzXsho/Qg/7sF9/HtFdVdG8B4dFbXlUDLvvJ8JFsX8Lz3SyGYkjhwtwExI5SH7i9JzZYMqoIoffvfvDBo4Lp0nn7OgCq5T4zgSRSosoIwYEeOklXl3y1Oi5/7hlxyVbkLx9AGetbAxKL7BENrmLKpMl7SGZqpG0TwvZU4PBUlRNnk3QUskCMjsI5NAPWViJqIv+PX45xeTTALPMYPhUEXrw5epM7w219v+fseJ/ROY32OTFLob4KTFM1O+HjlVQlo4NLgw+y37T74lN03mZBVBcom90juMnvF6CvimxA/XekYFg0oEoFbaSSWguT5lvn5FiNmqpiGcGfepQSDdXezfecuCafW6hXaFK8hqOTXIV18rL8EjTXAlNOr1tKq/MVy5EC7SVpORPmLXnYKNkahklLeun0gmdCn7rNnuDWvxB4AuTsKj3oVOXoOEyc6hDzkCDX1nC54l9TLj3zKgQz35ZLnoNvmgWOMPE8ZtpTK7Be1nnkMfKWR/3xylEgy65muNcp7E/fC+kys/kM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6bffa4d-0671-4b79-9a11-08de604287d7 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5777.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2026 20:59:59.7804 (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: 8AXVtSVbn4ZQ1t+wb4BqeMnGl9+qFlcmggGuopFzpz+F5hg3gy6umV9k3by1mCLqdXk0uLEGFDyRc7l3uihc7g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB5961 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-01-30_03,2026-01-30_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 mlxscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2601150000 definitions=main-2601300172 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTMwMDE3MiBTYWx0ZWRfX3QsCeEPgnW1L mip3Pfl0GopEyLpiHrkE08ObBtfTbxJynOh83XFsJFeG30v0OoP0YGd9oUYX1TmCeOQO8/N4xxL f8G63HJDM/MbtAObjECNdJBFLiijTeYElH4Ij8mZDgqBpns+RakNctQ78X1vo+quiufDvzEdIRT zXFBWn1iXp8B84gzwAlMnOkcOfv9qpbWbGwV3sgTRzKfygSw/iCZq53HitkgsgdjukILglCYWyS luzU1P/bTz5L+DeyppDPON71EOQ8kMH+K+4arGf/GtB2doPJ69cms4y3eN/ruayaBLU/1moABsr NibQdlPw29V6GIbRWf5LV26dja58A5AsZnWYpZzRB4/0yrdjGpYbiJcdGDg9H+WaoH3oXJWNA3g nu0MjMglH4zKh9TRyWYmaJI5A/H/JzsDZjcxLVfqYxtDJ4Bu8wvSzy8sg+lTdr5Aq3cqr7LdBlq 4jnoBsaSqWWGud/qRNg== X-Proofpoint-ORIG-GUID: hn6NqjPHL9hIREfChkW0558AfZ0-vU7K X-Authority-Analysis: v=2.4 cv=EebFgfmC c=1 sm=1 tr=0 ts=697d1bd8 cx=c_pps a=XiAAW1AwiKB2Y8Wsi+sD2Q==:117 a=XiAAW1AwiKB2Y8Wsi+sD2Q==: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-GUID: hn6NqjPHL9hIREfChkW0558AfZ0-vU7K 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