aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_process.c
AgeCommit message (Collapse)Author
2011-12-01Merge branch 'rickard/rm-common-runq/OTP-9727'Rickard Green
* rickard/rm-common-runq/OTP-9727: Remove common run-queue in SMP case Fix scheduler suspend bug Conflicts: erts/emulator/beam/erl_init.c
2011-12-01Remove common run-queue in SMP caseRickard Green
The common run-queue implementation is removed since it is unused, untested, undocumented, unsupported, and only complicates the code. A spinlock used by the run-queue management sometimes got heavily contended. This code has now been rewritten, and the spinlock has been removed.
2011-12-01Fix scheduler suspend bugRickard Green
Calls to erlang:system_flag(schedulers_online, N) and/or erlang:system_flag(multi_scheduling, block|unblock) could cause internal data used by this functionality to get into an inconsistent state. When this happened various problems occurred. This bug was quite hard to trigger, so hopefully no-one has been effected by it.
2011-11-29erl_process.c: Remove the redundant variable 'processes_busy'Björn Gustavsson
There is a static variable called 'processes_busy' in erl_process.c, which will be incremented but never used. To confuse things, there is also a global variable with the same name, but it it is only defined and used if BM_COUNTERS is defined. In erl_process.c, the global version of 'processes_busy' will be seen and incremented if BM_COUNTERS is defined. Remove the static version of 'processes_busy' in erl_process.c, but keep the global version if BM_COUNTERS is defined. Noticed-by: Jovi Zhang
2011-11-18Merge branch 'sverk/hipe-without-fpe/OTP-9724'Sverker Eriksson
* sverk/hipe-without-fpe/OTP-9724: otp_build: Disable FPE by default on Linux stdlib: Make sure qlc_SUITE:otp_6964 restores backtrace_depth erts: Add test for inf/NaN intermediate float results hipe,erts: Allow hipe without floating point exceptions hipe: Fix bug in hipe_rtl_lcm:calc_killed_expr_bb erts: Rename macros used by float instructions without FPE
2011-11-18Merge branch 'rickard/sched-compact-load/OTP-9695'Rickard Green
* rickard/sched-compact-load/OTP-9695: Add switch that can disable scheduler compaction of load
2011-11-17hipe,erts: Allow hipe without floating point exceptionsSverker Eriksson
2011-11-15Add switch that can disable scheduler compaction of loadRickard Green
2011-11-13Merge branch 'rickard/generic-thr-queue/OTP-9632'Rickard Green
* rickard/generic-thr-queue/OTP-9632: Use generic lock-free queue for async threads Use generic lock-free queue for misc aux work Implement generic lock-free queue
2011-11-13Merge branch 'rickard/thr-progress-block/OTP-9631'Rickard Green
* rickard/thr-progress-block/OTP-9631: Replace system block with thread progress block
2011-11-13Merge branch 'rickard/alloc-opt/OTP-7775'Rickard Green
* rickard/alloc-opt/OTP-7775: Optimize memory allocation Conflicts: erts/aclocal.m4 erts/emulator/hipe/hipe_bif_list.m4 erts/preloaded/ebin/erl_prim_loader.beam erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/init.beam erts/preloaded/ebin/otp_ring0.beam erts/preloaded/ebin/prim_file.beam erts/preloaded/ebin/prim_inet.beam erts/preloaded/ebin/prim_zip.beam erts/preloaded/ebin/zlib.beam
2011-11-13Use generic lock-free queue for async threadsRickard Green
Queues used for communication between async threads and scheduler threads have been replaced with lock-free queues. Drivers using the driver_async functionality are not automatically locked to the system anymore, and can be unloaded as any dynamically linked in driver. Scheduling of ready async jobs is now also interleaved in between other jobs. Previously all ready async jobs was performed at once.
2011-11-13Use generic lock-free queue for misc aux workRickard Green
2011-11-13Replace system block with thread progress blockRickard Green
The ERTS internal system block functionality has been replaced by new functionality for blocking the system. The old system block functionality had contention issues and complexity issues. The new functionality piggy-backs on thread progress tracking functionality needed by newly introduced lock-free synchronization in the runtime system. When the functionality for blocking the system isn't used there is more or less no overhead at all. This since the functionality for tracking thread progress is there and needed anyway.
2011-11-13Optimize memory allocationRickard Green
A number of memory allocation optimizations have been implemented. Most optimizations reduce contention caused by synchronization between threads during allocation and deallocation of memory. Most notably: * Synchronization of memory management in scheduler specific allocator instances has been rewritten to use lock-free synchronization. * Synchronization of memory management in scheduler specific pre-allocators has been rewritten to use lock-free synchronization. * The 'mseg_alloc' memory segment allocator now use scheduler specific instances instead of one instance. Apart from reducing contention this also ensures that memory allocators always create memory segments on the local NUMA node on a NUMA system.
2011-10-14Merge branch 'rickard/atomics-api/OTP-9014' and OTP_R14B04Rickard Green
Conflicts: erts/aclocal.m4 erts/emulator/beam/erl_db.c erts/emulator/sys/win32/sys.c erts/include/internal/ethread_header_config.h.in
2011-09-26Merge branch 'dev' into majorLars Thorsen
* dev: [erl_docgen] Missing header level in PDF bookmarks menu Fixed version, release notes and appup in prep for release. Fix lost wakeup of scheduler when enqueuing auxiliary work
2011-09-24Merge branch 'rickard/aux-work-bug/OTP-9567' into devRickard Green
* rickard/aux-work-bug/OTP-9567: Fix lost wakeup of scheduler when enqueuing auxiliary work
2011-09-22Fix lost wakeup of scheduler when enqueuing auxiliary workRickard Green
When auxiliary work was enqueued on a scheduler, the wakeup of the scheduler in order to handle this work could be lost. Wakeups in order to handle ordinary work were not effected by this bug. The bug only effected runtime systems with SMP support as follows: * Deallocation of some ETS data structures could be delayed. * On Linux systems not using the NPTL thread library (typically ancient systems with kernel versions prior to 2.6) and Windows systems, the {Port, {exit_status, Status}} message from a terminating port program could be delayed. That is, it only effected port programs which had been started by passing exit_status as an option to open_port/2.
2011-09-13Merge branch 'dev' into majorBjörn-Egil Dahlberg
* dev: Make sure we have a run_queue
2011-09-12Make sure we have a run_queueBjörn-Egil Dahlberg
* In rare cases we could have no run_queue in schedule misc ops
2011-09-06BEAM: Unify allocation of X and float registersBjörn Gustavsson
In the half-word emulator, smp emulator, and non-smp emulator the X register and float register arrays were allocated in different ways. Always allocate the registers and store the pointers to the allocated register arrays in the scheduler data.
2011-06-14Use new atomic API in runtime systemRickard Green
All uses of the old deprecated atomic API in the runtime system have been replaced with the use of the new atomic API. In a lot of places this change imply a relaxation of memory barriers used.
2011-05-13Merge branch 'rickard/barriers/OTP-9281' into devRickard Green
* rickard/barriers/OTP-9281: Silence warnings Fix build with hipe on amd64 Reduce number of atomic ops Use 32-bit atomic for port snapshot Remove pointless erts_ports_alive variable Ensure quick break Ensure that all rehashing information are seen when done Ensure that stack updates are seen when stack is released Add needed barriers for write_concurrency tables Homogenize memory barriers on atomics
2011-05-13Reduce number of atomic opsRickard Green
Counters for active, and used schedulers have been coalesced in order to reduce the amount of atomic operations needed. Some currently not strictly necessary barriers have also been added in order to be future proof.
2011-05-13Merge branch 'bjorn/fix-warnings/OTP-9250' into devBjörn Gustavsson
* bjorn/fix-warnings/OTP-9250: Eliminate alias warning in gcc 4.5.2 erl_trace: Eliminate alias warning
2011-05-11Merge branch 'rickard/gc-other/OTP-9211' into devRickard Green
* rickard/gc-other/OTP-9211: Fix bad assertions Avoid scheduling of processes being garbage collected by others
2011-05-11Fix bad assertionsRickard Green
2011-05-11Eliminate alias warning in gcc 4.5.2Björn Gustavsson
2011-04-27Merge branch 'sverker/erts_printf-halfword' into devSverker Eriksson
* sverker/erts_printf-halfword: erts_printf %be to print integers of size Eterm Fix use of type BeamInstr in hipe_debug.c Conflicts: erts/emulator/hipe/hipe_debug.c
2011-04-14Merge branch 'maint-r14' into devSverker Eriksson
Conflicts: erts/vsn.mk
2011-04-11Avoid scheduling of processes being garbage collected by othersRickard Green
2011-04-11Fix lost wakeup when process garbage collected by otherRickard Green
2011-04-11Only set status P_WAITING when neededRickard Green
The status of a process was unnecessarily set to waiting before the process was enqueued in a run queue. This bug was harmless up until OTP-R14B01. In OTP-R14B02 erlang:hibernate/3 was fixed (OTP-9125). After the introduction of OTP-9125, the previously harmless process status bug sometimes caused erroneous badarg exceptions from process_info().
2011-04-07Merge branch 'ta/erts-unused-vars' into devHenrik Nord
* ta/erts-unused-vars: erts: Remove unused variables OTP-9205
2011-03-25Merge branch 'pan/system_info_procs_crash/OTP-9140' into devPatrik Nyblom
* pan/system_info_procs_crash/OTP-9140: Make erts_printf %T not recurse on C stack Corrected fd_driver and cleaned up some really old code in win32/sys.[ch]
2011-03-17Make erts_printf %T not recurse on C stackPatrik Nyblom
2011-03-16erts_printf %be to print integers of size EtermSverker Eriksson
Existing %bp to print pointer size integers does not work in halfword emulator to print Eterm size integers.
2011-03-16erts: Remove unused variablesTuncer Ayaz
2011-03-10Merge branch 'sverker/valgrind-new-suppressions' into devSverker Eriksson
* sverker/valgrind-new-suppressions: Make halfword emulator with valgrind target allocate low memory Add erts_alloc_permanent_cache_aligned to supress valgrind
2011-03-08The emulator could get into a state where it didn't check for I/O.Rickard Green
2011-03-03Add erts_alloc_permanent_cache_aligned to supress valgrindSverker Eriksson
Ease the valgrind supression of memory that are permanently allocated and then aligned up to cache line.
2011-03-02Merge branch 'pan/halfword-tmp-heap-fixes/OTP-8332' into devPatrik Nyblom
* pan/halfword-tmp-heap-fixes/OTP-8332: Fix assymetric (Un)UseTmpHeap in erl_process.c Conflicts: erts/emulator/beam/beam_emu.c
2011-02-10Verify that temp allocated memory is releasedRickard Green
2011-01-13Fix assymetric (Un)UseTmpHeap in erl_process.cPatrik Nyblom
Also added ASSERTion in beam_emu.c that the tmp-heap-counter in 0.
2010-12-29Merge branch 'egil/timer-wheel-min-time/OTP-8990' into devBjörn-Egil Dahlberg
* egil/timer-wheel-min-time/OTP-8990: Teach timer-wheel slots to use double linked lists Remove timer-thread implementation Refactor timer interface Teach timer-wheel to keep min time
2010-12-20Refactor timer interfaceBjörn-Egil Dahlberg
2010-12-17Fix missed change of aux_work typeRickard Green
2010-12-17Merge branch 'rickard/ets-tab-delete/OTP-8999' into devRickard Green
* rickard/ets-tab-delete/OTP-8999: Safe deallocation of ETS-table structures Fix rwlock resource leak when hitting system limit Conflicts: erts/emulator/beam/erl_process.h erts/emulator/beam/erl_process.c
2010-12-16Use 32-bit atomics for misc scheduling specific informationRickard Green