aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_alloc_util.c
AgeCommit message (Collapse)Author
2017-07-17erts: Replace usage of all erts_smp prefixes to just ertsLukas Larsson
2017-07-17erts: Remove ERTS_SMP and USE_THREAD definesLukas Larsson
This refactor was done using the unifdef tool like this: for file in $(find erts/ -name *.[ch]); do unifdef -t -f defile -o $file $file; done where defile contained: #define ERTS_SMP 1 #define USE_THREADS 1 #define DDLL_SMP 1 #define ERTS_HAVE_SMP_EMU 1 #define SMP 1 #define ERL_BITS_REENTRANT 1 #define ERTS_USE_ASYNC_READY_Q 1 #define FDBLOCK 1 #undef ERTS_POLL_NEED_ASYNC_INTERRUPT_SUPPORT #define ERTS_POLL_ASYNC_INTERRUPT_SUPPORT 0 #define ERTS_POLL_USE_WAKEUP_PIPE 1 #define ERTS_POLL_USE_UPDATE_REQUESTS_QUEUE 1 #undef ERTS_HAVE_PLAIN_EMU #undef ERTS_SIGNAL_STATE
2017-07-06Merge branch 'john/erts/runtime-lcnt' into maintJohn Högberg
* john/erts/runtime-lcnt: Document rt_mask and add warnings about copy_save Add an emulator test suite for lock counting Break erts_debug:lock_counters/1 into separate BIFs Allow toggling lock counting at runtime Move lock flags to a common header Enable register_SUITE for lcnt builds Enable lcnt smoke test on all builds that have lcnt enabled Make lock counter info independent of the locks being counted OTP-14412 OTP-13170 OTP-14413
2017-07-06Allow toggling lock counting at runtimeJohn Högberg
The implementation is still hidden behind ERTS_ENABLE_LOCK_COUNT, and all categories are still enabled by default, but the actual counting can be toggled at will. OTP-13170
2017-05-21erts: Make allocator functions staticSalikhov Dinislam
2017-05-04Update copyright yearRaimo Niskanen
2017-02-14Fixed typos in ertsAndrew Dryga
2016-12-02erts: Remove unnecessary 'enable_lcnt' option in locksBjörn-Egil Dahlberg
2016-11-23Merge branch 'maint'Rickard Green
* maint: Update etp-commands for dirty schedulers Fix scheduling of system tasks on processes executing dirty Fix call time tracing with dirty schedulers Fix send of exit signal to process executing dirty Fix dirty scheduler process priority Fix alloc-util hard-debug Silence debug warning when no beam jump table is used with dirty schedulers Fix check_process_code() when NifExport is in use Fix GC when NifExport is in use Fix saving of original arguments when rescheduling via NifExport Conflicts: erts/emulator/beam/beam_bif_load.c erts/emulator/beam/erl_nif.c
2016-11-23Merge branch 'rickard/dirty-scheduling-fixes' into maintRickard Green
OTP-14051 * rickard/dirty-scheduling-fixes: Update etp-commands for dirty schedulers Fix scheduling of system tasks on processes executing dirty Fix call time tracing with dirty schedulers Fix send of exit signal to process executing dirty Fix dirty scheduler process priority Fix alloc-util hard-debug Silence debug warning when no beam jump table is used with dirty schedulers Conflicts: erts/etc/unix/etp-commands.in
2016-11-22Fix alloc-util hard-debugRickard Green
2016-11-22Merge branch 'maint'Sverker Eriksson
2016-11-17erts: Fix all -Wundef errorsSverker Eriksson
2016-11-17erts: Refactor crash dumping with cbprintfSverker Eriksson
Instead of passing around a file descriptor use a function pointer to facilitate more advanced backend write logic such as size limitation or compression.
2016-10-17Merge branch 'sverker/hipe-code-loadnpurge/OTP-13968'Sverker Eriksson
* sverker/hipe-code-loadnpurge: (35 commits) erts: Cleanup dead code kernel,hipe: Fix dialyzer warnings erts: Replace unsafe Module.first_hipe_ref erts: Disable DBG_TRACE_MFA for debug build kernel: Fix code_SUITE:upgrade for non-hipe erts: Cleanup hipe trampoline code erts: Remove dead alloc stats in hipe_amd64.c erts: Remove code_SUITE:make_stub and make_stub_many_funs erts: Let code:make_stub_module raise 'notsup' erts: Fix bug in stack walk on risc erts: Fix old leak for ppc hipe code erts: Fix old leak for arm hipe code erts: Fix old leak of sparc hipe code erts: Fix old leak of hipe code on x86 32-bit erts: Enable exec_alloc for all hipe architectures erts: Remove debug printout for hipe loader state erts: Free hipe_refs and hipe_sdesc of a failed load erts: Refactor out hipe_purge_refs/sdesc erts: Refactor hipe_loader_state_dtor into a true destructor hipe: TRY fix llvm external calls to own module ...
2016-10-14erts: Enable exec_alloc for all hipe architecturesSverker Eriksson
For non-amd64 it's a "normal" allocator with a wrapper around mseg_alloc to call mprotect(PROT_EXEC).
2016-10-12erts: Add strict size assert to fix allocSverker Eriksson
and remove outdated min size adjustment. The is similar to lost commit 31bc414dc9639ccf94f9011ed32 except we now assume and assert strict size equality.
2016-04-26Merge branch 'lukas/erts/non-smp-debug-fixes/OTP-13047'Lukas Larsson
* lukas/erts/non-smp-debug-fixes/OTP-13047: erts: Fix incorrect non-smp debug assert erts: std_alloc is not thread safe on non-smp Conflicts: erts/emulator/beam/erl_alloc_util.c
2016-04-20Merge branch 'sverker/hipe-code-alloc'Sverker Eriksson
2016-04-20erts: Make sure literal MBCs have super aligned sizesSverker Eriksson
on 32-bit, as the granularity of the literal bit vector is super-alignment.
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-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-04-06erts: Add lttng tracepoints for memory carriersBjörn-Egil Dahlberg
* carrier_create * carrier_destroy * carrier_pool_put * carrier_pool_get
2016-03-29erts: Fix incorrect non-smp debug assertLukas Larsson
2016-03-15update copyright-yearHenrik Nord
2016-03-08Merge branch 'maint'Sverker Eriksson
2016-03-08erts: Fix alloc_SUITE:rbtree and migration for win64Sverker Eriksson
One little (unsigned long) left behind.
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-01-21erts: Add checks for thread safe allocationSverker Eriksson
Assert thread unsafe allocator is only created on non-smp and only called by the main thread. Removed test of unsafe allocator in custom thread.
2015-11-27Merge branch 'maint'Sverker Eriksson
2015-11-12erts: Add support for fast erts_is_literal()Sverker Eriksson
2015-11-10erts: Add alloc_SUITE:migrationSverker Eriksson
2015-10-01erts: Fix confusion of callbacks destroying_mbc() vs remove_mbc()Sverker Eriksson
Problem #1 Goodfit was crippled by the fact that destroying_mbc() was called _before_ the carriers was unlinked from mbc_list. Problem #2 destroying_mbc() was called for carriers that later could be resurrected from dc_list without a matching call to creating_mbc(). This was mostly a practical problem for the new test case alloc_SUITE:migration that use the callbacks to create/destroy a mutex. Solution: destroying_mbc() is now only called just before a carrier is destroyed (deallocated or put in mseg cache). remove_mbc() is called both (like before) when inserted into cpool but now also when last block is freed and mbc is scheduled for destruction but may later be resurrected from dc_list.
2015-10-01erts: Fix resurrection of carriers from dc_listSverker Eriksson
Problem #1: Seems the dc_list check did end up as dead code by mistake. Solution: goto check_dc_list Problem #2: crr->cpool.max_size was set to zero for all carriers in dc_list, which meant no carriers were ever resurrected by cpool_fetch. Solution: Do not use callback 'largest_fblk_in_mbc' to set max_size as it will always return 0 (due to problem #3). Problem #3: Resurrected carriers were broken as their one free block was not linked. Solution: Link free block when fetching carrier from dc_list.
2015-09-11erts: Cleanup main carrier creationSverker Eriksson
and remove that magic "-40" from default mmbcs for ll_alloc
2015-06-24erts: Remove HALFWORD_HEAP definitionBjörn-Egil Dahlberg
2015-06-18Change license text to APLv2Bruce Yinhe
2015-05-25Fix statistics reported about fix alloc typesRickard Green
2014-12-02erts: Add compile time assert ERTS_CT_ASSERTSverker Eriksson
and usage
2014-10-20erts: Fix bug causing mbc to be deleted from cpool before it was insertedSverker Eriksson
Set IN_POOL flag _after_ mbc has been actually inserted. Earlier it did not matter if IN_POOL was set early as it was not possible to find a carrier before is was fully inserted. Now when searching pooled_list and traitor_list we must make sure a found carrier has been fully inserted into cpool before removing it.
2014-10-06erts: Fix bug causing mbc removed from cpool to be used at pool entranceSverker Eriksson
Clear both IN_POOL and BUSY flags when empty carrier is removed is removed from pool to be destroyed. Earlier it was enough to leave BUSY flag set but now with pooled_list we must clear IN_POOL to avoid using it as cpool_entrance in cpool_fetch().
2014-10-03erts: Add pooled_list and traitor_listSverker Eriksson
2014-10-03erts: Fix bug when delayed deallocated carrier is reused by cpool_fetchSverker Eriksson
The delayed dealloc queue destroyes one word but cpool_fetch() is expected to return healthy carriers. So we restore that overwritten word with a little bit of hackish code.
2014-06-27erts: Fix size overflow bugs in memory allocationSverker Eriksson
2014-02-24erts: Make source file info available in lcLukas Larsson
2013-12-02Remove uninitialized use of new_crr in erl_alloc_utilAnthony Ramine
When the offending code is reached, new_crr is either uninitalized or have been set to NULL. This patch removes the following warning: beam/erl_alloc_util.c:3510:6: warning: variable 'new_crr' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (!(flags & CFLG_FORCE_MSEG)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~ beam/erl_alloc_util.c:3567:23: note: uninitialized use occurs here DEBUG_SAVE_ALIGNMENT(new_crr); ^~~~~~~ beam/erl_alloc_util.c:674:51: note: expanded from macro 'DEBUG_SAVE_ALIGNMENT' UWord algnmnt__ = sizeof(Unit_t) - (((UWord) (C)) % sizeof(Unit_t));\ ^ beam/erl_alloc_util.c:3510:2: note: remove the 'if' if its condition is always true if (!(flags & CFLG_FORCE_MSEG)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ beam/erl_alloc_util.c:3438:23: note: initialize the variable 'new_crr' to silence this warning Carrier_t *new_crr, *old_crr; ^ = NULL
2013-11-28Merge branch 'lukas/erts/supercarrier_fix/OTP-11149' into maintLukas Larsson
* lukas/erts/supercarrier_fix/OTP-11149: Improve error info when main carrier creation fails Conflicts: erts/emulator/test/alloc_SUITE.erl
2013-11-27Merge branch 'sverk/allctr-4byte-align-bug' into maintSverker Eriksson
* sverk/allctr-4byte-align-bug: erts: Fix alignment bug in allocator start code OTP-11496
2013-11-25Improve error info when main carrier creation failsLukas Larsson
Also fix testcase that failed due to main carrier creation failure.