aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_process.c
AgeCommit message (Collapse)Author
2018-04-24Merge pull request #1790 from jhogberg/john/erts/more-alloc-info/OTP-14961John Högberg
Improve memory instrumentation OTP-15024 OTP-14961
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-04-20erts: Fix run queue pointer in proxy processSverker Eriksson
proc->run_queue detected as uninitialized by valgrind but seems harmless in practice as it's not used for proxy processes. "Bug" introduced in OTP-17 by ca0425c6ff85262bc15367f5fd9cbc51cde52b20 and made worse (but still harmless) in master for OTP-21 at fbb10ebc4a37555c7ea7f99e14286d862993976a.
2018-04-16erts: Keep track of which NIF a scheduler is executingJohn Högberg
This may be of interest in crash dumps and allows the upcoming allocation tagging feature to track allocations on a per-NIF basis. Note that this is only updated when user code calls a NIF; it's not altered when the emulator calls NIFs during code upgrades or tracing.
2018-04-13Merge branch 'rickard/process_info/OTP-14966'Rickard Green
* rickard/process_info/OTP-14966: New process_info() implementation using signals
2018-04-12New process_info() implementation using signalsRickard Green
2018-04-11Merge branch 'rickard/signals/OTP-14589'Rickard Green
* rickard/signals/OTP-14589: Fix seq trace Fix bad assert
2018-03-27Merge branch 'john/erts/bwt-wt-dirty-schedulers/OTP-14959'John Högberg
* john/erts/bwt-wt-dirty-schedulers/OTP-14959: Add +sbwt/+swt analogues for dirty schedulers
2018-03-27Fix bad assertRickard Green
2018-03-26Add +sbwt/+swt analogues for dirty schedulersJohn Högberg
Sharing these settings for all schedulers can degrade performance, so it makes sense to be able to configure them separately. This also changes the default busy-wait time to "short" for both kinds of dirty schedulers.
2018-03-22Fix signal handling priority elevationRickard 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-13Merge branch 'rickard/dirty-work-gone/OTP-14978'Rickard Green
* rickard/dirty-work-gone/OTP-14978: Reschedule on ordinary scheduler if dirty work is gone
2018-03-13Reschedule on ordinary scheduler if dirty work is goneRickard Green
2018-03-13Merge branch 'rickard/remove-approx-started/OTP-14975'Rickard Green
* rickard/remove-approx-started/OTP-14975: Remove process start time for crash dumps
2018-03-07Fix for bug introduced when replacing ERTS_PSFLG_BOUNDRickard Green
Bug introduced in commit fbb10ebc4a37555c7ea7f99e14286d862993976a
2018-03-05Replace usage of ERTS_PSFLG_BOUNDRickard Green
2018-03-05Remove ERTS_PSFLG_ON_HEAP_MSGQRickard Green
2018-02-22Merge 'sverker/erts/more-crash-dump-info/OTP-14820'Sverker Eriksson
2018-02-22erts,observer: Add port-suspended pids to crash dumpSverker Eriksson
2018-02-20erts,observer: Add dirty schedulers to crash dumpSverker Eriksson
2017-11-15Refactor erts_dsig_prepare argument dep(p)Sverker Eriksson
Don't need to be pointer-pointer
2017-11-15erts: Introduce asynchronous auto-connectSverker Eriksson
2017-11-10Merge branch 'maint-20' into maintIngela Anderton Andin
* maint-20: Updated OTP version Update release notes Update version numbers inets: Prepare for release inets: Add missing guard Avoid WindowBits=8 as per the manual Fix deflateParams on zlib 1.2.11 Ignore empty binaries in enif_inspect_iovec Emasculate writable binaries on entering an iovec Only apply EOS behaviors if there's pending data Stop assuming that all schedulers are managed when updating msacc
2017-11-07Merge branch 'sverker/systask-reqid-bug/OTP-14752' into maintSverker Eriksson
* sverker/systask-reqid-bug: erts: Fix bug in systask scheduling
2017-11-07Merge branch 'sverker/systask-reqid-bug'Sverker Eriksson
* sverker/systask-reqid-bug: erts: Fix bug in systask scheduling
2017-11-06erts: Fix bug in systask schedulingSverker Eriksson
when request id is an immediate. Ex: erlang:garbage_collect(P, [{async,Immediate}]). may crash the VM.
2017-11-02Remove process start time for crash dumpsRickard Green
2017-11-02Merge branch 'john/erts/msacc-dirty-schedulers/OTP-14707'John Högberg
2017-10-25Stop assuming that all schedulers are managed when updating msaccJohn Högberg
This fixes statistics_SUITE:msacc when dirty schedulers are used during the test.
2017-10-12Merge branch 'maint'Lukas Larsson
Conflicts: erts/emulator/beam/beam_bp.c erts/emulator/beam/erl_process.c
2017-10-12erts: Fix lock order when recv tracing trapped exit signalLukas Larsson
2017-10-02Merge branch 'lukas/erts/poll-thread/OTP-14346'Lukas Larsson
* lukas/erts/poll-thread/OTP-14346: (25 commits) erts: Trigger ready events when erts_io_control fails erts: enif_select steal test kernel: Rewrite gen_udp_SUITE:read_packet tc erts: disable kernel-poll on OS X vsn < 16 erts: Fix msacc testcase with new poll-thread erts: Add testcases to test IOp and IOt options erts: get_internal_state(check_io_debug) now prints to error_logger erts: Remove eager check io erts: Move all I/O polling to a seperate thread erts: Fix smp_select testcase to use ERL_DRV_USE erts: Fix msacc unmanaged state counter erts: Optimize port_task quick allocator erts: Add ERTS_THR_PREF_QUICK_ALLOC_IMPL erts: Update suspend of scheduler to handle multiple pollsets erts: Add multiple poll sets erts: Some code cleanup for gdb to work better erts: temp_alloc can no longer be disabled erts: Refactor check_io to use one static struct erts: Replace check_io spinlock with lock-less list insertion erts: Add number of enif_select's to check_io_debug ...
2017-10-02erts: Remove eager check ioLukas Larsson
It is not longer relevant when using the poll thread
2017-10-02erts: Move all I/O polling to a seperate threadLukas Larsson
2017-10-02erts: Optimize port_task quick allocatorSverker Eriksson
for non scheduler threads by using ERTS_THR_PREF_QUICK_ALLOC_IMPL.
2017-10-02erts: Update suspend of scheduler to handle multiple pollsetsRickard Green
2017-10-02erts: Add multiple poll setsSverker Eriksson
2017-10-02erts: Some code cleanup for gdb to work betterLukas Larsson
2017-09-21erts: Print the error reason when threads fail to startLukas Larsson
2017-09-15erts: Refactor move check_io interface from sys to check_ioSverker Eriksson
# Conflicts: # erts/emulator/beam/erl_process.c # erts/emulator/beam/sys.h # erts/emulator/sys/common/erl_check_io.c # erts/emulator/sys/common/erl_check_io.h # erts/emulator/sys/unix/sys.c
2017-09-15Merge branch 'lukas/erts/remove-dirty-scheduler-defines/OTP-14613'Lukas Larsson
* lukas/erts/remove-dirty-scheduler-defines/OTP-14613: erts: Remove possibility to disable dirty schedulers
2017-09-12Merge branch 'maint'Sverker Eriksson
2017-09-12Merge branch 'sverker/valgrind-fixes/OTP-14609' into maintSverker Eriksson
* sverker/valgrind-fixes/OTP-14609: erts: Suppress false memory leak for dlerror [ct] Cleanup and rename purify related functions as valgrind Revert "remove unused purify functions" erts: Fix memory leak when sending to terminating port erts: Fix harmless use of uninitialised value
2017-09-11Merge branch 'maint'Lukas Larsson
Conflicts: erts/emulator/sys/unix/sys.c
2017-09-11Fix unused-functions warningsLukas Larsson
2017-09-11erts: Remove possibility to disable dirty schedulersLukas Larsson
2017-08-28erts: Fix harmless use of uninitialised valueSverker Eriksson
Conditional jump or move depends on uninitialised value(s): erts_msgq_update_internal_pointers:487 (-> 0x5A7AF9) [erl_message.h] erts_msgq_replace_msg_ref:496 (-> 0x5A7B4C) [erl_message.h] move_msgq_to_heap:2487 (-> 0x5AED4F) [erl_gc.c] minor_collection:1380 (-> 0x5AB3F4) [erl_gc.c]
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