aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_process.c
AgeCommit message (Collapse)Author
2016-02-15Merge branch 'rickard/ds-fixes' into rickard/ds-fixes-masterRickard Green
* rickard/ds-fixes: Fix unique_SUITE for dirty schedulers Add dirty scheduler process termination test Ensure that work is done on the correct type of schedulers Conflicts: erts/emulator/beam/erl_process.c erts/emulator/beam/erl_process.h erts/emulator/beam/erl_process_dump.c
2016-02-15Ensure that work is done on the correct type of schedulersRickard Green
Only the actual call to the dirty nif is allowed to execute on dirty schedulers. The dirty nif is not allowed to execute on normal schedulers if dirty schedulers are available. Arrival of exit signals and system tasks, while a process was scheduled for execution on a dirty scheduler, could mess up the process internal state. Preparation for dirty system task has been made, but is currently unused.
2016-02-08Merge branch 'maint'Sverker Eriksson
2016-02-08Merge branch 'sverk/proc-exiting-timer-race/OTP-13245' into maintSverker Eriksson
* sverk/proc-exiting-timer-race/OTP-13245: erts: Fix race between receive timeout and exit signal
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: Add ERTS_WRITE_UNLIKELYLukas Larsson
ERTS_WRITE_UNLIKELY can be used to place global variables in a specific section where only data that is very rarely modified sits. This is used to improve cache locality.
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-02-02Merge branch 'rickard/monotonic-time-improvements/OTP-13222' into maintRickard Green
* rickard/monotonic-time-improvements/OTP-13222: Introduce time management in native APIs Introduce time warp safe replacement for safe_fixed option Introduce time warp safe trace timestamp formats
2016-01-20Introduce time warp safe trace timestamp formatsRickard Green
New timestamp options for trace, sequential trace, and system profile: - monotonic_timestamp - strict_monotonic_timestamp
2016-01-20Merge branch 'maint'Rickard Green
* maint: Fix dirty scheduler check in handle_aux_work
2016-01-19Merge branch 'sverk/safe-purging/OTP-13122'Sverker Eriksson
* sverk/safe-purging/OTP-13122: erts: Ignore unexpected messages to erts_code_purger erts: Optimize erlang:check_process_code erts: Refactor check_process_code/3 erts: Make copy_literals more fail safe erts: Move copy_literals/2 from erlang to erts_internal erts: Make erlang:purge_module/1 safe erts: Refactor code:purge/1 and code:soft_purge/1 erts: Introduce erts_code_purger
2016-01-18Fix dirty scheduler check in handle_aux_workSteve Vinoski
2016-01-18erts: Fix race between receive timeout and exit signalSverker Eriksson
Must re-read 'state' after seizing proc locks as other thread may have set EXITING.
2016-01-14Merge branch 'maint'Rickard Green
* maint: Do not allow aux work on dirty schedulers
2016-01-14Merge branch 'vinoski/dirty-sched-no-aux-work/OTP-13236' into maintRickard Green
* vinoski/dirty-sched-no-aux-work/OTP-13236: Do not allow aux work on dirty schedulers
2016-01-13erts: Optimize erlang:check_process_codeSverker Eriksson
by ignoring literals. erts_internal:check_process_code will be called again anyway (with option {copy_literals, true}) before the module is actually purged. No need to check literals twice.
2015-12-30Merge branch 'maint'Rickard Green
* maint: Light weight statistics of run queue lengths Conflicts: erts/preloaded/ebin/erlang.beam
2015-12-30Light weight statistics of run queue lengthsRickard Green
- statistics(total_run_queue_lengths) - statistics(run_queue_lengths) - statistics(total_active_tasks) - statistics(active_tasks) Conflicts: erts/emulator/beam/erl_process.c
2015-12-21Do not allow aux work on dirty schedulersSteve Vinoski
The nature of aux work is such that dirty schedulers should not attempt to perform it. Modify the code to ensure that dirty schedulers avoid aux work. Also fix an incorrect assumption about the size of a Uint in the ErtsDirtySchedId type.
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: 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-08Merge branch 'rickard/ohmq-fixup/OTP-13047'Rickard Green
* rickard/ohmq-fixup/OTP-13047: Replace off_heap_message_queue option with message_queue_data option Always use literal_alloc Distinguish between GC disabled by BIFs and other disabled GC Fix process_info(_, off_heap_message_queue) Off heap message queue test suite Remove unused variable Fix memory leaks
2015-12-08Replace off_heap_message_queue option with message_queue_data optionRickard Green
The message_queue_data option can have the values - off_heap - on_heap - mixed
2015-12-08Distinguish between GC disabled by BIFs and other disabled GCRickard Green
Processes remember heap fragments that are known to be fully live due to creation in a just called BIF that yields in the live_hf_end field. This field must not be used if we have not disabled GC in a BIF. F_DELAY_GC has been introduced in order to distinguish between to two different scenarios. - F_DISABLE_GC should *only* be used by BIFs. This when the BIF needs to yield while preventig a GC. - F_DELAY_GC should only be used when GC is temporarily disabled while the process is scheduled. A process must not be scheduled out while F_DELAY_GC is set.
2015-12-08Remove unused variableRickard Green
2015-12-08Fix memory leaksRickard Green
2015-12-02Merge branch 'egil/fix-seq_trace'Björn-Egil Dahlberg
* egil/fix-seq_trace: Fix seq_trace token copy size Fix seq_trace refactoring bug
2015-11-26Merge branch 'maint'Sverker Eriksson
2015-11-24Fix seq_trace token copy sizeBjörn-Egil Dahlberg
2015-11-24Fix seq_trace refactoring bugBjörn-Egil Dahlberg
2015-11-19Refactor have seq_trace token testBjörn-Egil Dahlberg
2015-11-18Use sharing preserving copy error messages and exceptionsBjörn-Egil Dahlberg
2015-11-18Refactor sharing preserved copy flagsBjörn-Egil Dahlberg
The TMPBUF option is no longer needed due to is_literal test and NONE was only used for initial debugging. So we remove the entire option.
2015-11-17Refactor copy sharingBjörn-Egil Dahlberg
2015-11-17Add -debug +vc flag for debuging SHCOPYNikolaos S. Papaspyrou
This is very verbose, you have been warned. It should work with the copy-spy.py script, which may be a bit outdated.
2015-11-17Enable shcopy for spawning processesNikolaos S. Papaspyrou
2015-11-13Merge branch 'rickard/gc-bump-reds/OTP-13097'Rickard Green
* rickard/gc-bump-reds/OTP-13097: Bump reductions on GC
2015-11-12Merge branch 'rickard/ohmq/OTP-13047'Rickard Green
* rickard/ohmq/OTP-13047: Fragmented young heap generation and off_heap_message_queue option Refactor GC Introduce literal tag Conflicts: erts/doc/src/erlang.xml erts/emulator/beam/erl_gc.c
2015-11-12Bump reductions on GCRickard Green
2015-11-12Fragmented young heap generation and off_heap_message_queue optionRickard Green
* The youngest generation of the heap can now consist of multiple blocks. Heap fragments and message fragments are added to the youngest generation when needed without triggering a GC. After a GC the youngest generation is contained in one single block. * The off_heap_message_queue process flag has been added. When enabled all message data in the queue is kept off heap. When a message is selected from the queue, the message fragment (or heap fragment) containing the actual message is attached to the youngest generation. Messages stored off heap is not part of GC.
2015-11-02erts: Remove ERTS_PSD_DIST_ENTRYSverker Eriksson
Not needed as it is always set to erts_this_dist_entry (on net_kernel).
2015-10-09erts: Remove vheap mature from process control blockBjörn-Egil Dahlberg
Binary vheap mature is not necessary for binary gc.
2015-09-09Merge branch 'maint'Rickard Green
* maint: Add configure switch --disable-saved-compile-time Fix ethread events with timeout Improve choice of clock sources at build time
2015-09-09Merge branch 'rickard/event-tmo/OTP-12954' into maintRickard Green
* rickard/event-tmo/OTP-12954: Fix ethread events with timeout
2015-08-27Fix ethread events with timeoutRickard Green
Lots of pthread platforms unnecessarily falled back on the pipe/select solution. This since we tried to use the same monotonic clock source for pthread_cond_timedwait() as used by OS monotonic time. This has been fixed on most platforms by using another clock source. Darwin can however not use pthread_cond_timedwait() with monotonic clock source and has to use the pipe/select solution. On darwin we now use select with _DARWIN_UNLIMITED_SELECT in order to be able to handle a large amount of file descriptors.
2015-08-18Merge branch 'maint'Lukas Larsson
* maint: erts: Make sure to unlock status lock when setting process prio
2015-08-18Merge branch 'lukas/erts/process_priority_unlock/OTP-12943' into maintLukas Larsson
* lukas/erts/process_priority_unlock/OTP-12943: erts: Make sure to unlock status lock when setting process prio
2015-08-13erts: Make sure to unlock status lock when setting process prioLukas Larsson
2015-08-10Merge branch 'maint'Lukas Larsson
* maint: erts: Don't abort when a system process is terminated
2015-08-10Merge branch 'lukas/erts/system_process_core/OTP-12934' into maintLukas Larsson
* lukas/erts/system_process_core/OTP-12934: erts: Don't abort when a system process is terminated