]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
4 years agomaple_tree: Rewrite mas_next_node to be less complex.
Liam R. Howlett [Wed, 9 Sep 2020 19:40:57 +0000 (15:40 -0400)]
maple_tree: Rewrite mas_next_node to be less complex.

Remove double while (1) loop, pull in parent slot lookup.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Update mas_next_node comments and break for end of node
Liam R. Howlett [Wed, 9 Sep 2020 18:12:01 +0000 (14:12 -0400)]
maple_tree: Update mas_next_node comments and break for end of node

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: use ma_get_slots() in mas_next_node loop
Liam R. Howlett [Wed, 9 Sep 2020 16:01:57 +0000 (12:01 -0400)]
maple_tree: use ma_get_slots() in mas_next_node loop

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: rework mas_prev_node loop
Liam R. Howlett [Wed, 9 Sep 2020 16:01:37 +0000 (12:01 -0400)]
maple_tree: rework mas_prev_node loop

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Change mas_get_slot to only rcu_dereference when necessary
Liam R. Howlett [Tue, 8 Sep 2020 17:59:56 +0000 (13:59 -0400)]
maple_tree: Change mas_get_slot to only rcu_dereference when necessary

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Use get_slots for extend_null
Liam R. Howlett [Tue, 8 Sep 2020 17:51:19 +0000 (13:51 -0400)]
maple_tree: Use get_slots for extend_null

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Drop mte_get_slot(), _mte_get_slot(), ma_get_slot() and use
Liam R. Howlett [Tue, 8 Sep 2020 17:40:10 +0000 (13:40 -0400)]
maple_tree: Drop mte_get_slot(), _mte_get_slot(), ma_get_slot() and use
mas_get_slots most places.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Change mas_replace to use ma_get_slots
Liam R. Howlett [Tue, 8 Sep 2020 17:39:05 +0000 (13:39 -0400)]
maple_tree: Change mas_replace to use ma_get_slots

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Change more to use ma_get_slots
Liam R. Howlett [Tue, 8 Sep 2020 17:30:22 +0000 (13:30 -0400)]
maple_tree: Change more to use ma_get_slots

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Change adopt_Children to use ma_get_slots
Liam R. Howlett [Tue, 8 Sep 2020 17:10:02 +0000 (13:10 -0400)]
maple_tree: Change adopt_Children to use ma_get_slots

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: use mte_slots for dup
Liam R. Howlett [Tue, 8 Sep 2020 17:00:59 +0000 (13:00 -0400)]
maple_tree: use mte_slots for dup

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Start using mte_slots more
Liam R. Howlett [Tue, 8 Sep 2020 16:56:31 +0000 (12:56 -0400)]
maple_tree: Start using mte_slots more

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Comments
Liam R. Howlett [Tue, 8 Sep 2020 16:31:19 +0000 (12:31 -0400)]
maple_tree: Comments

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Remove recursive call for ma_get_node_alloc_cnt, and rename function
Liam R. Howlett [Tue, 8 Sep 2020 16:28:24 +0000 (12:28 -0400)]
maple_tree: Remove recursive call for ma_get_node_alloc_cnt, and rename function

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Renames to remove _get and comments on some functions
Liam R. Howlett [Tue, 8 Sep 2020 15:51:36 +0000 (11:51 -0400)]
maple_tree: Renames to remove _get and comments on some functions

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Remove comment for range 16 node types in mte_set_parent
Liam R. Howlett [Tue, 8 Sep 2020 15:34:58 +0000 (11:34 -0400)]
maple_tree: Remove comment for range 16 node types in mte_set_parent

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Add new lines where necessary
Liam R. Howlett [Tue, 8 Sep 2020 15:32:43 +0000 (11:32 -0400)]
maple_tree: Add new lines where necessary

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Remove unnecessary check from next_nentry
Liam R. Howlett [Tue, 8 Sep 2020 15:27:48 +0000 (11:27 -0400)]
maple_tree: Remove unnecessary check from next_nentry

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: mas_data_end reduction #2
Liam R. Howlett [Fri, 4 Sep 2020 20:23:23 +0000 (16:23 -0400)]
maple_tree: mas_data_end reduction #2

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: mas_data_end reduction.
Liam R. Howlett [Fri, 4 Sep 2020 20:16:34 +0000 (16:16 -0400)]
maple_tree: mas_data_end reduction.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Drop extra node types and mt_is_empty()
Liam R. Howlett [Fri, 4 Sep 2020 19:50:50 +0000 (15:50 -0400)]
maple_tree: Drop extra node types and mt_is_empty()

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Rename functions and variables
Liam R. Howlett [Fri, 4 Sep 2020 19:33:46 +0000 (15:33 -0400)]
maple_tree: Rename functions and variables

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Optimizations on mas_data_end and mas_rev_awalk
Liam R. Howlett [Fri, 4 Sep 2020 19:17:57 +0000 (15:17 -0400)]
maple_tree: Optimizations on mas_data_end and mas_rev_awalk

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix endif comment
Liam R. Howlett [Fri, 4 Sep 2020 16:18:42 +0000 (12:18 -0400)]
maple_tree: Fix endif comment

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: remove _mas_data_end, only used in a few places
Liam R. Howlett [Fri, 4 Sep 2020 16:12:08 +0000 (12:12 -0400)]
maple_tree: remove _mas_data_end, only used in a few places

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm and fork: Fix mtree_destroy path
Liam R. Howlett [Fri, 4 Sep 2020 15:27:31 +0000 (11:27 -0400)]
mm and fork: Fix mtree_destroy path

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix rcu flag again.
Liam R. Howlett [Fri, 4 Sep 2020 15:26:58 +0000 (11:26 -0400)]
maple_tree: Fix rcu flag again.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Lower efficiency of node use.
Liam R. Howlett [Fri, 4 Sep 2020 01:41:44 +0000 (21:41 -0400)]
maple_tree: Lower efficiency of node use.

