linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/12] maple_tree: iterator state changes
@ 2023-11-01 17:16 Liam R. Howlett
  2023-11-01 17:16 ` [PATCH 01/12] maple_tree: Remove unnecessary default labels from switch statements Liam R. Howlett
                   ` (11 more replies)
  0 siblings, 12 replies; 19+ messages in thread
From: Liam R. Howlett @ 2023-11-01 17:16 UTC (permalink / raw)
  To: Andrew Morton; +Cc: maple-tree, linux-mm, linux-kernel, Liam R. Howlett

Andrew,

These patches have some general cleanup and a change to separate the
maple state status tracking from the maple state node.

The maple state status change allows for walks to continue from previous
places when the status needs to be recorded to make logical sense for
the next call to the maple state.  For instance, it allows for prev/next
to function in a way that better resembles the linked list.  It also
allows switch statements to be used to detect missed states during
compile, and the addition of fast-path "active" state is cleaner as an
enum.

While making the status change, perf showed some very small (one line)
functions that were not inlined even with the inline key word.  Making
these small functions __always_inline is less expensive according to
perf.  As part of that change, some inlines have been dropped from
larger functions.

Perf also showed that the commonly used mas_for_each() iterator was
spending a lot of time finding the end of the node.  This series
introduces caching of the end of the node in the maple state (and
updating it during writes). This caching along with the inline changes
yielded at 23.25% improvement on the BENCH_MAS_FOR_EACH maple tree test
framework benchmark.

I've also included a change to mtree_range_walk and mtree_lookup_walk to
take advantage of Peng's change [1] to the initial pivot setup.

mmtests did not produce any significant gains.

[1] https://lore.kernel.org/all/20230711035444.526-1-zhangpeng.00@bytedance.com/T/#u

Liam R. Howlett (12):
  maple_tree: Remove unnecessary default labels from switch statements
  maple_tree: Make mas_erase() more robust
  maple_tree: Move debug check to __mas_set_range()
  maple_tree: Add end of node tracking to the maple state
  maple_tree: Use cached node end in mas_next()
  maple_tree: Use cached node end in mas_destroy()
  maple_tree: Clean up inlines for some functions
  maple_tree: Separate ma_state node from status.
  maple_tree: Remove mas_searchable()
  maple_tree: Use maple state end for write operations
  maple_tree: Don't find node end in mtree_lookup_walk()
  maple_tree: mtree_range_walk() clean up

 include/linux/maple_tree.h                  | 342 +++++-----
 include/linux/mm_types.h                    |   3 +-
 lib/maple_tree.c                            | 680 +++++++++++---------
 lib/test_maple_tree.c                       | 201 +++---
 mm/internal.h                               |  10 +-
 tools/testing/radix-tree/linux/maple_tree.h |   2 +-
 tools/testing/radix-tree/maple.c            |  27 +-
 7 files changed, 679 insertions(+), 586 deletions(-)

-- 
2.40.1



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2025-04-03  2:54 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-01 17:16 [PATCH 00/12] maple_tree: iterator state changes Liam R. Howlett
2023-11-01 17:16 ` [PATCH 01/12] maple_tree: Remove unnecessary default labels from switch statements Liam R. Howlett
2023-11-01 17:16 ` [PATCH 02/12] maple_tree: Make mas_erase() more robust Liam R. Howlett
2023-11-01 17:16 ` [PATCH 03/12] maple_tree: Move debug check to __mas_set_range() Liam R. Howlett
2023-11-01 17:16 ` [PATCH 04/12] maple_tree: Add end of node tracking to the maple state Liam R. Howlett
2023-11-01 17:16 ` [PATCH 05/12] maple_tree: Use cached node end in mas_next() Liam R. Howlett
2023-11-01 17:16 ` [PATCH 06/12] maple_tree: Use cached node end in mas_destroy() Liam R. Howlett
2023-11-01 17:16 ` [PATCH 07/12] maple_tree: Clean up inlines for some functions Liam R. Howlett
2023-11-01 17:16 ` [PATCH 08/12] maple_tree: Separate ma_state node from status Liam R. Howlett
2023-11-02  8:42   ` kernel test robot
2023-11-02 17:39     ` Liam R. Howlett
2023-11-06 15:41   ` [PATCH] maple_tree: Fix comments about MAS_* Liam R. Howlett
2023-11-06 15:45   ` [PATCH] maple_tree: Update forking to separate maple state and node Liam R. Howlett
2025-04-03  0:33   ` [PATCH] test suite: Use %zu to print size_t Liam R. Howlett
2025-04-03  2:53     ` Liam R. Howlett
2023-11-01 17:16 ` [PATCH 09/12] maple_tree: Remove mas_searchable() Liam R. Howlett
2023-11-01 17:16 ` [PATCH 10/12] maple_tree: Use maple state end for write operations Liam R. Howlett
2023-11-01 17:16 ` [PATCH 11/12] maple_tree: Don't find node end in mtree_lookup_walk() Liam R. Howlett
2023-11-01 17:16 ` [PATCH 12/12] maple_tree: mtree_range_walk() clean up Liam R. Howlett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).