aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_message.c
AgeCommit message (Collapse)Author
2019-06-19erts: Move copy of payload to receiving processLukas Larsson
2019-04-18erts: Fix cleanup of message factory undoLukas Larsson
2019-03-25erts: erts_factory_proc_init should not set hole markerLukas Larsson
Setting the hole marker in debug on the entire heap is very slow so instead we do it in erts_produce_heap.
2019-03-06Merge branch 'rickard/send-bump-reds/ERL-773/OTP-15513'Rickard Green
* rickard/send-bump-reds/ERL-773/OTP-15513: Fix faulty assertion Bump reductions on send based on message size
2019-02-26Bump reductions on send based on message sizeRickard Green
2019-02-22erts: Add ERL_NODE_BOOKKEEP to node tables refcLukas Larsson
2019-02-22erts: Implement fragmentation of distrubution messagesLukas Larsson
2019-02-21erts: Move reason in dist messages to payloadLukas Larsson
The dist messages EXIT, EXIT2 and MONITOR_DOWN have been updated with new versions that send the reason term as part of the payload of the message instead of as part of the control message. This allows the decode of the reason to be done by the receiving process instead of the dist entry which in turn makes it possible for multiple decodes to be done in parallel. This change is done in order to make it easier to fragment the potentially large payload of EXIT, EXIT2 and MONITOR_DOWN into multiple distribution messages. OTP-15611
2018-12-20erts: Add ERL_NIF_SELECT_CUSTOM_MSGSverker Eriksson
2018-08-03erts: Fix seq_trace to not clear token for system messagesLukas Larsson
A lot of erts internal messages used behind APIs to create non-blocking calls, e.g. port_command, would cause the seq_trace token to be cleared from the caller when it should not. This commit fixes that and adds asserts that makes sure that all messages sent have to correct token set. Fixes: ERL-602
2018-05-15erts: Fix bug when scheduling monitor-msg comboSverker Eriksson
Bug introduced in master by 613cde66c25464121f2f6dace99782bad0e07d9b
2018-04-26erts: Optimize monitor signal by message piggybackSverker Eriksson
If no message/signal is sent (to same destination) then monitor signal is flushed when process is scheduled out.
2018-04-26Merge branch 'rickard/process_info/OTP-14966'Rickard Green
* rickard/process_info/OTP-14966: Restore merge of signal queues in queue_messages() if main lock is held Fix message tracing
2018-04-25Restore merge of signal queues in queue_messages() if main lock is heldRickard Green
2018-04-13Merge branch 'rickard/process_info/OTP-14966'Rickard Green
* rickard/process_info/OTP-14966: New process_info() implementation using signals
2018-04-13Merge branch 'rickard/signals/OTP-14589'Rickard Green
* rickard/signals/OTP-14589: Fix VM probes compilation Conflicts: erts/emulator/beam/erl_message.c
2018-04-12New process_info() implementation using signalsRickard Green
2018-04-11Fix VM probes compilationRickard Green
2018-03-27Merge pull request #1760 from ↵John Högberg
jhogberg/john/erts/any-term-as-seq_trace-label/OTP-14899 Lift the type restrictions on seq_trace token labels
2018-03-23Fix VM probes compilationJohn Högberg
2018-03-23Lift the type restrictions on seq_trace token labelsJohn Högberg
OTP-14899
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-05Remove ERTS_PSFLG_ON_HEAP_MSGQRickard Green
2017-10-02Merge branch 'maint'Sverker Eriksson
2017-10-02Merge branch 'sverker/bad-dist-msg-bug/ERIERL-80/OTP-14661' into maintSverker Eriksson
2017-10-02erts: Fix bug when detecting bad dist messageSverker Eriksson
We can't just leave it in queue with dist_ext=NULL. Two symptoms seen: 1. 'receive' trying to deref dist_ext as NULL. 2. GC think it's a term and put THE_NON_VALUE in root set.
2017-07-17erts: Replace usage of all erts_smp prefixes to just ertsLukas Larsson
2017-07-17erts: Cleanup removal of non-smp emulatorsLukas 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-05-04Update copyright yearRaimo Niskanen
2017-04-11erts: Introduce erts_bin_releaseSverker Eriksson
2017-03-10Update copyright yearRickard Green
2017-02-06Implement magic referencesRickard Green
Magic references are *intentionally* indistinguishable from ordinary references for the Erlang software. Magic references do not change the language, and are intended as a pure runtime internal optimization. An ordinary reference is typically used as a key in some table. A magic reference has a direct pointer to a reference counted magic binary. This makes it possible to implement various things without having to do lookups in a table, but instead access the data directly. Besides very fast lookups this can also improve scalability by removing a potentially contended table. A couple of examples of planned future usage of magic references are ETS table identifiers, and BIF timer identifiers. Besides future optimizations using magic references it should also be possible to replace the exposed magic binary cludge with magic references. That is, magic binaries that are exposed as empty binaries to the Erlang software.
2017-02-06Merge branch 'maint'Rickard Green
* maint: Atomic reference count of binaries also in non-SMP Conflicts: erts/emulator/beam/erl_fun.c
2017-02-06Merge branch 'rickard/binary-refc' into maintRickard Green
OTP-14202 * rickard/binary-refc: Atomic reference count of binaries also in non-SMP Conflicts: erts/emulator/beam/beam_bp.c
2017-02-06Atomic reference count of binaries also in non-SMPRickard Green
NIF resources was not handled in a thread-safe manner in the runtime system without SMP support. As a consequence of this fix, the following driver functions are now thread-safe also in the runtime system without SMP support: - driver_free_binary() - driver_realloc_binary() - driver_binary_get_refc() - driver_binary_inc_refc() - driver_binary_dec_refc()
2017-01-23Merge branch 'sverker/ASSERT_IN_ENV'Sverker Eriksson
* sverker/ASSERT_IN_ENV: erts: Add macro ERTS_PROC_LOCKS_HIGHER_THAN erts: Cleanup and extra assertions in nif_SUITE.c erts: Cleanup enif_make_reverse_list erts: Add assertions for correct ErlNifEnv erts: Make erts_dbg_within_proc available # Conflicts: # erts/emulator/beam/erl_gc.h
2017-01-12erts: Add macro ERTS_PROC_LOCKS_HIGHER_THANSverker Eriksson
to safeguard against bugs due to future proc lock changes. The two places now using ERTS_PROC_LOCKS_HIGHER_THAN were kind of bugs as BTM and TRACE locks were missing. But there was probably no way to get there with BTM or TRACE locked.
2017-01-11Merge branch 'maint'Rickard Green
* maint: Fix issues with abandoned heap Conflicts: erts/emulator/beam/beam_bif_load.c
2017-01-10Fix issues with abandoned heapRickard Green
2016-08-31Merge branch 'maint'Rickard Green
* maint: Ensure correct mbuf_sz value in process structure
2016-08-30Ensure correct mbuf_sz value in process structureRickard Green
2016-08-01erts: Refactor literal purge area argumentsBjörn-Egil Dahlberg
2016-08-01erts: Remove the need for copying of literalsBjörn-Egil Dahlberg
* Literals are not copied between processes for messages or spawn Increases performance of message sent and processes spawned when literals are involved in messages or arguments.
2016-07-14hipe: Remove performance profiling codeLukas Larsson
This type of statistics is now available through the microstate accounting API.
2016-05-31Fix bad assertionRickard Green
2016-05-31Properly close message factories in erts_factory_trim_and_close()Rickard Green
2016-05-27Merge branch 'rickard/on_heap-fix/OTP-13366'Rickard Green
* rickard/on_heap-fix/OTP-13366: Improve message allocation in enif_send() Fix message queue update on replacement and removal of message
2016-05-26Fix message queue update on replacement and removal of messageRickard Green
2016-05-25Remove the 'message_queue_data' option 'mixed'Rickard Green