aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/common/erl_check_io.c
AgeCommit message (Collapse)Author
2019-05-02erts: Fix so that non-oneshot pollset on OpenBSD worksLukas Larsson
The poll code for kevent on OpenBSD and NetBSD had not been fixed to work properly when disabling events in the scheduler poll-set. Because they use ONESHOT the delete operation was built into the trigger and thus a lot of code was not needed when doing oneshot, however it is needed when doing non-oneshot.
2019-04-09Merge branch 'maint'Lukas Larsson
2019-04-09erts: Fix sys_driver to correctly deselect fdsLukas Larsson
Incorrect precidence rules made the driver never deselect the given fds.
2019-02-22Merge PR-2147 from sverker/sverker/enif-null-pid/OTP-15011Sverker Eriksson
Add enif_set_pid_undefined & enif_is_pid_undefined
2019-02-22Merge branch ↵Lukas Larsson
'lukas/erts/fragment-dist-messages/OTP-13397/OTP-15610/OTP-15611/OTP-15612/OTP-15613' * lukas/erts/fragment-dist-messages/OTP-13397/OTP-15610/OTP-15611/OTP-15612/OTP-15613: erts: Add debug dist obuf memory leak check win32: Fix ./otp_build debuginfo_win32 Make ld.sh on windows print better error reason erts: Fix so that externals with creation 0 compare equal to all erts: Expand etp to look for free processes erts: Implement trapping while sending distr exit/down erts: Add ERL_NODE_BOOKKEEP to node tables refc erts: Refactor ErtsSendContext to be ErtsDSigSendContext erts: Add distr testcases for fragmentation erts: Make remote send of exit/2 trap erts: Implement fragmentation of distrubution messages erts: Expand distribution protocol documentation erts: Move reason in dist messages to payload erts: Remove a copy of distribution data payload erts: Yield later during process exit and allow free procs to run erts: Refactor rbt _yielding to use reductions erts: Limit binary printout for %.XT in erts_print
2019-02-22erts: Implement fragmentation of distrubution messagesLukas Larsson
2019-02-20erts: Add enif_set_pid_undefined & enif_is_pid_undefinedSverker Eriksson
2019-02-11Merge branch 'maint'Sverker Eriksson
2019-02-11Merge branch 'sverker/enif_select-faulty-assert' into maintSverker Eriksson
* sverker/enif_select-faulty-assert: erts: Fix faulty debug assert in enif_select
2019-02-06erts: Fix faulty debug assert in enif_selectSverker Eriksson
2019-01-23Merge branch 'maint'Lukas Larsson
2019-01-07erts: Add enif_select_read|write with 'msg_env' argumentSverker Eriksson
2019-01-07erts: Fix pollset test casesLukas Larsson
2018-12-20erts: Add ERL_NIF_SELECT_CUSTOM_MSGSverker Eriksson
2018-12-06Merge branch 'maint'Lukas Larsson
Conflicts: erts/emulator/beam/erl_process.c
2018-12-06erts: Move fds with active true behaviour to own pollsetLukas Larsson
At start of the VM a poll-set that the schedulers will check is created where fds that have triggered many (at the moment, many means 10) times without being deselected inbetween. In this scheduler specific poll-set fds do not use ONESHOT, which means that the number of syscalls goes down dramatically for such fds. This pollset is introduced in order to handle fds that are used by the erlang distribution and that never change their state from {active, true}. This pollset only handles ready_input events, ready_output is still handled by the poll threads. During overload, polling the scheduler poll-set is done on a 10ms timer.
2018-12-03erts: Add erts_io_notify_port_task_executed to check_io msacc stateLukas Larsson
OTP-15450
2018-10-23erts: Pass thread progress data where possibleLukas Larsson
The poll thread does a lot of waking up and then going back to sleep. A large part of the waking up is managing thread progress and a large part of that was using thread specific data to get the thread progress data pointer. With this refactor the tpd is passed to each of the functions which greatly decreases the number of ethr_get_tsd calls which in turn halves the CPU usage of the poller thread in certain scenarios.
2018-09-11Merge branch 'sverker/enif-cancel-select/OTP-15095'Sverker Eriksson
* sverker/enif-cancel-select/OTP-15095: erts: Add ERL_NIF_SELECT_CANCEL flag for enif_select
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-20erts: Add ERL_NIF_SELECT_CANCEL flag for enif_selectSverker Eriksson
to deselect read and/or writes without stop callback.
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-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.
2017-10-02erts: Trigger ready events when erts_io_control failsLukas 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: 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-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-02-23Remove debug printout and commentSverker Eriksson
2017-02-20Fix enif_select for windowsSverker Eriksson
2017-02-20erts: Avoid revival of dying resource by dec_termSverker Eriksson
2017-02-20Merge branch 'master' into sverker/enif_selectSverker Eriksson
Conflicts: erts/emulator/beam/erl_binary.h erts/emulator/beam/erl_monitors.c erts/emulator/beam/erl_nif.c erts/emulator/beam/global.h erts/emulator/test/nif_SUITE_data/nif_SUITE.c
2017-02-09erts: Try fix enif_select for windowsSverker Eriksson
by simply disable "delayed deselect".
2017-02-09erts: Change return value for enif_selectSverker Eriksson
to negative int as error and positive as success.
2017-02-09erts: Add pid argument to enif_selectSverker Eriksson
2017-02-09erts: Beautify enif_selectSverker Eriksson
indentation and comments only
2017-02-09erts: Fix bad_fd_in_pollset error case for enif_selectSverker Eriksson