Age | Commit message (Collapse) | Author |
|
with keys containing off-heap terms.
The passed key may actually be the one already saved
(if nodes have been joined), in which case we do nothing.
Calling destroy_route_key() may destroy off-heap data.
|
|
We no longer lock more than one base node at a time.
We do however trylock a second base node at join.
|
|
for different lock instances.
|
|
|
|
The original implementation did not do this due to fear of bad
performance. But we think the negative effect of "leaking" empty
base nodes is more important to fix.
To get the bad performance a special kind of access patterns is
needed where base nodes are frequently emptied and then repopulated
soon again. ets_SUITE:throughput_benchmark for example did not show
any negative effect from this commit at all.
|
|
|
|
Easier to read and debug, and about the same lines of code.
|
|
It's possible to first find an empty base node
and then retry and find the same base node as invalid.
It's a benign race with join which first makes the old invalid
'neighbor' accessible from 'gparent' before replacing it with
'new_neighbor'.
|
|
|
|
|
|
to actually pass the copy to lock checker.
|
|
Once an iteration key has been found, never fall back to first/last key in
next/prev tree as trees may split or join under our feet. I.e we must always
use previous key when searching for the next key.
|
|
to not have to backtrack up on the stack.
|
|
to easier generate a routing tree for test
without having to spend cpu to provoke actual repeated lock conflicts.
|
|
{RouteNodes, BaseNodes, MaxRouteTreeDepth}
|
|
|
|
|
|
Brute force solution will always iterate tree from slot 0 and forward.
ToDo1: Yield.
ToDo2: Maybe optimize by caching AVL tree size in each base node.
|
|
|
|
|
|
DbTableCATree has no static stack.
|
|
Move lookup from analyze_pattern to callers.
|
|
|
|
|
|
|
|
f4f409ff28185b3308359ca5ca91921bc51f536f
|
|
# Conflicts:
# erts/emulator/beam/erl_db_tree.c
|
|
* sverker/erts/ets-select_replace-bug/OTP-15346:
erts: Fix bug in ets:select_replace for bound key
|
|
which may cause following calls to ets:next or ets:prev to fail.
|
|
* origin/sverker/erts/freeing-ordered_set-nodes/OTP-15323:
erts: Refactor out DbRouteKey struct
erts: Remove dead code in erl_db_catree
erts: Fix bug in erl_db_catree
erts: Remove "dynamic" lock order support
erts: Add lock order check for route nodes
erts: Add lock order check of erl_db_catree base nodes
erts: Add Erlang term order to lock checker
erts: Add some ERTS_RESTRICT pointers
erts: Do some refactoring in erl_db_catree.c
erts: Improve deallocation of CATree nodes
erts: Refactor rename union in DbTableCATreeNode
erts: Fix compiler warning in erl_bif_binary.c
|
|
Use os:getenv/2 where possible
|
|
|
|
Document bit_size in match-specs and allow in fun2ms
|
|
to not abuse DbTerm.
|
|
'parent' is route node and 'neighbor' is base node,
they can never be equal.
'neighbor_parent' has already been set correctly for all cases.
|
|
Search stack must be cleared before retry.
|
|
|
|
Lock order is reverse tree depth, from leafs toward root.
This solution may eventually fail if running too long
as route nodes do not increase their 'lc_order' in a join operation
when they move up in the tree.
But who runs a VM with lock-checker for such a long time?
|
|
Lock order is key term order, so each base node needs its own key
if lock check is enabled.
|
|
|
|
|
|
Fewer variables with shorter names
and prefer DbTableCATree over DbTableCommon.
|
|
Update table memory stats before scheduling free
to not be dependent on deallocation order with main table struct.
|
|
u as in union
|
|
|
|
|
|
|
|
* richcarl/erts/erl_init-cleanup/OTP-15336:
sasl: Order systools_make:preloaded modules alphabetically
Update preloaded modules
Move calling on_load for preloaded modules to erl_init
Make erl_init.c pass the boot module to erl_init.beam
Remove obsolete comment text
Remove undocumented and unused -# display_items emulator option
Remove broken and undocumented boot function emulator option
Replace remaining references to otp_ring0 with erl_init
Drop otp_ring0, using erl_init instead
Update preloaded modules
Add erl_init module
Conflicts:
erts/emulator/beam/erl_init.c
erts/preloaded/ebin/erl_prim_loader.beam
erts/preloaded/ebin/erl_tracer.beam
erts/preloaded/ebin/erlang.beam
erts/preloaded/ebin/erts_code_purger.beam
erts/preloaded/ebin/erts_dirty_process_signal_handler.beam
erts/preloaded/ebin/erts_internal.beam
erts/preloaded/ebin/erts_literal_area_collector.beam
erts/preloaded/ebin/init.beam
erts/preloaded/ebin/otp_ring0.beam
erts/preloaded/ebin/prim_buffer.beam
erts/preloaded/ebin/prim_eval.beam
erts/preloaded/ebin/prim_file.beam
erts/preloaded/ebin/prim_inet.beam
erts/preloaded/ebin/prim_zip.beam
erts/preloaded/ebin/zlib.beam
|
|
* sverker/erts/cleanup-efile-argc-checks:
erts: Remove unnecessary NIF argc tests
|
|
Rewrite BSM optimizations in the new SSA-based intermediate format
|