aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/ebin/erts_internal.beam
AgeCommit message (Collapse)Author
2018-06-18Update preloaded modulesHenrik Nord
2018-05-16Replace previous suspend in setnode/3Rickard Green
2018-05-16New process suspend implementation based on async signalingRickard Green
2018-04-25Update preloaded modulesBjörn Gustavsson
2018-04-23erts: Rewrite memory instrumentationJohn Högberg
This commit replaces the old memory instrumentation with a new implementation that scans carriers instead of wrapping erts_alloc/erts_free. The old implementation could not extract information without halting the emulator, had considerable runtime overhead, and the memory maps it produced were noisy and lacked critical information. Since the new implementation walks through existing data structures there's no longer a need to start the emulator with special flags to get information about carrier utilization/fragmentation. Memory fragmentation is also easier to diagnose as it's presented on a per-carrier basis which eliminates the need to account for "holes" between mmap segments. To help track allocations, each allocation can now be tagged with what it is and who allocated it at the cost of one extra word per allocation. This is controlled on a per-allocator basis with the +M<S>atags option, and is enabled by default for binary_alloc and driver_alloc (which is also used by NIFs).
2018-03-22Fix signal order for is_process_aliveRickard 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,kernel: Add dist_util:strict_order_flags/0Sverker Eriksson
to replace DFLAGS_STRICT_ORDER_DELIVERY and remove that compile time dependency.
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-12-19Redirect system_flag(scheduler_wall_time,_) to kernel_refcRickard Green
2017-11-20Merge branch 'lukas/stdlib/maps_iterators/OTP-14012'Lukas Larsson
* lukas/stdlib/maps_iterators/OTP-14012: erts: Limit size of first iterator for hashmaps Update primary bootstrap Update preloaded modules erts: Remove erts_internal:maps_to_list/2 stdlib: Make io_lib and io_lib_pretty use maps iterator erts: Implement batching maps:iterator erts: Implement maps path iterator erts: Implement map iterator using a stack stdlib: Introduce maps iterator API Conflicts: bootstrap/lib/stdlib/ebin/io_lib.beam bootstrap/lib/stdlib/ebin/io_lib_pretty.beam erts/emulator/beam/bif.tab erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/erts_internal.beam erts/preloaded/ebin/zlib.beam
2017-11-20Update preloaded modulesLukas Larsson
2017-11-20erts: Remove erts_internal:maps_to_list/2Lukas Larsson
This function is no longer needed as maps:iterator has now been implemented.
2017-11-20erts: Implement batching maps:iteratorLukas Larsson
This iterator implementation fetches multiple elements to iterate over in one call to erts_internal:maps_next instead of one at a time. This means that the memory usage will go up for the iterator as we are buffering elements, but the usage is still bounded. In this implementation the max memory usage is 1000 words. Using this approach makes the iterator as fast as using maps:to_list, so maps:iterator/2 has been removed.
2017-11-15Move new|abort_connection_id to erts_internalSverker Eriksson
and drop _id suffix.
2017-10-13erts: Implement maps path iteratorLukas Larsson
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-28Support for distribution controller processesRickard Green
2017-06-20Update preloaded modulesHans Nilsson
2017-06-14Update preloaded modulesRickard Green
2017-05-04Update preloaded modulesBjörn Gustavsson
2017-04-25Update preloaded modulesLukas Larsson
2017-04-10Update preloaded modulesLukas Larsson
2017-02-23Update preloaded erts_internal.beamBjörn-Egil Dahlberg
2017-02-17Teach make_preload to handle the new 'AtU8' chunkBjörn Gustavsson
26b59dfe67 introduced the new 'AtU8' chunk to support Unicode atoms. make_preload strips the pre-loaded BEAM files so that they only contain essential chunks. It expects to find the old 'Atom' chunk. Teach make_preload to read the new 'AtU8' chunk instead of the old chunk. Also produce a nice error message if someone by mistake compiles the pre-loaded modules with an OTP 19 compiler.
2016-12-20Update preloaded modulesLukas Larsson
2016-11-02Merge branch 'maint'Hans Bolinder
* maint: Update preloaded erts: Correct type declaration of match specification head Conflicts: erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/erts_internal.beam
2016-11-01Update preloadedHans Bolinder
2016-09-15Merge branch 'maint'Björn Gustavsson
* maint: erts: Add nif_SUITE:t_on_load erts: Improve nif_SUITE:upgrade test Don't leak old code when loading a modules with an on_load function Conflicts: erts/preloaded/ebin/erts_code_purger.beam erts/preloaded/ebin/erts_internal.beam erts/preloaded/src/erts_code_purger.erl
2016-09-14Don't leak old code when loading a modules with an on_load functionBjörn Gustavsson
Normally, calling code:delete/1 before re-loading the code for a module is unnecessary but causes no problem. But there will be be problems if the new code has an on_load function. Code with an on_load function will always be loaded as old code to allowed it to be easily purged if the on_load function would fail. If the on_load function succeeds, the old and current code will be swapped. So in the scenario where code:delete/1 has been called explicitly, there is old code but no current code. Loading code with an on_load function will cause the reference to the old code to be overwritten. That will at best cause a memory leak, and at worst an emulator crash (especially if NIFs are involved). To avoid that situation, we will put the code with the on_load function in a special, third slot in Module. ERL-240
2016-09-06Update preloadedLukas Larsson
2016-08-31Remove old purge strategyRickard Green
2016-08-29Perform check_process_code while process is executing dirtyRickard Green
2016-08-29Fix purge of codeRickard Green
Ensure that we cannot get any dangling pointers into code that has been purged. This is done by a two phase purge. At first phase all fun entries pointing into the code to purge are marked for purge. All processes trying to call these funs will be suspended and by this we avoid getting new direct references into the code. When all processes has been checked, these processes are resumed. The new purge strategy now also completely ignore the existence of indirect references to the code (funs). If such exist, they will cause bad fun exceptions to the caller, but will not prevent a soft purge or cause a kill of a process having such live references during a hard purge. This since it is impossible to give any guarantees that no processes in the system have such indirect references. Even when the system is completely clean from such references, new ones can appear via distribution and/or disk.
2016-08-26Reclaim literal area after purge has completedRickard Green
2016-06-20Update preloaded modulesHenrik Nord
2016-05-10Update preloaded modulesLukas Larsson
2016-05-03Update preloaded modulesBjörn-Egil Dahlberg
2016-04-15Update preloaded modulesLukas Larsson
2016-02-25Merge branch 'maint'Björn-Egil Dahlberg
Conflicts: erts/emulator/beam/erl_alloc.types erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_process.c erts/preloaded/ebin/erts_internal.beam
2016-02-17Update preloaded modulesHans Bolinder
2016-02-16Update preloaded erts_internal.beamBjörn-Egil Dahlberg
2016-02-08Merge branch 'sverk/safe-purging/OTP-13122'Sverker Eriksson
* sverk/safe-purging/OTP-13122: erts: Fix harmless dialyzer warnings
2016-02-02Update preloaded modulesLukas Larsson
2016-01-26Update preloaded modulesLukas Larsson
2016-01-25erts: Fix harmless dialyzer warningsSverker Eriksson
2016-01-13erts: Optimize erlang:check_process_codeSverker Eriksson
by ignoring literals. erts_internal:check_process_code will be called again anyway (with option {copy_literals, true}) before the module is actually purged. No need to check literals twice.
2016-01-13erts: Refactor check_process_code/3Sverker Eriksson
Move impl from erlang to erts_internal. Cut and paste.
2016-01-13erts: Move copy_literals/2 from erlang to erts_internalSverker Eriksson
as it's not a public interface.
2016-01-13erts: Make erlang:purge_module/1 safeSverker Eriksson
Problem: erlang:purge_module/1 is not safe in the sense that very bad things may happen if the code to be purged is still referred to by live processes. Introduce erts_internal:purge_module which is the same as the old erlang:purge_module BIF (except it returns false if no such old module). Implement erlang:purge_module in Erlang and let it invoke erts_code_purger for safe purging where all clogging processes first are killed.