* [PATCH] docs: maple_tree: Replace removed bulk insertion API
@ 2026-09-05 1:55 Karl Mehltretter
2026-09-05 2:43 ` Nick Huang
0 siblings, 1 reply; 2+ messages in thread
From: Karl Mehltretter @ 2026-09-05 1:55 UTC (permalink / raw)
To: Liam R. Howlett, Andrew Morton
Cc: Karl Mehltretter, Alice Ryhl, Andrew Ballance, Jonathan Corbet,
Shuah Khan, Randy Dunlap, Suren Baghdasaryan, Vlastimil Babka,
maple-tree, linux-mm, linux-doc, linux-kernel
Commit e3852a1213ff ("maple_tree: Drop bulk insert support") removed
mas_expected_entries() but left the documentation describing it.
Document the current preallocation interface instead.
Fixes: e3852a1213ff ("maple_tree: Drop bulk insert support")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
Documentation/core-api/maple_tree.rst | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/Documentation/core-api/maple_tree.rst b/Documentation/core-api/maple_tree.rst
index 12bccfb6aac1..836342fb1eec 100644
--- a/Documentation/core-api/maple_tree.rst
+++ b/Documentation/core-api/maple_tree.rst
@@ -214,11 +214,10 @@ Advanced Allocating Nodes
-------------------------
Allocations are usually handled internally to the tree, however if allocations
-need to occur before a write occurs then calling mas_expected_entries() will
-allocate the worst-case number of needed nodes to insert the provided number of
-ranges. This also causes the tree to enter mass insertion mode. Once
-insertions are complete calling mas_destroy() on the maple state will free the
-unused allocations.
+need to occur before a write occurs then calling mas_preallocate() will
+allocate the nodes needed to store the provided entry. The entry is then
+stored with mas_store_prealloc(). If the store is abandoned, calling
+mas_destroy() on the maple state will free the unused allocations.
.. _maple-tree-advanced-locks:
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] docs: maple_tree: Replace removed bulk insertion API
2026-09-05 1:55 [PATCH] docs: maple_tree: Replace removed bulk insertion API Karl Mehltretter
@ 2026-09-05 2:43 ` Nick Huang
0 siblings, 0 replies; 2+ messages in thread
From: Nick Huang @ 2026-09-05 2:43 UTC (permalink / raw)
To: Karl Mehltretter
Cc: Liam R. Howlett, Andrew Morton, Alice Ryhl, Andrew Ballance,
Jonathan Corbet, Shuah Khan, Randy Dunlap, Suren Baghdasaryan,
Vlastimil Babka, maple-tree, linux-mm, linux-doc, linux-kernel
On Sat, Sep 05, 2026 at 03:55:09AM +0200, Karl Mehltretter wrote:
> Commit e3852a1213ff ("maple_tree: Drop bulk insert support") removed
> mas_expected_entries() but left the documentation describing it.
> Document the current preallocation interface instead.
>
> Fixes: e3852a1213ff ("maple_tree: Drop bulk insert support")
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
> ---
> Documentation/core-api/maple_tree.rst | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/core-api/maple_tree.rst b/Documentation/core-api/maple_tree.rst
> index 12bccfb6aac1..836342fb1eec 100644
> --- a/Documentation/core-api/maple_tree.rst
> +++ b/Documentation/core-api/maple_tree.rst
> @@ -214,11 +214,10 @@ Advanced Allocating Nodes
> -------------------------
>
> Allocations are usually handled internally to the tree, however if allocations
> -need to occur before a write occurs then calling mas_expected_entries() will
> -allocate the worst-case number of needed nodes to insert the provided number of
> -ranges. This also causes the tree to enter mass insertion mode. Once
> -insertions are complete calling mas_destroy() on the maple state will free the
> -unused allocations.
> +need to occur before a write occurs then calling mas_preallocate() will
> +allocate the nodes needed to store the provided entry. The entry is then
> +stored with mas_store_prealloc(). If the store is abandoned, calling
> +mas_destroy() on the maple state will free the unused allocations.
>
> .. _maple-tree-advanced-locks:
>
> --
> 2.53.0
Hi Karl
The documented behavior appears to be consistent with the existing tests in
tools/testing/radix-tree/maple.c, in particular the mas_preallocate() /
mas_store_prealloc() / mas_destroy() handling around lines 35173-35185:
https://elixir.bootlin.com/linux/v7.2.2/source/tools/testing/radix-tree/maple.c#L35173
https://elixir.bootlin.com/linux/v7.2.2/source/tools/testing/radix-tree/maple.c#L35185
Acked-by: Nick Huang [sef1548@gmail.com](mailto:sef1548@gmail.com)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-05 2:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-05 1:55 [PATCH] docs: maple_tree: Replace removed bulk insertion API Karl Mehltretter
2026-09-05 2:43 ` Nick Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox