aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys
AgeCommit message (Collapse)Author
2016-04-20Merge branch 'sverker/hipe-code-alloc'Sverker Eriksson
2016-04-15erts: Add 'exec_alloc' for hipe codeSverker Eriksson
that uses its own super carrier (erts_exec_mmapper) to guarantee low addressed and executable memory (PROT_EXEC). Currently only used on x86_64 that needs low memory for HiPE/AMD64's small code model. By initializing erts_exec_mapper early we secure its low memory area before erts_literal_mmapper might steal it.
2016-04-15erts: Make ErtsMemMapper able to map memory with PROT_EXECSverker Eriksson
to prepare for hipe native code allocation.
2016-04-15erts: Refactor callbacks for literal mseg allocSverker Eriksson
Make the callbacks more general to be usable for any allocator that that uses its own ErtsMemMapper.
2016-04-15erts: Tweak defaults for literal allocatorSverker Eriksson
Reduce main carrier size and number of free descriptors.
2016-04-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-04-06Merge branch 'egil/erts/tracing-beam-lttng/OTP-10282'Björn-Egil Dahlberg
* 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
2016-04-06erts: Add lttng tracepoints for driversBjörn-Egil Dahlberg
* 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
2016-03-29Merge branch 'lukas/erts/inline_tagvaldef/OTP-13440'Lukas Larsson
* lukas/erts/inline_tagvaldef/OTP-13440: erts: inline tag_val_def
2016-03-29erts: inline tag_val_defLukas Larsson
The tag_val_def function was called and multiple switch statements had to be traversed in term.c, and then a big switch in the calling code to branch on the term types. By inlining the switches are merged by the compiler and a lot fewer branches have to be taken. Benchmarks show that this increases performance of enc_term by as much as 10%.
2016-03-18Merge branch 'lukas/erts/fix_scheduler_suspend/ERL-94/PR-978/OTP-13425'Lukas Larsson
* lukas/erts/fix_scheduler_suspend/ERL-94/PR-978/OTP-13425: erts: Fix install of suspend handler Conflicts: erts/emulator/sys/unix/erl_unix_sys.h erts/emulator/sys/unix/sys.c
2016-03-16Take out (parts of) broken fp exception support for MacOS XBjörn Gustavsson
Floating-point exception support on MacOS X has never been especially reliable, and has therefore been disabled by default for a long time. The fpe support is now broken. Therefore, take out the unnecessary test for modern mcontext in configure (whatever that means) and the associated code in sys_float.c. Add #error directives to sys_float.c to make it clear that fpe is not supported. It seems to risky to mess with the mess of #ifdef's, so we will not attempt to remove all fpe support code for MacOS X.
2016-03-15update copyright-yearHenrik Nord
2016-03-08Merge branch 'sverk/literal-alloc-polish'Sverker Eriksson
* sverk/literal-alloc-polish: erts: Add emulator flag +MIscs for literal super carrier size erts: Refactor init of erts_literal_mmapper erts: Make literal_alloc documented and configurable
2016-03-01Merge branch 'sverk/master/halt-INT_MIN'Sverker Eriksson
* sverk/master/halt-INT_MIN: erts: Make erlang:halt() accept bignums as Status erts: Change erl_exit into erts_exit kernel: Remove calls to erl_exit
2016-02-29Fix build wihtout thread supportRickard Green
2016-02-24Merge branch 'master' into sverk/master/halt-INT_MINSverker Eriksson
2016-02-24erts: Change erl_exit into erts_exitSverker Eriksson
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).
2016-02-23erts: Refactor init of erts_literal_mmapperSverker Eriksson
2016-02-23erts: Make literal_alloc documented and configurableSverker Eriksson
Except it cannot be disabled and cannot be multi-threaded. The bit-vector 'erts_literal_vspace_map' on 32-bit is currently only protected by the literal allocator mutex. We could allow multiple instances on 64-bit (I think), but what would be the point?
2016-02-23erts: Fix install of suspend handlerLukas Larsson
This commit makes sure to setup the suspend handler to matter what +B option is given at the command line.
2016-02-02erts: Add power saving cpu feature tests and use themLukas Larsson
2016-02-02erts: Refactor perf counter internal interfaceLukas Larsson
perf counter is now part of the function pointer interface and also the function returns the value instead of writing to a memory buffer.
2016-02-02erts: Fix hrtime for windowsLukas Larsson
2016-02-02erts: use correct function for perf counter on non-x86Lukas Larsson
2016-02-02erts: Add microstate accountingLukas Larsson
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
2016-02-02erts, kernel: Add os:perf_counter functionLukas Larsson
The perf_counter is a very very cheap and high resolution timer that can be used to timestamp system events. It does not have monoticity guarantees, but should on most OS's expose a monotonous time. A special instruction has been created for this counter to further speed up fetching it. OTP-12908
2016-02-02Merge branch 'maint'Rickard Green
* maint: Introduce time management in native APIs Introduce time warp safe replacement for safe_fixed option Introduce time warp safe trace timestamp formats Conflicts: erts/emulator/beam/erl_bif_trace.c erts/emulator/beam/erl_driver.h erts/emulator/beam/erl_nif.h erts/emulator/beam/erl_trace.c erts/preloaded/ebin/erlang.beam
2016-01-21Introduce time management in native APIsRickard Green
2015-12-15Merge branch 'lukas/erts/forker'Lukas Larsson
* lukas/erts/forker: (28 commits) erts: Never abort in the forked child erts: Mend ASSERT makro for erl_child_setup erts: Allow enomem failures in port_SUITE erts: iter_port sleep longer on freebsd erts: Allow one dangling fd if there is a gethost port erts: Only use forker StackAck on freebsd erts: It is not possible to exit the forker driver erts: Add forker StartAck for port start flowcontrol erts: Fix large open_port arg segfault for win32 erts: Fix memory leak at async open port kernel: Remove cmd server for unix os:cmd erts: Add testcase for huge port environment erts: Move os_pid to port hash to child setup erts: Handle all EINTR and EAGAIN cases in child setup erts: Make child_setup work with large environments erts: Fix forker driver ifdefs for win32 erts: Fix uds socket handling for os x erts: Fix dereferencing of unaligned integer for sparc erts: Flatten too long io vectors in uds write erts: Add fd count test for spawn_driver ... Conflicts: erts/emulator/beam/erl_node_tables.c erts/preloaded/src/erts_internal.erl
2015-12-15erts: Never abort in the forked childLukas Larsson
We always want the error to propagate up to the application when a child cannot be created.
2015-12-15erts: Mend ASSERT makro for erl_child_setupSverker Eriksson
when called by hash.c for example. We use ASSERT from sys.h but erl_child_setup implements its own erl_assert_error() as it doesn't link with sys.o.
2015-12-15erts: Only use forker StackAck on freebsdLukas Larsson
2015-12-15erts: Add forker StartAck for port start flowcontrolLukas Larsson
An acknowledgement of the Start command has to be managed as we have to make sure that packages are not dropped and also that the close calls do not happen too early.
2015-12-15erts: Fix large open_port arg segfault for win32Lukas Larsson
os_SUITE:large_output_command send a 10k large argument to open_port({spawn,""}) which was too small for the 2K buffer allocated for win32. The buffer is now dynamic and any size can be used.
2015-12-15erts: Move os_pid to port hash to child setupLukas Larsson
Had to move the hashing because of a race that can otherwise happen where a new os_pid value was inserted into the hash before the previous value had been removed. Also replaced the protocol inbetween erts and child setup to be a binary protocol. This was done in order to deal with the varying size of Eterm.
2015-12-15erts: Handle all EINTR and EAGAIN cases in child setupLukas Larsson
2015-12-15erts: Make child_setup work with large environmentsLukas Larsson
2015-12-15erts: Fix uds socket handling for os xLukas Larsson
OS X is very strict in what it requires of you and also gives strange error codes for some errors. In this commit we remap EMSGSIZE to EMFILE and also precisely tune the amount of data we send on the socket so that we can recv only that data. If we try to recv more, recvmsg fails with EPIPE if the remote end has been closed.
2015-12-15erts: Fix dereferencing of unaligned integer for sparcLukas Larsson
2015-12-15erts: Flatten too long io vectors in uds writeLukas Larsson
2015-12-15erts: Create forker process for spawn driverLukas Larsson
Instead of forking from the beam process, we create a separate process in which all forks are done. This has several advantages: 1) performance: * don't have to close all fd's in the world * fork only has to copy stuff from a small process * work is done in a completely seperate process * a 3x performance increase has been measured, can be made even greater (10x) if we cache the environment in child setup 2) stability * the exec is done in another process than beam, which means that if the file that we exec to is on an nfs that is not available right now we will not block a scheduler until the nfs returns. 3) simplicity * don't have to deal with SIGCHLD in the erts Unfortunately, this solution also implies some badness. 1) There will always be a seperate process running together with beam on unix. This could be confusing and undesirable. 2) We have to transfer the entire environment to child_setup for each command. OTP-13088
2015-12-15erts: Move sys drivers to another fileLukas Larsson
2015-12-15erts: Change name of child_setup to erl_child_setupLukas Larsson
2015-12-15erts: Rename sys driver structsLukas Larsson
2015-11-27Merge branch 'maint'Sverker Eriksson
2015-11-27Merge branch 'sverk/cpool_fetch-dc_list-fix' into maintSverker Eriksson
OTP-13147 * sverk/cpool_fetch-dc_list-fix: erts: Reduce alloc_SUITE:rbtree runtime for valgrind erts: Remove double free in efile_drv erts: Improve alloc_SUITE:migration test erts: Pass free mem and build type to alloc_SUITE tests erts: Fix snprintf in alloc_SUITE for windows erts: Workaround for strange crash on win64 in alloc_SUITE test code erts: Refactor alloc_SUITE to use NIFs instead of drivers erts: Add enif_getenv erts: Make key argument constant for erl_drv_{get|put}env erts: Add alloc_SUITE:migration erts: Add TEST allocator erts: Fix confusion of callbacks destroying_mbc() vs remove_mbc() erts: Fix resurrection of carriers from dc_list
2015-11-26erts: Refactor alloc_SUITE to use NIFs instead of driversSverker Eriksson
2015-11-16Merge branch 'maint'Henrik Nord
2015-11-12erts: Add support for fast erts_is_literal()Sverker Eriksson