aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/common
AgeCommit message (Collapse)Author
2018-03-29Merge branch 'lukas/erts/tcp_send_return_closed/OTP-15001'Lukas Larsson
* lukas/erts/tcp_send_return_closed/OTP-15001: erts: tcp send should return {error,closed}
2017-11-30Reimplement efile_drv as a dirty NIFJohn Högberg
This improves the latency of file operations as dirty schedulers are a bit more eager to run jobs than async threads, and use a single global queue rather than per-thread queues, eliminating the risk of a job stalling behind a long-running job on the same thread while other async threads sit idle. There's no such thing as a free lunch though; the lowered latency comes at the cost of increased busy-waiting which may have an adverse effect on some applications. This behavior can be tweaked with the +sbwt flag, but unfortunately it affects all types of schedulers and not just dirty ones. We plan to add type-specific flags at a later stage. sendfile has been moved to inet_drv to lessen the effect of a nasty race; the cooperation between inet_drv and efile has never been airtight and the socket dying at the wrong time (Regardless of reason) could result in fd aliasing. Moving it to the inet driver makes it impossible to trigger this by closing the socket in the middle of a sendfile operation, while still allowing it to be aborted -- something that can't be done if it stays in the file driver. The race still occurs if the controlling process dies in the short window between dispatching the sendfile operation and the dup(2) call in the driver, but it's much less likely to happen now. A proper fix is in the works. -- Notable functional differences: * The use_threads option for file:sendfile/5 no longer has any effect. * The file-specific DTrace probes have been removed. The same effect can be achieved with normal tracing together with the nif__entry/nif__return probes to track scheduling. -- OTP-14256
2017-11-01Merge pull request #1592 from falkevik/sctp_return_only_connect_errorsRaimo Niskanen
OTP-13760 SCTP connect could return error even if the connect is ongoing
2017-10-30erts: tcp send should return {error,closed}Lukas Larsson
In the scenario where a gen_tcp:recv/2 detected an error, the next gen_tcp:send should get a closed error and not a enotconn error as was the case before.
2017-10-25sctp: change connect to only return connect errorsJonas Falkevik
gen_sctp:connect_init/4 could return error even though the connect are in progress. I.e. connect on socket returned "in progress". The error can come from packet_inet_output() which is checking the socket for errors. The issue here is that from erlang you don't think the connect is still ongoing. But you will receive a sctp_assoc_change message later on.
2017-10-17Merge branch 'maint'Sverker Eriksson
2017-10-17Merge branch 'sverker/dist-send-noreply-opt/OTP-14689' into maintSverker Eriksson
* sverker/dist-send-noreply-opt/OTP-14689: erts: Improve distribution send operations
2017-09-27Merge branch 'kvakvs/zero-size-read_file/ERL-327/PR-1524/OTP-14637'Lukas Larsson
* kvakvs/zero-size-read_file/ERL-327/PR-1524/OTP-14637: erts: On zero-size files attempt to read until EOF
2017-09-27erts: On zero-size files attempt to read until EOFDmytro Lytovchenko
2017-09-20erts: Improve distribution send operationsSverker Eriksson
by ignoring reply earlier.
2017-09-06Merge branch 'maint' into john/erts/merge-zlib-and-vector-qJohn Högberg
2017-09-05Replace the zlib driver with a NIFJohn Högberg
All operations will now yield appropriately, allowing them to be used freely in concurrent applications. This commit also deprecates the functions listed below, although they won't raise deprecation warnings until OTP 21: zlib:adler32 zlib:crc32 zlib:inflateChunk zlib:getBufSize zlib:setBufSize The behavior of throwing an error when a dictionary is required for decompression has also been deprecated.
2017-07-27Merge branch 'maint'John Högberg
* maint: Updated OTP version Update release notes Update version numbers Fix doc for the 'quiet' option; it defaults to false asn1: Fix missing quotes of external encoding call Add a dedicated close function for TCP ports to prevent issues like ERL-430/448 Close TCP ports properly on send timeout erts: Add missing release note
2017-07-27Merge branch 'maint-20' into maintJohn Högberg
* maint-20: Updated OTP version Update release notes Update version numbers Fix doc for the 'quiet' option; it defaults to false asn1: Fix missing quotes of external encoding call Add a dedicated close function for TCP ports to prevent issues like ERL-430/448 Close TCP ports properly on send timeout erts: Add missing release note
2017-07-26Merge branch 'john/erts/fix-tcp-send-timeout/OTP-14509/ERL-448' into maint-20Erlang/OTP
* john/erts/fix-tcp-send-timeout/OTP-14509/ERL-448: Add a dedicated close function for TCP ports to prevent issues like ERL-430/448 Close TCP ports properly on send timeout
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-10Add a dedicated close function for TCP ports to prevent issues like ERL-430/448John Högberg
2017-07-10Close TCP ports properly on send timeoutJohn Högberg
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-06-30Merge branch 'john/erts/fix-port-leak/OTP-13939/ERL-193' into maint-20Erlang/OTP
* john/erts/fix-port-leak/OTP-13939/ERL-193: Add a testcase for OTP-13939/ERL-193 Mark socket disconnected on tcp_send_or_shutdown_error # Conflicts: # lib/kernel/test/gen_tcp_misc_SUITE.erl
2017-06-27Merge branch 'maint-19' into maintJohn Högberg
* 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
2017-06-26Merge branch 'john/erts/fix-port-leak/OTP-13939/ERL-193' into maint-19Erlang/OTP
* john/erts/fix-port-leak/OTP-13939/ERL-193: Add a testcase for OTP-13939/ERL-193 Mark socket disconnected on tcp_send_or_shutdown_error # Conflicts: # lib/kernel/test/gen_tcp_misc_SUITE.erl
2017-06-14Mark socket disconnected on tcp_send_or_shutdown_errorkvakvs
The socket left lingering due to {exit_on_close, false} will accept writes in a confusing way, returning either enotconn or blocking. This fix allows socket to know that it has been closed recently, and new writes won't pass.
2017-06-08Merge branch 'maint'Rickard Green
* maint: Updated OTP version Update release notes Update version numbers erts: Fix so that 81b628 (sigterm=kill) works Updated OTP version Prepare release Unconditionally clear IO buffers on send/shutdown errors Conflicts: OTP_VERSION erts/emulator/sys/unix/sys.c erts/vsn.mk
2017-06-01Unconditionally clear IO buffers on send/shutdown errorsJohn Högberg
This fixes a bug where a send/shutdown error on an active-mode socket results in the port never being properly closed.
2017-05-19Do not zero terminate Linux abstract addressesRaimo Niskanen
2017-05-04Update copyright yearRaimo Niskanen
2017-04-20implement SO_BINDTODEVICE for inet protocolsAndreas Schultz
bind to device is needed to properly support VRF-Lite under Linux (see [1] for details). [1]: https://www.kernel.org/doc/Documentation/networking/vrf.txt
2017-03-30Merge branch 'goeldeepak/erts/fix_inet_gethost_long/ERL-61/PR-1345/OTP-14310'Lukas Larsson
* goeldeepak/erts/fix_inet_gethost_long/ERL-61/PR-1345/OTP-14310: This patch fixes the issue in which erlang fails to start if the hostname is 64 characters on a linux system.
2017-03-22This patch fixes the issue in which erlang fails to startDeepak Goel
if the hostname is 64 characters on a linux system.
2017-02-14Fixed typos in ertsAndrew Dryga
2017-01-17erts: Fix zlib crash on mac for inflateGetDictionarySverker Eriksson
Work around broken build system by checking actual zlib version in runtime.
2016-12-19erts: Tidy up in efile_drv.cSverker Eriksson
ERL_DRV_USE_NO_CALLBACK only meaningful when deselecting.
2016-09-15Merge branch 'maint'Raimo Niskanen
2016-09-14Tune 'tclass' semanticsRaimo Niskanen
2016-09-12Implement IPV6_TCLASSRaimo Niskanen
2016-08-26Merge branch 'g-andrade/kernel/fetch_ztream_dictionary/PR-1139/OTP-13842'Lukas Larsson
* g-andrade/kernel/fetch_ztream_dictionary/PR-1139/OTP-13842: Update preloaded modules Specify min zlib ver on inflateGetDictionary doc Skip inflateGetDictionary test case if unsupported zlib: Only link inflateGetDictionary if available zlib: Add test case for inflateGetDictionary zlib: support extraction of inflation dictionary
2016-08-22zlib: Only link inflateGetDictionary if availableGuilherme Andrade
Which at the moment means zlib versions >= 1.2.8.
2016-07-28Fix SCTP send stats in inet_drvRaimo Niskanen
2016-07-23zlib: support extraction of inflation dictionaryGuilherme Andrade
2016-06-16Return eafnosupport when not supportedRaimo Niskanen
2016-06-08Remove internal state BOUND from inet_drvRaimo Niskanen
2016-06-02Merge branch 'saleyn/uds/PR-612/OTP-13572'Raimo Niskanen
* saleyn/uds/PR-612/OTP-13572: AF_UNIX is more portable
2016-06-02AF_UNIX is more portableRaimo Niskanen
Fix dialyzer warning for improper list in prim_inet by not using an improper list.
2016-06-02Merge branch 'saleyn/uds/PR-612/OTP-13572'Raimo Niskanen
* saleyn/uds/PR-612/OTP-13572: Rewrite inet* for address family 'local' Rewrite inet_drv for AF_LOCAL Assign externally open fd to gen_tcp (UDS support) Conflicts: erts/preloaded/ebin/prim_inet.beam lib/kernel/doc/src/gen_tcp.xml lib/kernel/doc/src/gen_udp.xml lib/kernel/src/inet6_sctp.erl lib/kernel/test/inet_SUITE.erl
2016-06-01Rewrite inet_drv for AF_LOCALRaimo Niskanen
2016-04-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-03-31Refactor time_t in efile_drvBjörn-Egil Dahlberg
2016-03-15update copyright-yearHenrik Nord