From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9E9D3AA1BD for ; Mon, 15 Jun 2026 09:52:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781517149; cv=none; b=LgZISKWUaB6roHZHaC5PgX7uKLAzAXfhT0Jjj62up0E0ND2gIHveG6sH5rbDorXoyTKBo600CZuc2eP9eAwUkNYcYDB1gTXw6iOpk1+RQGoGJG0J+T5SQ5NkPgH1O0gWArZkyFDvPxaZ+dqCA6fl4bXfz7bcy2DBgwaC2Qi6Hrs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781517149; c=relaxed/simple; bh=E9DzElj/L3Z4sBd5ZAO7ctqMgVFfgB9yNx3juJWYoDI=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HR4kPh/MZF3+VC++XjIYQFpWCuzNiSlcLK5IFtFPJjTuxU+IcjOGbxtYDVlVUidAl0Sm9LLBAngKOmue7lLJDx03SfjzqxZQF4iIw3fr0ASyqyvg5Ja3Da73LnHmCsyTHVzSjRMFLiA1hMHdF5xZ2pxrH5TcalnWHTj2XV0BGYo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AM505f8h; arc=none smtp.client-ip=209.85.208.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AM505f8h" Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-3967738c801so26262751fa.2 for ; Mon, 15 Jun 2026 02:52:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781517146; x=1782121946; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=Kj0Gn7Jr1tSJCs+Q3oh8GCThTx5Sz26eyH6pCBt9/Lc=; b=AM505f8hQYxg2pBMWzVJOiyY7GK9vW0ZiZeslycN0EV85rhhjj+DcbWE2jVEV/V1sJ IQIzQhWtRYnvtTwbAaA9JVZFox/5MzYF8khxM9xLJeBg91/kecmmWMB3CmdYcbGJWgJ+ tx3c2UVdkri4faXpzxa7I1CXroicpHMVNRbgg+K+FfsyBPwxQNhqFhCUlIWZv9B5ZINb FmjoydQ2Q/rlDAIslC1Jm4h8TFRTo/Xe/59wq8fb6L+Mk2QJ3wt/oaHmEbcLw8XKBGmt AkA8BdDc7HFrpWth0uQ8p3RIGED2djazHJpjgc5xiQT6xXtGq1piQh+l6EY4viWfi92H Denw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781517146; x=1782121946; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Kj0Gn7Jr1tSJCs+Q3oh8GCThTx5Sz26eyH6pCBt9/Lc=; b=G+q39ebqEPDlc1lYv2dyzeojCSlSRGxnMDIXgqa+Rgto5dzKph4/aLIpfUrAnJMqPD ySoBJ7wX/DCsUA7IiGtXNy0ISRQAjTLwv9wh11i/VI5Rt2cdH2/qFr1cnE1uiBcUJzVZ q6mmlHXzMqmW0uilZgKGR/B4qGDBdyyHMJ/ugUGbW4lBTGr4vuA3tnZkoIAz1mzqLhXf CTzVoHaYxy0CldrGku+JiblR4/Yk2G9Jf7VT4UHMm6UVgZr0OYQEFsK/YH8VOpZf/unL KZO1lxGTUJcC/Z3FFxip2Ya58kW4YfyF5csJMBAguCeNMK5XrEYUl53FOoaNR/dc+Teu iHmw== X-Forwarded-Encrypted: i=1; AFNElJ/z1e591ZWSjF7L0Jj9JsIET4CLcUUzX3DOJ3pkhW/VSlkl5jgUUiZBHTQbwuQ4pyuh7dehFmJp1adKwQk=@vger.kernel.org X-Gm-Message-State: AOJu0YzAd2Gte/KyX9HptE/TBeQ764E/lucFWMk7qqvNOSWvpXkoOcci LhNdG536PnfGXOfUgw8adGxJWNYiewUDcg3Z/HH3cAq0l8iBPOxutolJ X-Gm-Gg: Acq92OEFPhqU7Dn6GhGXShQ2hW3/OBKNL5YqBAD+wyVk9zshUQU7CAhWTo3Is4F7oir 4Pw8XV+zdZkfo2F9+he+/ts51OhWorfmPyUipq0oJd1R3sUR7JSOdJ4A40nK9GOBXU2nDsYhzRc iBJJOEJBO1W8qxIbh+4Xth1cFvPR4AAm9wnf8Q5mV6wxxpt7WlnMoj34MRBNTclQSh+OC9V1OnY DdTZg+INIKS2rqgeokOkVhMXXrVV4qD7P6xn58lSa0SaPgYHpgmJ8id/SR5QbG3D72XEZx35hsz OrlSzsheXPJwTBm6WtLag9WIE9PF/6JkmzONAXBn7DiQP+dqNuVVpc/YLGF7FAA4/TucPqqk9eK ZB+u98DEXjCU6fC3ISlcFbEnVYzDiFg3eS38jX0dxjxr6YRFlNMgcrNMCmGa+OCEQcuO0h9wEs5 xgMoNj9yyTP8nVKII+ugP4nXOsTlsSuvNsbkD+x3Q0gYxc6rcX X-Received: by 2002:a05:6512:800f:10b0:5aa:8562:2a7c with SMTP id 2adb3069b0e04-5ad2db6fcd1mr2639291e87.31.1781517145832; Mon, 15 Jun 2026 02:52:25 -0700 (PDT) Received: from pc636 (host-90-233-213-1.mobileonline.telia.com. [90.233.213.1]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5ad2e161fc7sm2679862e87.12.2026.06.15.02.52.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2026 02:52:25 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Mon, 15 Jun 2026 11:52:22 +0200 To: Matthew Wilcox Cc: Pranjal Arya , Andrew Morton , Uladzislau Rezki , "Liam R. Howlett" , Alice Ryhl , Andrew Ballance , linux-arm-msm@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org, Lorenzo Stoakes , Pranjal Shrivastava , Will Deacon , Suzuki K Poulose , Neil Armstrong , Mostafa Saleh , Balbir Singh , Suren Baghdasaryan , Marco Elver , Dmitry Vyukov , Alexander Potapenko , Shuah Khan , Dev Jain , Brendan Jackman , Puranjay Mohan , Santosh Shukla , Wyes Karny , Sudeep Holla Subject: Re: [PATCH RFC 00/12] mm/vmalloc: migrate vmap_area indexing from rb-tree to maple-tree Message-ID: References: <20260613-vmalloc_maple-v1-0-0aa740bb944b@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sun, Jun 14, 2026 at 12:15:28AM +0100, Matthew Wilcox wrote: > On Sat, Jun 13, 2026 at 10:49:42PM +0530, Pranjal Arya wrote: > > vmalloc's free/busy/lazy area tracking is one of the last remaining > > augmented-rb_tree consumers in the core mm allocators. The rest of > > mm/ has been gradually consolidating range-keyed indexing around > > maple_tree (notably the per-process VMA tree in mm/mmap.c), and > > the underlying reason is a structural mismatch between rb_tree and > > range tracking: > > First, and most importantly, I love this. The maple tree is undoubtedly > the right data structure to use for this purpose. > > What I don't understand is why you maintain a separate "free" tree. > It should not be necessary any more, but maybe you tried removing it > already and found a performance problem? > We maintain it in order to split several entities. That prevents interfering between allocated data and vmap-free-space manager. So in that case one context can easily access allocated data, for example vread iterator, etc., whereas another can do an allocation. So by splitting parts i minimize lock-contention. -- Uladzislau Rezki