summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/erl_port_task.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright yearErlang/OTP2022-04-111-1/+1
|
* erts: Add option +IOs to disable scheduler pollingSverker Eriksson2022-04-071-16/+14
| | | | Enabled (true) by default.
* Merge branch 'rickard/alias/master/OTP-16718'Rickard Green2020-11-121-1/+1
|\ | | | | | | | | | | | | | | | | * rickard/alias/master/OTP-16718: User defined tag in monitor messages Use alias in gen behaviours Introduce aliases for processes Introduce internal references containing pid of creator Allow huge remote references
| * Introduce internal references containing pid of creatorRickard Green2020-11-031-1/+1
| |
* | otp: Remove HiPE and HiPE-related accessoriesJohn Högberg2020-11-091-4/+0
|/
* Change faulty assert checking that port is not dead at rescheduleRickard Green2020-06-121-1/+2
| | | | | | | | | | | | | | | | | | | | After scheduled execution of port tasks, a port is rescheduled if there still remain scheduled port tasks on it. The assert checked that the port was not in state ERTS_PORT_SFLGS_DEAD (which is either ERTS_PORT_SFLG_FREE or ERTS_PORT_SFLG_INITIALIZING) when being rescheduled. The port can however be set in state ERTS_PORT_SFLG_FREE between the point where it is determined that it needs to be rescheduled (finalize_exec()) and the actual rescheduling where the assert is. This situation is however not an issue. When this happens the port will be rescheduled and later selected for execution. The first thing that happens when it begins executing is that it will complete termination since it is in state ERTS_PORT_SFLG_FREE. The modified assert now only checks that the port is not in state ERTS_PORT_SFLG_INITIALIZING.
* Update copyright yearRickard Green2020-03-131-1/+1
|
* erts: Implement trapping while sending distr exit/downLukas Larsson2019-02-221-1/+1
| | | | | | The reason in EXIT and DOWN may be arbitrarily large, so we yield and allow other processes to execute while encoding and sending the signals over the distribution.
* erts: Move fds with active true behaviour to own pollsetLukas Larsson2018-12-061-9/+72
| | | | | | | | | | | | | | | | | | | 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.
* Update copyright yearHenrik Nord2018-06-181-1/+1
|
* do not call abort_signal_task() with invalid dataMikael Pettersson2018-05-291-2/+3
|
* Replace usage of ERTS_PSFLG_BOUNDRickard Green2018-03-051-17/+8
|
* erts: Move all I/O polling to a seperate threadLukas Larsson2017-10-021-5/+3
|
* erts: Optimize port_task quick allocatorSverker Eriksson2017-10-021-5/+6
| | | | for non scheduler threads by using ERTS_THR_PREF_QUICK_ALLOC_IMPL.
* erts: Add multiple poll setsSverker Eriksson2017-10-021-33/+4
|
* erts: Remove undocumented driver_eventSverker Eriksson2017-09-151-29/+0
|
* erts: Refactor move check_io interface from sys to check_ioSverker Eriksson2017-09-151-0/+1
| | | | | | | | | # 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
* Merge branch 'maint'Sverker Eriksson2017-09-121-3/+6
|\
| * erts: Fix memory leak when sending to terminating portSverker Eriksson2017-08-301-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Error: Leak_DefinitelyLost erts_alloc:230 (-> 0x52E54D) [erl_alloc.h] port_task_alloc:154 (-> 0x52F3CA) [erl_port_task.c] erts_port_task_alloc_p2p_sig_data:212 (-> 0x52F5D3) [erl_port_task.c] erts_port_output:2147 (-> 0x4F6057) [io.c] erts_port_command:4126 (-> 0x4FA10E) [io.c] do_send:2200 (-> 0x4E4C64) [bif.c] erl_send:2494 (-> 0x4E5E09) [bif.c] process_main:1730 (-> 0x43ADA5) [beam_emu.c]
* | erts: Replace usage of all erts_smp prefixes to just ertsLukas Larsson2017-07-171-109/+109
| |
* | erts: Cleanup removal of non-smp emulatorsLukas Larsson2017-07-171-0/+4
| |
* | erts: Remove ERTS_SMP and USE_THREAD definesLukas Larsson2017-07-171-64/+0
|/ | | | | | | | | | | | | | | | | | | | | 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
* Merge branch 'maint-19' into maintJohn Högberg2017-06-271-11/+26
|\ | | | | | | | | | | | | | | | | | | | | | | | | * maint-19: Updated OTP version Update release notes Update version numbers Fix statistics(wall_clock) and statistics(runtime) implementation fixup! erts: Cleanup dropped port tasks correctly erts: Add tests to detect port close race Add a testcase for OTP-13939/ERL-193 erts: Cleanup dropped port tasks correctly Mark socket disconnected on tcp_send_or_shutdown_error
| * fixup! erts: Cleanup dropped port tasks correctlyLukas Larsson2017-06-141-7/+8
| |
| * erts: Cleanup dropped port tasks correctlyLukas Larsson2017-06-141-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | Before this fix, the extra data attached to a port task had to be cleaned up by the calling function. This caused problems because the outputv call, co-allocates the extra data with the port task. So in rare circumstances the port task would be free'd before the extra data was free'd which led to segfault when looking at the port task. This has been fixed by the generic PORT_TASK_ABORT behaviour being used even for tasks dropped in the erts_schedule_proc2port_signal API.
* | Update copyright yearHans Nilsson2017-06-141-1/+1
| |
* | erts: Remove old unused functionsLukas Larsson2017-05-161-7/+0
| | | | | | | | The functions have been found using: https://github.com/caolanm/callcatcher
* | Switch between scheduler types when multi-scheduling is blockedRickard Green2017-01-131-1/+1
|/
* erts: Extend process and port tracingLukas Larsson2016-04-151-0/+2
| | | | | | | | | | | | | This commit completes the tracing for processes so that all messages sent by a process (via nifs or otherwise) will be traced. The commit also adds tracing of all types of events from ports. When enabling tracing using erlang:trace, the 'all' flag now also enables tracing on all ports. OTP-13496
* Merge branch 'henrik/update-copyrightyear'Henrik Nord2016-04-131-1/+1
|\ | | | | | | | | * henrik/update-copyrightyear: update copyright-year
| * update copyright-yearHenrik Nord2016-03-151-1/+1
| |
* | Merge branch 'egil/erts/tracing-beam-lttng/OTP-10282'Björn-Egil Dahlberg2016-04-061-0/+17
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * egil/erts/tracing-beam-lttng/OTP-10282: erts: Don't use ratio in carrier lttng tracepoints Add lttng testcases erts: Extend erlang:system_info/1 with lttng Refactor and fix dtrace define in erl_message erts: Add lttng tracepoints for async pool queue erts: Add lttng tracepoints for drivers erts: Add lttng tracepoints for scheduler events erts: Add lttng tracepoints for memory carriers erts: Update lttng-wrapper with mfa conversion erts: Teach lttng to configure and build system
| * | erts: Add lttng tracepoints for driversBjörn-Egil Dahlberg2016-04-061-0/+17
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * driver_event * driver_flush * driver_finish * driver_init * driver_output * driver_outputv * driver_process_exit * driver_ready_async * driver_ready_input * driver_ready_output * driver_start * driver_stop * driver_stop_select * driver_timeout
* | erts: Add enif_port_commandLukas Larsson2016-03-291-3/+27
|/
* Merge branch 'master' into sverk/master/halt-INT_MINSverker Eriksson2016-02-241-1/+4
|\
| * erts: Add microstate accountingLukas Larsson2016-02-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Microstate accounting is a way to track which state the different threads within ERTS are in. The main usage area is to pin point performance bottlenecks by checking which states the threads are in and then from there figuring out why and where to optimize. Since checking whether microstate accounting is on or off is relatively expensive if done in a short loop only a few of the states are enabled by default and more states can be enabled through configure. I've done some benchmarking and the overhead with it turned off is not noticible and with it on it is a fraction of a percent. If you enable the extra states, depending on the benchmark, the ovehead when turned off is about 1% and when turned on somewhere inbetween 5-15%. OTP-12345
| * ose: Remove all code related to the OSE portLukas Larsson2015-07-101-1/+1
| | | | | | | | | | | | The OSE port is no longer supported and this commit removed it and any changes related to it. The things that were general improvements have been left in the code.
* | erts: Change erl_exit into erts_exitSverker Eriksson2016-02-241-2/+2
|/ | | | | | | | | | | | | | | | | This is mostly a pure refactoring. Except for the buggy cases when calling erlang:halt() with a positive integer in the range -(INT_MIN+2) to -INT_MIN that got confused with ERTS_ABORT_EXIT, ERTS_DUMP_EXIT and ERTS_INTR_EXIT. Outcome OLD erl_exit(n, ) NEW erts_exit(n, ) ------- ------------------- ------------------------------------------- exit(Status) n = -Status <= 0 n = Status >= 0 crashdump+abort n > 0, ignore n n = ERTS_ERROR_EXIT < 0 The outcome of the old ERTS_ABORT_EXIT, ERTS_INTR_EXIT and ERTS_DUMP_EXIT are the same as before (even though their values have changed).
* Change license text to APLv2Bruce Yinhe2015-06-181-9/+10
|
* Optimized timer implementationRickard Green2015-05-081-7/+12
|
* Merge branch 'rickard/eager-check-io/OTP-12117' into ↵Rickard Green2014-09-251-6/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | rickard/maint-17/eager-check-io/OTP-12117 * rickard/eager-check-io/OTP-12117: Introduce support for eager check I/O scheduling Conflicts: erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_init.c erts/emulator/beam/erl_process.c erts/preloaded/ebin/erlang.beam
| * Introduce support for eager check I/O schedulingRickard Green2014-09-251-6/+18
| |
* | Ensure "runnable port" trace messages are not sent out of orderRickard Green2014-08-221-14/+34
| |
* | Merge branch 'rickard/port-emigrate-bug/OTP-12084' into ↵Rickard Green2014-08-181-2/+15
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rickard/port-emigrate-bug/maint/OTP-12084 * rickard/port-emigrate-bug/OTP-12084: Verify run-queue asserts Fix emigrate bug in erts_port_task_schedule() Conflicts: erts/emulator/beam/erl_port_task.c
| * | Verify run-queue assertsRickard Green2014-08-141-2/+14
| | |
| * | Fix emigrate bug in erts_port_task_schedule()Rickard Green2014-08-071-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While current run-queue lock is unlocked in the call to erts_check_emigration_need() from erts_port_task_schedule() the port can be migrated to another run-queue by another thread. The code in erts_port_task_schedule() needs to check if this has occurred when returning from erts_check_emigration_need(), and if so respect the migration decision. When this was not done, the thread calling erts_port_task_schedule() held the wrong run-queue lock which caused invalid updates of the port task queue. This bug was automatically fixed by the rewrites in the branch rickard/r16b/port-optimizations-fixes/OTP-10336 (commit 56cef897ca3ad2377e34a6ea5800a54a28cbeb6e) introduced in erts-5.10 and do not effect erts versions after that.
* | | Fix abort of nosuspend-tasks in erts_port_task_schedule()Rickard Green2014-08-051-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The counter for the amount of outstanding data in the port queue became inconsistent when aborting nosuspend-signals in erts_port_task_schedule(). This since the counter was subtracted by the data size of the signal although the data size had never been added to it. This inconsistency caused the port queue to remain in a busy state forever.
* | | Merge branch 'paulgray/dtrace_snprintf_fix/OTP-11816'Lukas Larsson2014-03-251-1/+1
|\ \ \ | | | | | | | | | | | | | | | | * paulgray/dtrace_snprintf_fix/OTP-11816: Fix DTrace/SystemTap-related formatting
| * | | Fix DTrace/SystemTap-related formattingScott Lystig Fritchie2014-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks to Michał Ptaszek for bringing this embarrassing formatting error to my attention. Many DTrace/SystemTap trace strings are incorrectly truncated at 4/8 bytes, depending on the CPU word size. This patch expands the work from commit d032e097 by zheng siyao. Michał's report to the erlang-bugs list can be found at: http://erlang.org/pipermail/erlang-bugs/2014-March/004250.html Conflicts: erts/emulator/beam/beam_emu.c erts/emulator/beam/copy.c erts/emulator/beam/dist.c erts/emulator/beam/erl_async.c erts/emulator/beam/erl_bif_port.c erts/emulator/beam/erl_port_task.c erts/emulator/beam/erl_process.c erts/emulator/beam/io.c
* | | | Merge branch 'paulgray/dtrace_snprintf_fix/OTP-11816'Lukas Larsson2014-03-251-2/+2
|\ \ \ \ | |/ / / | | | | | | | | | | | | * paulgray/dtrace_snprintf_fix/OTP-11816: Pass full strings to DTrace probes