aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_db.c
AgeCommit message (Collapse)Author
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-12Cleanup ETS bif's in hipe:erl_bif_types.erl (for dialyzer)Patrik Nyblom
2011-07-07Fix bug in ets:delete for write_concurrency that could lead to deadlockSverker Eriksson
Relocking in ets_delete_1() and remove_named_tab() was done by unlocking the table without clearing the is_thread_safe flag. A racing thread could then read-lock the table and then incorrectly write-unlock the table as db_unlock() looked at is_thread_safe to determine which kind of lock to unlock. Several fixes: 1. Make db_unlock() use argument 'kind' instead of is_thread_safe to determine lock type. 2. Make relock logic use db_lock() and db_unlock() instead of directly accessing lock primitives. 3. Do ownership transfer earlier in ets_delete_1 to avoid racing owner process to also start deleting the same table.
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-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-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-02-03HALFWORD ETS Further match spec optimization to minimize copying and garbageSverker Eriksson
2011-02-03HALFWORD ETS 32-bit arch fixes and other cleanupsSverker Eriksson
2011-02-03HALFWORD ETS Real matching on relative termsSverker Eriksson
2011-02-03HALFWORD first stab at high mem allocSverker Eriksson
2011-02-03HALFWORD ETS relative termsSverker Eriksson
In halfword emulator, make ETS use a variant of the internal term format that uses relative offsets instead of absolute pointers. This will allow storage in high memory (>4G). Preprocessor macros (like list_val_rel(TERM,BASE)) are used to make normal (fullword) emulator almost completely unchanged while still reusing most of the code.
2010-12-17Merge branch 'rickard/ets-no-write-refc/OTP-9000' into devRickard Green
* rickard/ets-no-write-refc/OTP-9000: Stop using reference counter when write accessing ETS-tables Conflicts: erts/emulator/beam/erl_db.c
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-16Stop using reference counter when write accessing ETS-tablesRickard Green
2010-12-16Safe deallocation of ETS-table structuresRickard Green
Ensure that all threads potentially accessing an ETS-table have dropped all references to the table before deallocating it.
2010-12-16Fix rwlock resource leak when hitting system limitRickard Green
2010-12-15Use new atomic types in emulatorRickard Green
2010-11-22ETS 'compressed' option.Sverker Eriksson
The compressed format is using a slighty modified variant of the extern format (term_to_binary). To not worsen key lookup's too much, the top tuple itself and the key element are not compressed. Table objects with only immediate non-key elements will therefor not gain anything (but actually consume one extra word for "alloc_size").
2010-10-07Fix newly introduced halfword emulator bugsRickard Green
2010-09-08Re-enable spin wait on ethreads rwlocksRickard Green
Spin wait on most ethread rwlocks used by the runtime system was unintentionally disabled during development. Spin wait has now been enabled again. This bug appeared in commit 59ee2a593090e7d53c97ceba63cbd300d1b9657e, i.e., it has not been seen in any released versions.
2010-08-10Rewrite ethread libraryRickard Green
Large parts of the ethread library have been rewritten. The ethread library is an Erlang runtime system internal, portable thread library used by the runtime system itself. Most notable improvement is a reader optimized rwlock implementation which dramatically improve the performance of read-lock/read-unlock operations on multi processor systems by avoiding ping-ponging of the rwlock cache lines. The reader optimized rwlock implementation is used by miscellaneous rwlocks in the runtime system that are known to be read-locked frequently, and can be enabled on ETS tables by passing the `{read_concurrency, true}' option upon table creation. See the documentation of `ets:new/2' for more information. The ethread library can now also use the libatomic_ops library for atomic memory accesses. This makes it possible for the Erlang runtime system to utilize optimized atomic operations on more platforms than before. Use the `--with-libatomic_ops=PATH' configure command line argument when specifying where the libatomic_ops installation is located. The libatomic_ops library can be downloaded from: http://www.hpl.hp.com/research/linux/atomic_ops/ The changed API of the ethread library has also caused modifications in the Erlang runtime system. Preparations for the to come "delayed deallocation" feature has also been done since it depends on the ethread library. Note: When building for x86, the ethread library will now use instructions that first appeared on the pentium 4 processor. If you want the runtime system to be compatible with older processors (back to 486) you need to pass the `--enable-ethread-pre-pentium4-compatibility' configure command line argument when configuring the system.
2010-03-10Correct the VM to work for more test suitesPatrik Nyblom
The following test suites now work: send_term_SUITE trace_nif_SUITE binary_SUITE match_spec_SUITE node_container_SUITE beam_literals_SUITE Also add a testcases for system_info({wordsize,internal|external}).
2010-03-10Make tracing and distribution workPatrik Nyblom
Rewrite trace code and external coding. Also slightly correct the interface to the match-spec engine to make tracing work. That will make the test suites runnable.
2010-03-10Add the BeamInstr data type for loaded BEAM codePatrik Nyblom
For cleanliness, use BeamInstr instead of the UWord data type to any machine-sized words that are used for BEAM instructions. Only use UWord for untyped words in general.
2010-03-10Store pointers to heap data in 32-bit wordsPatrik Nyblom
Store Erlang terms in 32-bit entities on the heap, expanding the pointers to 64-bit when needed. This works because all terms are stored on addresses in the 32-bit address range (the 32 most significant bits of pointers to term data are always 0). Introduce a new datatype called UWord (along with its companion SWord), which is an integer having the exact same size as the machine word (a void *), but might be larger than Eterm/Uint. Store code as machine words, as the instructions are pointers to executable code which might reside outside the 32-bit address range. Continuation pointers are stored on the 32-bit stack and hence must point to addresses in the low range, which means that loaded beam code much be placed in the low 32-bit address range (but, as said earlier, the instructions themselves are full words). No Erlang term data can be stored on C stacks (enforced by an earlier commit). This version gives a prompt, but test cases still fail (and dump core). The loader (and emulator loop) has instruction packing disabled. The main issues has been in rewriting loader and actual virtual machine. Subsystems (like distribution) does not work yet.
2010-03-10Fit all heap data into the 32-bit address rangePatrik Nyblom
This is the first step in the implementation of the half-word emulator, a 64-bit emulator where all pointers to heap data will be stored in 32-bit words. Code specific for this emulator variant is conditionally compiled when the HALFWORD_HEAP define has a non-zero value. First force all pointers to heap data to fall into a single 32-bit range, but still store them in 64-bit words. Temporary term data stored on C stack is moved into scheduler specific storage (allocated as heaps) and macros are added to make this happen only in emulators where this is needed. For a vanilla VM the temporary terms are still stored on the C stack.
2010-02-10Merge branch 'egil/lcnt' into ccase/r13b04_devErlang/OTP
* egil/lcnt: Add test suite for lcnt in tools Add lcnt:rt_opt/1 bindings to erts_debug Add runtime option to enable/disable lcnt stats Add auto width on string output Add lcnt documentation Add lock profiling tool OTP-8424 Add lock profiling tool. The Lock profiling tool, lcnt, can make use of the internal lock statistics when the runtime system is built with this feature enabled. This provides a mechanism to examine potential lock bottlenecks within the runtime itself. - Add erts_debug:lock_counters({copy_save, bool()}). This option enables or disables statistics saving for destroyed processes and ets-tables. Enabling this might consume a lot of memory. - Add id-numbering for lock classes which is otherwise undefined.
2010-02-08Add runtime option to enable/disable lcnt statsBjörn-Egil Dahlberg
Add erts_debug:lock_counters({copy_save, bool()}). This option enables or disables statistics saving for destroyed processes and ets-tables. Enabling this might consume a lot of memory. Add id-numbering for lock classes which is otherwise undefined.
2009-11-20The R13B03 release.OTP_R13B03Erlang/OTP