aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys
AgeCommit message (Collapse)Author
2018-04-25Merge branch 'lukas/erts/poll-thread/OTP-14346'Lukas Larsson
* lukas/erts/poll-thread/OTP-14346: erts: nif resource stop from poll-thread is a indirect call
2018-04-24erts: nif resource stop from poll-thread is a indirect callLukas Larsson
2018-04-19Optimize performance of float_to_list/2Serge Aleynikov
2018-04-12Merge PR-1770 from sverker/float_to_list-tweak/OTP-15015Sverker Eriksson
Improve float_to_list(F, [{decimals,D}])
2018-04-04erts: Fix float_to_list(F, [{decimals,D}])Sverker Eriksson
to better conform with io_lib:format("~.*f", [D,F])
2018-03-29erts: Don't use EV_DISPATCH on openbsdLukas Larsson
Currently (OpenBSD 6.2) the kqueu implementation on opnebsd does not work properly for EOF conditions when using EV_DISPATCH, so we use the EV_ONESHOT fallback there.
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-20erts: Make sys_memcpy and friends inline functionsSverker Eriksson
to avoid argument-evaluated-twice bugs like in macro DMC_PUSH. Had to shuffle around some #include and #define to make erl_child_setup build debug target.
2018-03-13Merge PR-1699 from sverker/hipe-amd64-high-code/OTP-14951Sverker Eriksson
Remove low memory need for HiPE on x86_64
2018-03-05erts: Remove unused "executable" feature from ErtsMemMapperSverker Eriksson
No longer need for super carrier allocating executable memory.
2018-03-05erts: Remove hipe amd64 code super carrier (exec_mmap)Sverker Eriksson
2018-02-16erts: Ignore SIGTERM in erl_child_setupLukas Larsson
2018-01-30erts: Remove low memory demand for hipe amd64 codeSverker Eriksson
2018-01-24Merge branch 'maint'Sverker Eriksson
2018-01-15erts: Refactor and cleanup sys_double_to_chars_fastSverker Eriksson
Replace long long with Uint64
2018-01-15erts: Fix float_to_list(F, [{decimals,D}]).Sverker Eriksson
Example symptom: 1> float_to_list(0.145, [{decimals,1}]). "0.2" There were two problems in sys_double_to_chars_fast 1. Most serious was adding 0.55555555 / (10^D) instead of 0.5 / (10^D) which imposed a 5.5% risk of a faulty rounding up. 2. Using fixpoint for frac_part which lost significant bits if F < 0.5
2018-01-03Alter erl_ddll:load dependency search path on WindowsJohn Högberg
The standard search order does not include the directory that the loaded DLL resides in, requiring dirty $PATH hacks to get things working, which is not an option now that os:putenv/2 is divorced from the OS environment.
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-10-30erts: Fix a bunch of compiler warningsLukas Larsson
2017-10-02erts: Trigger ready events when erts_io_control failsLukas Larsson
2017-10-02erts: disable kernel-poll on OS X vsn < 16Lukas Larsson
kqueue is broken on earlier versions of OS X.
2017-10-02erts: Fix msacc testcase with new poll-threadLukas Larsson
2017-10-02erts: Add testcases to test IOp and IOt optionsLukas Larsson
2017-10-02erts: get_internal_state(check_io_debug) now prints to error_loggerLukas Larsson
2017-10-02erts: Move all I/O polling to a seperate threadLukas Larsson
2017-10-02erts: Add multiple poll setsSverker Eriksson
2017-09-15erts: Refactor check_io to use one static structSverker Eriksson
that is shared between _kp and _nkp versions. Makes it easier to access in debugger.
2017-09-15erts: Replace check_io spinlock with lock-less list insertionSverker Eriksson
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-15erts: Rename ErtsPollSet_ structS to not confuse gdbSverker Eriksson
by having different structs with same name.
2017-09-15erts: Increase number of check_io-fd-locksSverker Eriksson
and use correct cache alignment.
2017-09-11Merge branch 'maint'Lukas Larsson
Conflicts: erts/emulator/sys/unix/sys.c
2017-09-11Merge branch 'lukas/erts/fix_warnings' into maintLukas Larsson
* lukas/erts/fix_warnings: Fix some clang warnings Fix unused-functions warnings
2017-09-11Fix unused-functions warningsLukas 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-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-07-06Merge branch 'john/erts/runtime-lcnt' into maintJohn Högberg
* john/erts/runtime-lcnt: Document rt_mask and add warnings about copy_save Add an emulator test suite for lock counting Break erts_debug:lock_counters/1 into separate BIFs Allow toggling lock counting at runtime Move lock flags to a common header Enable register_SUITE for lcnt builds Enable lcnt smoke test on all builds that have lcnt enabled Make lock counter info independent of the locks being counted OTP-14412 OTP-13170 OTP-14413
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-05-29Fix WX lock check assertion on MacOSXRickard Green
The fix avoids registering the main thread as an emulator thread on MacOSX. This since WX steals the main thread for its own usage on MacOSX, and use the thread as an ordinary driver thread.
2017-05-19Restore sighup behaviourRickard Green
2017-05-18Make lock counter info independent of the locks being countedJohn Högberg
This allows us to enable/disable lock counting at will, and greatly improves the performance of erts_debug:lock_counters/1 since we no longer have to worry about the lock counters "dying" while we're enumerating them. OTP-14412
2017-05-04Update copyright yearRaimo Niskanen
2017-04-27Rename macro and add clarifying commentRichard Carlsson
The macro previously named 'LOG2' is in fact computing the LSB (not the MSB) of its input, and can only be used to compute log2(n) when n is is a power of 2, that is, when its LSB is also its MSB.