aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/common
AgeCommit message (Collapse)Author
2018-08-27Fix bug in compact representation of float_to_list/2Serge Aleynikov
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-07-03Use fallback pollset for stdin and friends when using kqueueJohn Högberg
This is a hack to make the "noshell" option work; kqueue can poll these fds but will not report EV_EOF. This may be common to all all pipes but we have no way to tell whether an fd is a pipe or not.
2018-06-21Fix environment case sensitivity issues on WindowsJohn Högberg
2018-06-18Update copyright yearHenrik Nord
2018-06-13erts: Fix MacOS pollset bugSverker Eriksson
that could cause clearing of fd-bits past allocated bit-vectors. Bug introduced on master by 988f5f5e8061ce2e135a314ca782788eda478a06
2018-06-04erts: Refactor usage of am_atom_put to ERTS_MAKE_AMSverker Eriksson
and let compiler determine string lengths. These were actually wrong in erl_db.c: count_trap\0 replace_tra select_tra
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-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-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-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: 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-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-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-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.
2017-04-25Merge pull request #1417 from mikpe/erts-erl_mseg-bad-cache-indexingRickard Green
erl_mseg.c: don't use invalid indices in - > cache_powered_node[] OTP-14360
2017-04-21erl_mseg.c: don't use invalid indices in - > cache_powered_node[]Mikael Pettersson
2017-04-20erts: Fix new gcc warning in check ioLukas Larsson
2017-03-22erts: Don't allocate memory during signal handlingBjörn-Egil Dahlberg
Allocations and message sending are now scheduled by a signal, via a signal state bitmap, instead of doing it directly in the signal handler.
2017-03-21erts: Make sigterm signal safe for non-smp beamBjörn-Egil Dahlberg
The signal handler will now schedule a sigterm message instead of sending the message in the signal handler. The signal handler must refrain from memory allocations and thus the event is scheduled.
2017-02-23Remove debug printout and commentSverker Eriksson
2017-02-20Remove faulty debug ASSERTSverker Eriksson
Why did I add that?
2017-02-20Fix enif_select for windowsSverker Eriksson