Split when there is a slot left to avoid overflow situation on a triple
split.  This is to avoid reworking the node estimate calculations prior
to actually removing the node estimate calculations in favour of
assuming no failures.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agoradix tree test suite: Fix compilation
Matthew Wilcox (Oracle) [Sun, 14 Jun 2020 10:07:10 +0000 (06:07 -0400)]
radix tree test suite: Fix compilation

Introducing local_lock broke compilation; fix it all up and move the
local_lock header to be included alphabetically.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agomaple_tree: Add newlines after functions
Liam R. Howlett [Thu, 3 Sep 2020 00:36:22 +0000 (20:36 -0400)]
maple_tree: Add newlines after functions

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix up after rebase v5.9-rc1 and history.
Liam R. Howlett [Wed, 2 Sep 2020 19:40:56 +0000 (15:40 -0400)]
maple_tree: Fix up after rebase v5.9-rc1 and history.

Rebased maple/mainline_verbose to v5.9-rc1 then to maple3, then
overwrote maple3.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix spanning_store testcases and then the code
Liam R. Howlett [Wed, 2 Sep 2020 17:06:03 +0000 (13:06 -0400)]
maple_tree: Fix spanning_store testcases and then the code

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Revert __mas_next change.
Liam R. Howlett [Tue, 1 Sep 2020 23:46:28 +0000 (19:46 -0400)]
maple_tree: Revert __mas_next change.

Thsi needs to be looked into, it seems mas_next reutrns null until the end of the node
instead of kicking out earlier

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix spanning_rebalance across many nodes with a new root.
Liam R. Howlett [Tue, 1 Sep 2020 19:30:05 +0000 (15:30 -0400)]
maple_tree: Fix spanning_rebalance across many nodes with a new root.

When spanning many nodes and creating a new root at a different level,
the spanning rebalance was not correctly installing the root node.

