aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_node_tables.c
AgeCommit message (Collapse)Author
2019-07-22Fix node refc test for free processes hanging aroundRickard Green
2019-07-22Enhanced node refc bookkeepingRickard Green
2019-07-22Fix node container refc tests of ETSRickard Green
2019-07-22Fix node refc test of external dataRickard Green
2019-07-22Merge branch 'rickard/node-refc-tests-21' into rickard/node-refc-tests-22Rickard Green
* rickard/node-refc-tests-21: Node container refc test for persistent terms Include persistent term storage in node/dist refc check Fix node refc test for system message queue
2019-07-22Include persistent term storage in node/dist refc checkRickard Green
2019-07-22Merge branch 'rickard/node-refc-tests-20' into rickard/node-refc-tests-21Rickard Green
* rickard/node-refc-tests-20: Fix node refc test for system message queue
2019-07-22Fix node refc test for system message queueRickard Green
2019-04-11Merge branch 'sverker/node-table-cmp-0-creation-fix'Sverker Eriksson
* sverker/node-table-cmp-0-creation-fix: erts: Revert creation 0 as wildcard in node_table_cmp
2019-04-10erts: Revert creation 0 as wildcard in node_table_cmpSverker Eriksson
This is a partial revert of bf7c722bd3b30e04a56c2d369fd9f5501a8316d0. It does not make sense to treat 0 as a wild card in cmp function for the hash table as creation is part of the hash calculation.
2019-04-09Revert "epmd: Support 32-bit creation values in local node"Sverker Eriksson
This reverts commit bd8f6106d44a58c261920eef72842bb3bc5a4968. PLUS a little change in epmd_srv.c:750 ("4" -> "replylen") that was part of e2cf4a8a4b03b9f430ba228276c3b2629159e832 by mistake.
2019-03-25erts: Fix faulty assert in reference_table_termLukas Larsson
2019-03-22Merge branch 'sverker/enable-big-creation/OTP-15603'Sverker Eriksson
* sverker/enable-big-creation/OTP-15603: epmd: Support 32-bit creation values in local node erts: Robustify epmd reply function erts: Reject decoded local refs with too large first word erts: Fix bug in list_to_ref erl_interface: Remove old encoding of pid,port,refs erts: Remove old encoding of pids, ports and refs erts: Make DFLAG_BIG_CREATION mandatory
2019-03-22epmd: Support 32-bit creation values in local nodeSverker Eriksson
* Increase distribution version from 5 to 6 * Introduce new ALIVE2_X_RESP with 32-bit creation as reply to ALIVE2_REQ when sender dist version >= 6 * Still reply old ALIVE2_RESP with tiny creation 1..3 if sender dist version < 6.
2019-03-19Add possibility to also get size of data from erlang:dist_ctrl_get_data()Rickard Green
2019-02-22erts: Fix so that externals with creation 0 compare equal to allLukas Larsson
The special creation of 0 is used by internally created externals, such as when list_to_pid is called. This creation should compare equal to all externals creations of that external. If it does not we can end up in very strange scenarios. For instance: > P = spawn(OtherNode, fun() -> die end). <8303.60.0> > link(<8303.60.0>). true > flush(). ok OTP-15613
2019-02-22erts: Implement trapping while sending distr exit/downLukas Larsson
The reason in EXIT and DOWN may be arbitrarily large, so we yield and allow other processes to execute while encoding and sending the signals over the distribution.
2019-02-22erts: Add ERL_NODE_BOOKKEEP to node tables refcLukas Larsson
2019-02-22erts: Refactor ErtsSendContext to be ErtsDSigSendContextLukas Larsson
This commit removed the general send context (which was used very little anyways) and only uses the distributed send context. This will make it easier to use the dist API at the cost of a little bit more code for the local send.
2019-02-22erts: Implement fragmentation of distrubution messagesLukas Larsson
2019-02-05erts: Refactor rbt _yielding to use reductionsLukas Larsson
All of the Red-Black Tree _yielding functions have been updated to work with reductions returned by the called function instead of yielding on each element.
2018-11-26erts: fix attempt to start timer when executing on dirty schedulerMaxim Fedorov
Since OTP R20, there is a possibility for MAJOR garbage collection to run on dirty scheduler. So DistEntry destructor is being called on dirty scheduler as well. This, in turn, leads to an attempt to schedule timer on a dirty scheduler too, which is impossible (and will assert on debug build, but does succeed for release build, creating an infinite busy loop, since aux work wakes scheduler up, but dirty scheduler cannot execute aus work). There is a similar method in erl_hl_timer, see erts_start_timer_callback.
2018-09-18Merge 'sverker/erts/fix-aborted-pending-connection-race/OTP-15296'Sverker Eriksson
2018-09-18erts: Refactor port dist_entry & conn_id into PRTSDSverker Eriksson
spelled out as "port specific data".
2018-09-18Consolidate distribution entry state transitionsSverker Eriksson
* Make connection_id part of the distribution handle as {ConnId, DistEntry} in order for BIFs to verify correct connection. * Make distribution handle opaque to net_kernel. * Remove some unsafe lockless reads of DistEntry.flags * Change state ERTS_DE_STATE_EXITING to be more of an internal state that prevents erts from enqueue, encode or schedule new data to be sent. Otherwise it should behave like ERTS_DE_STATE_CONNECTED.
2018-09-11erts: Fix "Prevent inconsistent node lists" fixSverker Eriksson
done in a31216200bdee2c04b3fb3ae5e26607674715c8a that could cause a new pending connection to be incorrectly aborted.
2018-09-05Prevent inconsistent node listsRickard Green
If net_kernel "forgets" to abort a connection (as it currently might), the garbage collection of a distribution entry could cause node lists to enter an inconsistent state.
2018-03-22Fix lock countingRickard Green
2018-03-21Implementation of true asynchronous signaling between processesRickard Green
Communication between Erlang processes has conceptually always been performed through asynchronous signaling. The runtime system implementation has however previously preformed most operation synchronously. In a system with only one true thread of execution, this is not problematic (often the opposite). In a system with multiple threads of execution (as current runtime system implementation with SMP support) it becomes problematic. This since it often involves locking of structures when updating them which in turn cause resource contention. Utilizing true asynchronous communication often avoids these resource contention issues. The case that triggered this change was contention on the link lock due to frequent updates of the monitor trees during communication with a frequently used server. The signal order delivery guarantees of the language makes it hard to change the implementation of only some signals to use true asynchronous signaling. Therefore the implementations of (almost) all signals have been changed. Currently the following signals have been implemented as true asynchronous signals: - Message signals - Exit signals - Monitor signals - Demonitor signals - Monitor triggered signals (DOWN, CHANGE, etc) - Link signals - Unlink signals - Group leader signals All of the above already defined as asynchronous signals in the language. The implementation of messages signals was quite asynchronous to begin with, but had quite strict delivery constraints due to the ordering guarantees of signals between a pair of processes. The previously used message queue partitioned into two halves has been replaced by a more general signal queue partitioned into three parts that service all kinds of signals. More details regarding the signal queue can be found in comments in the erl_proc_sig_queue.h file. The monitor and link implementations have also been completely replaced in order to fit the new asynchronous signaling implementation as good as possible. More details regarding the new monitor and link implementations can be found in the erl_monitor_link.h file.
2018-03-02erts: Postpone idle DistEntry until abort is completedSverker Eriksson
2018-03-02erts: Refactor DistEntry.status flags into a stateSverker Eriksson
Just to simplify and get 4 distinctive states IDLE, PENDING, CONNECTED and EXITING. The old possible flag combos were: 0 PENDING CONNECTED CONNECTED|EXITING EXITING The two EXITING states did not serve any purpose other then as a slight optimization in monitor_node(_,false,_) to shortcut EXITING when there can be no monitors.
2018-03-02erts,kernel: Add erts_internal:get_dflags/0Sverker Eriksson
for kernel to ask erts about distribution flags and keep this info in one place.
2017-11-15erts: Put pending DistrEntry in separate listSverker Eriksson
2017-11-15erts: Keep magic ref to DistEntry in net_kernelSverker Eriksson
to make sure it's kept alive.
2017-11-15Allow DistEntries in ETSSverker Eriksson
2017-11-15erts: Transcode tuple fallbacksSverker Eriksson
When finalizing outgoing distribution messages we transcode them into using tuple fallbacks if the receiver does not support bitstrings and export-funs. This can only happen if the message was first encoded toward a pending connection when the receiver was unknown. It's an optimistic approach optmimized for modern beam nodes, that expect real bitstrings and funs (since <R13). Only erl_interface/jinterface lack this support.
2017-11-15Add optimistic DFLAG_DIST_HOPEFULLY for pending connectionsSverker Eriksson
to avoid tuple fallbacks for export funs and bitstrings. ToDo: Re-encode if receiver turn out to be erl_interface/jinterface.
2017-11-15erts: Introduce asynchronous auto-connectSverker Eriksson
2017-11-15erts TEST: Add missing ref to DistEntry from send contextSverker Eriksson
2017-11-15erts: Fix bug in DistEntry refc danceSverker Eriksson
to handle "lookup without refc++" correctly which was introduced in 4dcb2ae7810a507b701a30072b2f514cab7ebbdb. When decrementing refc to zero (in try_delete or prepare_try_delete) we must always wait thread progress to make sure no thread has done lookup without refc++ and is just about to do refc++ and thereby revive the DistEntry. That is, we wait for a potential other thread to either do refc++ or drop its pointer to the DistEntry. And if that other thread does refc++ (in erts_ref_dist_entry) it must also do the extra refc++ for the scheduled pending delete.
2017-08-28Merge branch 'rickard/dist/OTP-14459' into rickard/dist/master/OTP-14459Rickard Green
Conflicts: erts/emulator/beam/bif.c erts/emulator/beam/dist.c erts/emulator/beam/dist.h erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_node_tables.c erts/emulator/beam/erl_node_tables.h erts/emulator/beam/external.c
2017-08-28Optimize dist entry managementRickard Green
2017-08-28Support for distribution controller processesRickard Green
2017-07-17erts: Replace usage of all erts_smp prefixes to just ertsLukas Larsson
2017-07-17erts: Remove ERTS_SMP and USE_THREAD definesLukas Larsson
This refactor was done using the unifdef tool like this: for file in $(find erts/ -name *.[ch]); do unifdef -t -f defile -o $file $file; done where defile contained: #define ERTS_SMP 1 #define USE_THREADS 1 #define DDLL_SMP 1 #define ERTS_HAVE_SMP_EMU 1 #define SMP 1 #define ERL_BITS_REENTRANT 1 #define ERTS_USE_ASYNC_READY_Q 1 #define FDBLOCK 1 #undef ERTS_POLL_NEED_ASYNC_INTERRUPT_SUPPORT #define ERTS_POLL_ASYNC_INTERRUPT_SUPPORT 0 #define ERTS_POLL_USE_WAKEUP_PIPE 1 #define ERTS_POLL_USE_UPDATE_REQUESTS_QUEUE 1 #undef ERTS_HAVE_PLAIN_EMU #undef ERTS_SIGNAL_STATE
2017-07-06Allow toggling lock counting at runtimeJohn Högberg
The implementation is still hidden behind ERTS_ENABLE_LOCK_COUNT, and all categories are still enabled by default, but the actual counting can be toggled at will. OTP-13170
2017-07-04Change some dist-entry typesRickard Green
2017-05-04Update copyright yearRaimo Niskanen
2017-03-22Fix node_container_SUITERickard Green
2017-02-20Merge branch 'master' into sverker/enif_selectSverker Eriksson
Conflicts: erts/emulator/beam/erl_binary.h erts/emulator/beam/erl_monitors.c erts/emulator/beam/erl_nif.c erts/emulator/beam/global.h erts/emulator/test/nif_SUITE_data/nif_SUITE.c