aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_bif_info.c
AgeCommit message (Collapse)Author
2019-06-04Revert "erts: Force process_info(reductions) as signal"Sverker Eriksson
This reverts commit 70dbf671a8196110d2aee2e7507afc2c2c75183f. As the comment of 70dbf671a8 itself indicates, that "fix" is not really necessary. It has, however, the bad effect of always consuming reductions of the process you want to know reduction from, that is you can't meassure reduction count without affecting it.
2019-05-06Merge branch 'sverker/process_info-reductions-fix/OTP-15793' into maint-21Erlang/OTP
* sverker/process_info-reductions-fix/OTP-15793: erts: Force process_info(reductions) as signal erts: Fix another bug in process_info(reductions)
2019-05-03erts: Force process_info(reductions) as signalSverker Eriksson
Not 100% sure this is needed to get correct reductions as the direct query is not done if process is RUNNING anyway.
2019-03-07Merge branch 'sverker/ets-no-mbuf-trapping/OTP-15660'Sverker Eriksson
into sverker/maint/ets-no-mbuf-trapping/OTP-15660
2019-03-07erts: Remove ets traversal yielding if heap fragmentSverker Eriksson
Many heap fragments do no longer make the GC slow. Even worse, we are not guaranteed that a yield will provoke a GC removing the fragments, which might lead to a one-yield-per-bucket scenario if the heap fragment(s) still remains after each yield.
2019-02-01erts: Fix erlang:system_info(kernel_poll) to return correct valueLukas Larsson
2019-01-15erts: Make sure to take main lock when dumping proc infoLukas Larsson
If the main lock is not taken then any process running on a dirty scheduler may cause all kinds of problems.
2019-01-10erts: Add erlang:system_flag(system_logger,_)Lukas Larsson
This flag allows logger and other components to set the process which log messages from ERTS are to be sent.
2018-07-18erts: Remove use of VALGRIND_PRINTF_XMLSverker Eriksson
which only existed in a patched version of valgrind (by pan) no longer used. Instead we use standard VALGRIND_PRINTF which will end up like this if valgrind log format is XML and valgrind version >= 3.9: <clientmsg> <tid>7</tid> <threadname>3_scheduler</threadname> <text>Test case #20 ei_encode_SUITE:test_ei_encode_long/1 </text> </clientmsg> Note the extra trailing whitespace that may occure before </text>.
2018-07-10erts: Fix buggy calls to erts_sys_explicit_8bit_getenvSverker Eriksson
Two of them only affect valgrind builds and the one for ERL_CRASH_DUMP_NICE seems benign. Return value changed in c2d70945dce9cb09d5d7120d6e9ddf7faac8d230 old -> new -1 -> 0 not found 0 -> 1 found ok 1 -> -1 found but too big
2018-06-04erts: Add system_info(ets_count)Sverker Eriksson
2018-05-18Merge branch 'sverker/ets-delete_all_objects-trap/OTP-15078'Sverker Eriksson
* sverker/ets-delete_all_objects-trap/OTP-15078: erts: Rename untrapping db_free_*empty*_table erts: Make ets:delete_all_objects yield on fixed table erts: Optimize ets delete all in fixed table erts: Refactor ets select iteration code erts: Cleanup ets code erts: Optimize ets hash object deallocactions erts: Refactor pseudo deleted ets objects erts: Make atomic ets:delete_all_objects yield erts: Fix reduction bump for ets:delete/1
2018-05-16Fix erts_try_lock_sig_free_proc()Rickard Green
2018-05-16New process suspend implementation based on async signalingRickard Green
2018-05-08erts: Make atomic ets:delete_all_objects yieldSverker Eriksson
by using a cooperative strategy that will make any process accessing the table execute delelete_all_objects_continue until the table is empty. This is not an optimal solution as concurrent threads will still block on the table lock, but at least thread progress is made.
2018-04-27Merge branch 'rickard/process_info/OTP-14966'Rickard Green
* rickard/process_info/OTP-14966: Fix scheduled process_info() 'status' request Fix handling of process-info requests in receive
2018-04-26Fix handling of process-info requests in receiveRickard Green
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-18Merge branch 'sverker/lock-check-matrix'Sverker Eriksson
2018-04-13erts: Add erts_debug:lc_graph/0Sverker Eriksson
Run debug VM or config with --enable-lock-checking. Exercise VM and then run erts_debug:lc_graph(). to create a file "lc_graph.<pid>" in current working directory.
2018-04-12New process_info() implementation using signalsRickard Green
2018-03-23Merge branch 'rickard/signals/OTP-14589'Rickard Green
* rickard/signals/OTP-14589: Fix VM probes compilation Fix lock counting Fix signal order for is_process_alive Fix signal handling priority elevation
2018-03-22Fix signal order for is_process_aliveRickard Green
2018-03-21Merge pull request #1740 from rickard-green/rickard/signals/OTP-14589Rickard Green
Implementation of true asynchronous signaling between processes
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-16mikpe/process_info-1-no-messages/PR-1745/OTP-14986Lukas Larsson
make erlang:process_info/1 not retrieve messages
2018-03-10make erlang:process_info/1 not retrieve messagesMikael Pettersson
process_info/1 retrieves a number of properties related to a process, including the list of messages in its mailbox. This is potentially unsafe if the target process has a large number of queued messages: - there is no a priori upper bound on the amount of memory being allocated to hold that list, and - the loop to retrieve the messages is uninterruptible, so the Erlang scheduler where this executes blocks for the duration We've seen process_info/1 bring down heavily loaded nodes on more than one occasion. At least once it appeared to have blocked the Erlang heart process from executing, causing the external heart to kill the VM. Consequently this removes 'messages' from the list of process_info tags to retrieve for process_info/1. Note that process_info/1 still retrieves 'message_queue_len', and process_info/2 can still retrieve 'messages' when asked to. A few places in the OTP libraries need minor adjustments, since they want 'message_queue_len' but compute it from the length of the list of messages.
2018-03-09Always use sys_memcpy/cmp/etc instead of plain memcpy/cmp/etcJohn Högberg
2018-01-15Merge branch 'maint'Sverker Eriksson
2018-01-08Merge branch 'john/erts/putenv-thread-safety/OTP-14666'John Högberg
2018-01-04erts: Add non fatal big binary creation for test purposeSverker Eriksson
2018-01-03Replace the libc environment with a thread-safe emulationJohn Högberg
putenv(3) and friends aren't thread-safe regardless of how you slice it; a global lock around all environment operations (like before) keeps things safe as far as our own operations go, but we have absolutely no control over what libc or a library dragged in by a driver/NIF does -- they're free to call getenv(3) or putenv(3) without honoring our lock. This commit solves this by setting up an "emulated" environment which can't be touched without going through our interfaces. Third-party libraries can still shoot themselves in the foot but benign uses of os:putenv/2 will no longer risk crashing the emulator.
2017-12-19Merge branch 'dgud/kernel/refc_sched_wall_time/OTP-11694'Dan Gudmundsson
* dgud/kernel/refc_sched_wall_time/OTP-11694: test: spawn scheduler_wall_time flag holder Turn on scheduler_wall_time in an alive process Redirect system_flag(scheduler_wall_time,_) to kernel_refc kernel: add a resource reference counter
2017-12-19Redirect system_flag(scheduler_wall_time,_) to kernel_refcRickard Green
2017-12-05Merge branch 'maint'John Högberg
2017-12-04Fix process name resolution in lcnt resultsJohn Högberg
2017-11-15erts: Make DFLAGS_NEW_FUN_TAGS mandatorySverker Eriksson
and remove ugly encoding fallback as {fun, ...} DFLAGS_NEW_FUN_TAGS has been supported by vm/erl_interface/jinterface since R13 or even older. Renamed test case obsolete_funs to term2bin_tuple_fallbacks and removed test for {fun,...} fallback and added missing test for bitstring fallback {Binary, Bits}.
2017-10-12Merge branch 'lukas/erts/use_SIGRTMIN_for_sys_suspend/OTP-14682'Lukas Larsson
* lukas/erts/use_SIGRTMIN_for_sys_suspend/OTP-14682: erts: Use SIGRTMIN on linux for sys_suspend
2017-10-12erts: Use SIGRTMIN on linux for sys_suspendLukas Larsson
The Linux real-time signal is better used on Linux for suspending schedulers during shutdown as it doesn't collide with SIGUSR2 usage of other applications.
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-09-15erts: Add number of enif_select's to check_io_debugSverker Eriksson
2017-09-15erts: Remove undocumented driver_eventSverker Eriksson
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-11erts: Remove possibility to disable dirty schedulersLukas Larsson
2017-09-05Merge branch 'maint'Rickard Green
* maint: Bug fixes of statistics(wall_clock) and statistics(runtime) Conflicts: erts/emulator/beam/erl_time_sup.c
2017-09-05Merge branch 'rickard/statistics-time-fixes/OTP-14597/ERL-465' into maintRickard Green
* rickard/statistics-time-fixes/OTP-14597/ERL-465: Bug fixes of statistics(wall_clock) and statistics(runtime) Conflicts: erts/emulator/beam/erl_time_sup.c
2017-09-04Bug fixes of statistics(wall_clock) and statistics(runtime)Rickard Green
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