aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_alloc_util.c
AgeCommit message (Collapse)Author
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-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-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.
2013-11-25Merge branch 'rickard/acul-bug/OTP-11456' into maintRickard Green
* rickard/acul-bug/OTP-11456: Ensure carrier pool only accessed by schedulers
2013-11-20erts: Fix alignment bug in allocator start codeSverker Eriksson
Bug never released.
2013-11-05Add switch for disabling sys_alloc carriersRickard Green
The switch "+Musac <boolean>" controls if sys_alloc carriers are allowed.
2013-11-01Ensure carrier pool only accessed by schedulersRickard Green
Disable carrier pool for the thread safe allocator instance 0. This since non-managed threads allocates and deallocates memory in this instance, and only managed threads are allowed to access the carrier pool.
2013-09-30erts: erts_mmap supercarrier management and erts_mseg usageRickard Green
* Coalescing and trimming of free segments in supercarrier * Management of super aligned and super unaligned areas in supercarrier * Management of reservation of physical memory * erts_mseg usage of erts_mmap
2013-09-30erts: Refactor the ASSERT macroSverker Eriksson
Introduce unconditional ERTS_ASSERT and use that for both ASSERT and ASSERT_EXPR.
2013-09-25Merge branch 'rickard/aligned-sys_alloc-carriers/OTP-11318' into ↵Rickard Green
rickard/aligned-sys_alloc-carriers_maint/OTP-11318 Conflicts: erts/emulator/beam/erl_alloc.c erts/emulator/beam/erl_alloc_util.c erts/emulator/beam/erl_alloc_util.h
2013-09-25Implement platform specific aligned sys_alloc and use when supportedRickard Green
erts_sys_aligned_alloc() is currently implemented using posix_memalign if it exist, or using _aligned_malloc on Windows. If erts_sys_aligned_alloc() exist allocators will create sys_alloc carriers similar to how this was done pre-R16.
2013-08-23erts: Fix print out of acul option in crash dumpLukas Larsson
2013-06-10erts: Fix management of redirected carrier to deallocateRickard Green
2013-06-04erts: Carrier pool information in allocator informationRickard Green
That is, include information about carrier pool in result returned from erlang:system_info({allocator,allocator_sizes, _}).
2013-06-04erts: Use carrier pool for migration of carriersRickard Green
2013-06-04erts: Implement test case for carrier poolRickard Green
2013-06-04erts: Implement carrier poolRickard Green