Also, rework test framework to test the above scenario correctly and add
a test (set41) to do so.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix rcu flag, ma_flags on dup of tree
Liam R. Howlett [Mon, 31 Aug 2020 15:31:17 +0000 (11:31 -0400)]
maple_tree: Fix rcu flag, ma_flags on dup of tree

Also move mas_cnt_positive up and use it elsewhere, set bn->type when spanning_balance has a new root

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agosched/mm and kernel/fork: Add maple tree rcu enable/disable
Liam R. Howlett [Fri, 28 Aug 2020 19:32:05 +0000 (15:32 -0400)]
sched/mm and kernel/fork: Add maple tree rcu enable/disable

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Add in_rcu flag support
Liam R. Howlett [Fri, 28 Aug 2020 19:31:00 +0000 (15:31 -0400)]
maple_tree: Add in_rcu flag support

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Rename flags defines
Liam R. Howlett [Fri, 28 Aug 2020 18:30:51 +0000 (14:30 -0400)]
maple_tree: Rename flags defines

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree; rename mas_get/set_slot to mas_offset
Liam R. Howlett [Fri, 28 Aug 2020 18:23:19 +0000 (14:23 -0400)]
maple_tree; rename mas_get/set_slot to mas_offset

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Compress ma_height into ma_flags
Liam R. Howlett [Fri, 28 Aug 2020 17:54:57 +0000 (13:54 -0400)]
maple_tree: Compress ma_height into ma_flags

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree_test: Add verification of 1000 entry tree node count with rev alloc (top...
Liam R. Howlett [Fri, 28 Aug 2020 16:01:55 +0000 (12:01 -0400)]
maple_tree_test: Add verification of 1000 entry tree node count with rev alloc (top-down)

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Add push right, use memmove for b_node shifting.
Liam R. Howlett [Fri, 28 Aug 2020 15:57:18 +0000 (11:57 -0400)]
maple_tree: Add push right, use memmove for b_node shifting.

Also fix an error on the split calc discovered due to the push right.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix range calc on slot 0 and clean up empty_alloc. add rev_seq test
Liam R. Howlett [Thu, 27 Aug 2020 20:36:39 +0000 (16:36 -0400)]
maple_tree: Fix range calc on slot 0 and clean up empty_alloc. add rev_seq test

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: bulk free fixes
Liam R. Howlett [Wed, 26 Aug 2020 19:09:41 +0000 (15:09 -0400)]
maple_tree: bulk free fixes

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix test from dumping crap
Liam R. Howlett [Wed, 26 Aug 2020 19:02:00 +0000 (15:02 -0400)]
maple_tree: Fix test from dumping crap

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix direct destroy
Liam R. Howlett [Wed, 26 Aug 2020 14:34:48 +0000 (10:34 -0400)]
maple_tree: Fix direct destroy

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agommap stuff
Liam R. Howlett [Wed, 26 Aug 2020 14:34:03 +0000 (10:34 -0400)]
mmap stuff

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agolinux.c stuff
Liam R. Howlett [Wed, 26 Aug 2020 14:29:02 +0000 (10:29 -0400)]
linux.c stuff

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Add non-rcu destroy_walk, rename ma_free to ma_free_rcu
Liam R. Howlett [Tue, 25 Aug 2020 19:46:43 +0000 (15:46 -0400)]
maple_tree: Add non-rcu destroy_walk, rename ma_free to ma_free_rcu

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agoradix-tree testing framework: Add kmem_cache_free_bulk
Liam R. Howlett [Tue, 25 Aug 2020 19:46:16 +0000 (15:46 -0400)]
radix-tree testing framework: Add kmem_cache_free_bulk

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Alloc at most 1 page of nodes during fork.
Liam R. Howlett [Tue, 25 Aug 2020 17:56:13 +0000 (13:56 -0400)]
maple_tree: Alloc at most 1 page of nodes during fork.

Also fix a corner case of root + children being 17 and thus failing out during a fork

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix dup tree walk up and add more testcases.
Liam R. Howlett [Mon, 24 Aug 2020 19:22:20 +0000 (15:22 -0400)]
maple_tree: Fix dup tree walk up and add more testcases.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agofork: Now with dup tree
Liam R. Howlett [Mon, 24 Aug 2020 16:22:27 +0000 (12:22 -0400)]
fork: Now with dup tree

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Add dup function and testing
Liam R. Howlett [Mon, 24 Aug 2020 16:22:12 +0000 (12:22 -0400)]
maple_tree: Add dup function and testing

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: remove extra mt_dump calls from test code
Liam R. Howlett [Tue, 18 Aug 2020 01:10:42 +0000 (21:10 -0400)]
maple_tree: remove extra mt_dump calls from test code

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix append to work with allocation tree.
Liam R. Howlett [Mon, 17 Aug 2020 19:26:15 +0000 (15:26 -0400)]
maple_tree: Fix append to work with allocation tree.

Append wasn't happening with allocation tree due to the ZERO entry being
added.  Stop addign the zero entry, it should be in the mm code anyways.

Also, add gap support when appending.

Also, fix parent pointer assignment on push_left operations.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: remove debug
Liam R. Howlett [Thu, 13 Aug 2020 16:58:09 +0000 (12:58 -0400)]
maple_tree: remove debug

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix mas_awalk gap issues
Liam R. Howlett [Thu, 13 Aug 2020 16:29:42 +0000 (12:29 -0400)]
maple_tree: Fix mas_awalk gap issues

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: compress to left
Liam R. Howlett [Thu, 13 Aug 2020 00:29:39 +0000 (20:29 -0400)]
maple_tree: compress to left

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: refactor mas_split data splitting
Liam R. Howlett [Thu, 13 Aug 2020 00:25:00 +0000 (20:25 -0400)]
maple_tree: refactor mas_split data splitting

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: start pushing left for leaves
Liam R. Howlett [Wed, 12 Aug 2020 18:11:49 +0000 (14:11 -0400)]
maple_tree: start pushing left for leaves

Also, remove dup code

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Add 256Byte nodes and make them default.
Liam R. Howlett [Tue, 11 Aug 2020 16:44:11 +0000 (12:44 -0400)]
maple_tree: Add 256Byte nodes and make them default.

This code adds a define to decide which node size: 128 or 256.  Defaults
to 256.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Make allocations node size agnostic
Liam R. Howlett [Fri, 7 Aug 2020 18:29:45 +0000 (14:29 -0400)]
maple_tree: Make allocations node size agnostic

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix trace test code
Liam R. Howlett [Fri, 7 Aug 2020 18:29:20 +0000 (14:29 -0400)]
maple_tree: Fix trace test code

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix compile warning
Liam R. Howlett [Fri, 7 Aug 2020 12:28:35 +0000 (08:28 -0400)]
maple_tree: Fix compile warning

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix trace header
Liam R. Howlett [Fri, 7 Aug 2020 12:05:40 +0000 (08:05 -0400)]
maple_tree: Fix trace header

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix tracing order
Liam R. Howlett [Fri, 7 Aug 2020 11:59:31 +0000 (07:59 -0400)]
maple_tree: Fix tracing order

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agommap: Rework tracing
Liam R. Howlett [Fri, 7 Aug 2020 11:57:15 +0000 (07:57 -0400)]
mmap: Rework tracing

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agotboot remove rb
Liam R. Howlett [Fri, 7 Aug 2020 10:34:58 +0000 (06:34 -0400)]
tboot remove rb

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agotboot add mt
Liam R. Howlett [Fri, 7 Aug 2020 10:34:42 +0000 (06:34 -0400)]
tboot add mt

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple: Fix tracepoints
Liam R. Howlett [Fri, 7 Aug 2020 00:29:12 +0000 (20:29 -0400)]
maple: Fix tracepoints

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agoradix tree: enhancements for maple_tree tracepoints
Liam R. Howlett [Fri, 7 Aug 2020 00:20:12 +0000 (20:20 -0400)]
radix tree: enhancements for maple_tree tracepoints

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Change ordering of pivots and slots, as well as gaps in one
Liam R. Howlett [Fri, 7 Aug 2020 00:18:14 +0000 (20:18 -0400)]
maple_tree: Change ordering of pivots and slots, as well as gaps in one
case.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap.c: Fix includes for tracepoints
Liam R. Howlett [Fri, 7 Aug 2020 00:17:45 +0000 (20:17 -0400)]
mm/mmap.c: Fix includes for tracepoints

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Add tracepoints, remove SLAB_RECLAIM
Liam R. Howlett [Fri, 7 Aug 2020 00:17:30 +0000 (20:17 -0400)]
maple_tree: Add tracepoints, remove SLAB_RECLAIM

Also reorder setting of slot in mas_Descend_adopt and fix comment for smp_wmb

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Clean up splitting name and add exception to validate
Liam R. Howlett [Tue, 4 Aug 2020 14:28:59 +0000 (10:28 -0400)]
maple_tree: Clean up splitting name and add exception to validate

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix splitting causing deficient nodes.
Liam R. Howlett [Tue, 4 Aug 2020 14:15:41 +0000 (10:15 -0400)]
maple_tree: Fix splitting causing deficient nodes.

When splitting a node, ensure a deficient node is not created when a
NULL in encountered at the split.  Also adjust the checking of the limit
when incrementing to ensure both the min and the number on the right are
zero based.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix overflow on store and 3 way splits
Liam R. Howlett [Mon, 3 Aug 2020 00:30:01 +0000 (20:30 -0400)]
maple_tree: Fix overflow on store and 3 way splits

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Zero maple tree area in a single set when detatching
Liam R. Howlett [Mon, 3 Aug 2020 00:27:36 +0000 (20:27 -0400)]
mm/mmap: Zero maple tree area in a single set when detatching

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agofork: Whitespace
Liam R. Howlett [Mon, 27 Jul 2020 23:15:10 +0000 (19:15 -0400)]
fork: Whitespace

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Drop mas.node check.
Liam R. Howlett [Mon, 27 Jul 2020 23:03:11 +0000 (19:03 -0400)]
mm/mmap: Drop mas.node check.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Remove possibility of having mas->node null
Liam R. Howlett [Mon, 27 Jul 2020 23:02:13 +0000 (19:02 -0400)]
maple_tree: Remove possibility of having mas->node null

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agommap: rename unmapped to empty, change comemnts
Liam R. Howlett [Mon, 27 Jul 2020 19:34:58 +0000 (15:34 -0400)]
mmap: rename unmapped to empty, change comemnts

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm: Remove rb tree.
Liam R. Howlett [Fri, 24 Jul 2020 19:06:25 +0000 (15:06 -0400)]
mm: Remove rb tree.

Remove the RB tree and start using the maple tree for vm_area_struct
tracking.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agokernel/fork: Convert dup_mmap to use maple tree
Liam R. Howlett [Fri, 24 Jul 2020 17:32:30 +0000 (13:32 -0400)]
kernel/fork: Convert dup_mmap to use maple tree

Use the maple tree iterator to duplicate the mm_struct trees.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Change unmapped_area and unmapped_area_topdown to use maple
Liam R. Howlett [Fri, 24 Jul 2020 16:01:47 +0000 (12:01 -0400)]
mm/mmap: Change unmapped_area and unmapped_area_topdown to use maple
tree

Use the new maple tree data structure to find an unmapped area.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Change find_vma_prev() to use maple tree
Liam R. Howlett [Fri, 24 Jul 2020 15:48:08 +0000 (11:48 -0400)]
mm/mmap: Change find_vma_prev() to use maple tree

Change the implementation of find_vma_prev to use the new maple tree
data structure.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Change find_vma() to use the maple tree
Liam R. Howlett [Fri, 24 Jul 2020 15:38:39 +0000 (11:38 -0400)]
mm/mmap: Change find_vma() to use the maple tree

Start using the maple tree to find VMA entries in an mm_struct.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm: Start tracking VMAs with maple tree
Liam R. Howlett [Fri, 24 Jul 2020 17:04:30 +0000 (13:04 -0400)]
mm: Start tracking VMAs with maple tree

Start tracking the VMAs with the new maple tree structure in parallel
with the rb_tree.  Add debug and trace events for maple tree operations
and duplicate the rb_tree that is created on forks into the maple tree.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Fix crash on spanning rebalance all the way to root.
Liam R. Howlett [Tue, 4 Aug 2020 19:40:32 +0000 (15:40 -0400)]
maple_tree: Fix crash on spanning rebalance all the way to root.

It is possible to have a spanning rebalance that causes 3 new nodes per
level and a new level added in a new root node.  This means that
allocations need to be 3 * height + 1, and this situation needs to be
detected so that dead root isn't attempted to ascend looking for more
data to merge in.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agoradix tree test suite: Add support for fallthrough attribute
Liam R. Howlett [Mon, 27 Jul 2020 19:28:58 +0000 (15:28 -0400)]
radix tree test suite: Add support for fallthrough attribute

Add support for fallthrough on case statements.  Note this does *NOT*
check for missing fallthrough, but does allow compiling of code with
fallthrough in case statements.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Update unmapped area name, remove mas->node == NULL
Liam R. Howlett [Tue, 4 Aug 2020 17:25:36 +0000 (13:25 -0400)]
maple_tree: Update unmapped area name, remove mas->node == NULL
possibility, 3 way split fixes, overflow slot fix, calc split fix,
altered descend adopt algorithm.

Many changes.

1. unmapped area => empty area
2. mas->node can no longer be null
3. splitting into 3 nodes can occur at non-leaf nodes.
4. calc split could potentially create an overflow or a deficient node.
5. drop Private from comments
6. comment fixes
7. rename combine_separate to mas_spanning_rebalance

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agotest_maple_tree: Re-enable failed test from allocation issue
Liam R. Howlett [Mon, 20 Jul 2020 16:46:19 +0000 (12:46 -0400)]
test_maple_tree: Re-enable failed test from allocation issue

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomm/mmap: Disable maple_tree_verbose and remove mas_retry
Liam R. Howlett [Sat, 18 Jul 2020 01:58:02 +0000 (21:58 -0400)]
mm/mmap: Disable maple_tree_verbose and remove mas_retry

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: rework mas_awalk
Liam R. Howlett [Sat, 18 Jul 2020 01:51:47 +0000 (21:51 -0400)]
maple_tree: rework mas_awalk

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: rev_awalk i->slot and this_gap -> gap
Liam R. Howlett [Sat, 18 Jul 2020 01:11:59 +0000 (21:11 -0400)]
maple_tree: rev_awalk i->slot and this_gap -> gap

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: change rev_awalk to more common code
Liam R. Howlett [Sat, 18 Jul 2020 01:09:52 +0000 (21:09 -0400)]
maple_tree: change rev_awalk to more common code

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: change rev_awalk since there are no delete or skips, etc
Liam R. Howlett [Sat, 18 Jul 2020 00:57:16 +0000 (20:57 -0400)]
maple_tree: change rev_awalk since there are no delete or skips, etc

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: Add helper for lower bound
Liam R. Howlett [Sat, 18 Jul 2020 00:46:38 +0000 (20:46 -0400)]
maple_tree: Add helper for lower bound

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
4 years agomaple_tree: awalk reduce again.
Liam R. Howlett [Sat, 18 Jul 2020 00:28:49 +0000 (20:28 -0400)]
maple_tree: awalk reduce again.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>