aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src
AgeCommit message (Collapse)Author
2018-04-18Merge branch 'sverker/lock-check-matrix'Sverker Eriksson
2018-04-13erts: Add erts_debug:lc_graph/0Sverker Eriksson
Run debug VM or config with --enable-lock-checking. Exercise VM and then run erts_debug:lc_graph(). to create a file "lc_graph.<pid>" in current working directory.
2018-04-10Set infinity timeout for auth requestsRickard Green
2018-03-27Merge pull request #1760 from ↵John Högberg
jhogberg/john/erts/any-term-as-seq_trace-label/OTP-14899 Lift the type restrictions on seq_trace token labels
2018-03-26Merge branch 'raimo/type-posix-0-overhaul/ERL_550/OTP-14019'Raimo Niskanen
* raimo/type-posix-0-overhaul/ERL_550/OTP-14019: Update types for posix error codes
2018-03-26Update types for posix error codesRaimo Niskanen
I have read the man pages for most socket and file operations on recent Linux, FreeBSD, OpenBSD and Solaris 10 and noted the possible error codes. Which error codes that are possible for file operations have been updated in file:posix/0. Error codes for socket operations in inet:posix/0. The latter refers to the former so it is a superset, assuming that e.g sendfile and AF_UNIX socket operations could cause socket operations to return any file error code. That is not entirely true, but could be, especially in the future. Added to file:posix/0 are: ebadmsg edeadlk edeadlock eftype emultihop enobufs enolck enolink enosr enostr enosys eopnotsupp eoverflow erange etxtbsy Added to inet:posix/0 are all but: exbadport exbadseq file:posix() These are still possible according to erl_posix_str.c, but are not in file:posix/0 nor in inet:posix/0, and many of them are not file nor inet related, but some might be: e2big eadv ealign ebade ebadfd ebadr ebadrpc ebadrqc ebadslt ebfont echild echrng ecomm edirty edom edotdot eduppkg eidrm einit eisnam elbin el2hlt el2nsync el3hlt el3rst elibacc elibbad elibexec elibmax elibscn elnrng enavail enet enoano enocsi enodata enoexec enonet enosym enotempty enotnam enotuniq eproclim eprocunavail eprogmismatch eprogunavail erefused eremchg eremdev eremote eremoteio eremoterelease erpcmismatch erremote eshutdown esrmnt esuccesss etime etoomanyrefs euclean eunatch eusers eversion exfull sysnotready vernotsupported ediscon enomore ecancelled einvalidproctable einvalidprovider eproviderfailedinit syscallfailure service_not_found type_not_found e_no_more e_cancelled unknown
2018-03-23Lift the type restrictions on seq_trace token labelsJohn Högberg
OTP-14899
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-20Merge pull request #1705 from eltex-ecss/group_exit_signalHans Nilsson
kernel: in the group added processing of 'EXIT' signal from shell OTP-14991
2018-03-20Merge pull request #1742 from michalmuskala/code-ensure-loadedDan Gudmundsson
Short-circuit code:ensure_loaded for already-loaded modules
2018-03-16more-typos: s%follwing%following%gPierre Fenoll
2018-03-13Merge branch 'sverker/send-tick/OTP-14681'Sverker Eriksson
* sverker/send-tick/OTP-14681: kernel: Fix and improve send_tick logic
2018-03-13Merge branch 'sverker/dist-flags-consolidate'Sverker Eriksson
2018-03-07Short-circuit code:ensure_loaded for already-loaded modulesMichał Muskała
This checks if the module is already loaded using erlang:module_loaded before calling the code server. This should improve performance of the call significantly since the case where module is already loaded is the common one. The change shouldn't cause any problems. It's worth noting that code:ensure_modules_loaded already does a similar check.
2018-03-06Merge branch 'raimo/stop-encouraging-v4-mapped/ERL-503/OTP-13716'Raimo Niskanen
* raimo/stop-encouraging-v4-mapped/ERL-503/OTP-13716: Stop translating V4MAPPED addresses Stop returning V4MAPPED addresses Implement function for IPv4-mapped IPv6 addresses
2018-03-06Merge remote-tracking branch 'origin/hasse/kernel/rpc_doc_fix/OTP-10551'Hans Bolinder
* origin/hasse/kernel/rpc_doc_fix/OTP-10551: kernel: Improve docs of rpc:multicall/5
2018-03-02kernel,stdlib: Remove obsolete use of send with 'noconnect'Sverker Eriksson
as workarounds to avoid blocking auto-connect, which is now asynchronous in OTP-21. Also changed old catch to more efficient try-catch.
2018-03-02erts,kernel: Add dist_util:strict_order_flags/0Sverker Eriksson
to replace DFLAGS_STRICT_ORDER_DELIVERY and remove that compile time dependency.
2018-03-02kernel: Remove DFLAGS_ALL from dist.hrlSverker Eriksson
and remove use in dist_util:check_mandatory
2018-03-02kernel: Simplify dist flags handshake mergingSverker Eriksson
to a simple 'band' operation into ChosenFlags and no need to remember old 'this_flags' and 'other_flags'.
2018-03-02erts,kernel: Add erts_internal:get_dflags/0Sverker Eriksson
for kernel to ask erts about distribution flags and keep this info in one place.
2018-03-02kernel: Remove redundant codeSverker Eriksson
No need to clear them as they cannot be set.
2018-03-02Merge branch 'maint'Lukas Larsson
2018-03-01kernel: Fix handling of os:cmd option max_size in winLukas Larsson
2018-02-27kernel: Improve docs of rpc:multicall/5Hans Bolinder
2018-02-22Stop translating V4MAPPED addressesRaimo Niskanen
2018-02-20Merge branch 'maint'Sverker Eriksson
2018-02-15kernel: Reject load of module names with slashSverker Eriksson
or backslash on Windows. Purpose: Prevent tricks to get hostile code running.
2018-02-13Merge branch 'maint'Sverker Eriksson
* maint: Updated OTP version Update release notes Update version numbers kernel: Add os:cmd/2 with max_size option # Conflicts: # OTP_VERSION # lib/kernel/doc/src/os.xml # lib/kernel/src/os.erl
2018-02-13Merge branch 'maint-20' into maintSverker Eriksson
* maint-20: Updated OTP version Update release notes Update version numbers erts: Add system_flags(erts_alloc,"+M?sbct *") erts: Add age order first fit allocator strategies erts: Refactor erl_ao_firstfit_alloc erts: Add migration options "acnl" and "acfml" kernel: Add os:cmd/2 with max_size option erts: Add more stats for mbcs_pool erts: Fix alloc_SUITE:migration stdlib: Make ets_SUITE memory check try again erts: Improve carrier pool search erts: Improve alloc_SUITE:migration erts: Refactor carrier dealloc migration
2018-02-13Stop returning V4MAPPED addressesRaimo Niskanen
2018-02-05kernel: Do not call erlang:get_stacktrace()Hans Bolinder
2018-02-02kernel: in the group added processing of 'EXIT' signal from shell in case of ↵Anton Ryabkov
the group leader is waiting data from IO driver
2018-01-29make HiPE work on x86_64 when PIE is enabledbhuztez
Currently HiPE amd64 assumes the runtime system code is loaded into the low 2G of the address space. However, this is not the case when PIE is enabled, it is loaded into a random location. So trampolines are required to call BIFs, and also we have first to load the address of sse2_fnegate_mask to a regisiter before xorpd in fchs.
2018-01-26Implement function for IPv4-mapped IPv6 addressesRaimo Niskanen
2018-01-24Merge branch 'maint'Sverker Eriksson
2018-01-24Merge branch 'sverker/hipe-load-fixing/OTP-14891' into maintSverker Eriksson
2018-01-23Merge branch 'maint'Hans Bolinder
* maint: kernel: Correct contracts and a bug in group_history stdlib: Correct contracts dialyzer: Optimize handling of a lot of warnings Conflicts: lib/kernel/src/erl_boot_server.erl
2018-01-22kernel: Correct contracts and a bug in group_historyHans Bolinder
2018-01-17Fix slow hipe executionSverker Eriksson
particularly slow erlc when compiler is hipe compiled. hipe_unified_loader:load did not patch external call sites and instead caused a double hipe mode switch per call. hipe_unified_loader:load is only used for early modules first loaded as beam and by code:atomic_load and friends.
2018-01-17kernel: Add os:cmd/2 with max_size optionLukas Larsson
2018-01-12Merge pull request #1645 from Zorbash/document-inet-iRaimo Niskanen
OTP:13713: Add documentation and typespecs for inet:i/0
2018-01-08Merge branch 'john/erts/putenv-thread-safety/OTP-14666'John Högberg
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-12-19Merge branch 'dgud/kernel/refc_sched_wall_time/OTP-11694'Dan Gudmundsson
* dgud/kernel/refc_sched_wall_time/OTP-11694: test: spawn scheduler_wall_time flag holder Turn on scheduler_wall_time in an alive process Redirect system_flag(scheduler_wall_time,_) to kernel_refc kernel: add a resource reference counter
2017-12-19Redirect system_flag(scheduler_wall_time,_) to kernel_refcRickard Green
2017-12-08Slightly optimize reading of cooked files in list modeBjörn Gustavsson
In general, the new NIF-based file routines are faster than the old efile driver. However, on some computers, building the entire OTP system is somewhat slower. It turns out that it is because 'erlc' cheated by turning off the IO thread pool (using '+A0') to avoid context switches between scheduler threads and threads in the IO thread pool. The new file routines perform IO on dirty IO threads, and there is (by intent) no way to force the operations to occur on scheduler threads to avoid the context switches What we can do to is to use a small (4Kb) read-ahead buffer for files opened for reading (only) in list mode (which is how the compiler opens its input files). The buffering reduces the number of context switches between scheduler threads and dirty IO threads. On my computer that seems to slightly speed up building of the entire OTP system. The buffer should do no harm. The only potential for harm I can think of is random access to a file opened in read mode, where the read-ahead buffer could slightly decrease performance. That does not seems to be a likely use case in practice, though.
2017-12-06Add typespecs to inet:iDimitris Zorbas
2017-12-01kernel: add a resource reference counterDan Gudmundsson
System resources/functionality may need to be reference counted to be handled correctly when used or enabled/disabled from more than one process or application. It is easier to handle this in erlang code than in erts, so make a process that deals with the housekeeping.