summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/erl_alloc_util.h
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright yearErlang/OTP2022-10-241-1/+1
|
* erts: Add acful, abandon carried free utilization limitLukas Larsson2022-10-211-0/+5
| | | | | | | | | | | | | | | | | | This limit can be used to let erts_alloc know that it should use MADV_FREE on any pages within a carrier that are currently unused. Before this change we have tried to have this as default, but that caused performance issues as carriers oscillated in and out of the migration pool. So in 25 we decided to remove it. However, this caused MemAvailable from /proc/memory to become significantly lower and thus machines that have a tight memory budget need this option. So the solution is to add a new config option where the user can set at which utilization limit that free pages in a carrier should be placed in MemAvailable. The option is by default set to 0, to mimic the behaviour of OTP 25.
* Update copyright yearRickard Green2021-12-131-1/+1
|
* Allocator instances for dirty schedulersRickard Green2021-11-161-3/+4
|
* erts: Decrease super alignment on 64-bitSverker Eriksson2021-04-281-1/+1
| | | | From 256kb to 16kb.
* erts: Skip main carrier for ets_alloc instance 0Sverker Eriksson2021-04-281-0/+3
| | | | | Don't think instance 0 of ets_alloc is ever used, at least ets_SUITE never used it.
* erts: Remove unused MIN_MBC_FIRST_FREE_SZSverker Eriksson2021-04-281-1/+0
| | | | Don't even know what the original meaning was.
* otp: Remove HiPE and HiPE-related accessoriesJohn Högberg2020-11-091-6/+0
|
* Merge branch 'rickard/small-memory-build-fix/OTP-16939' into maintRickard Green2020-10-151-0/+2
|\ | | | | | | | | * rickard/small-memory-build-fix/OTP-16939: Fix SMALL_MEMORY build
| * Fix SMALL_MEMORY buildRickard Green2020-10-131-0/+2
| |
* | Merge branch 'rickard/carrier-pools/OTP-16856' into maintRickard Green2020-10-011-0/+21
|\ \ | |/ | | | | | | * rickard/carrier-pools/OTP-16856: Multiple carrier pools
| * Multiple carrier poolsRickard Green2020-09-251-0/+21
| |
* | erts: Fix LTTng allocation statisticsJohn Högberg2020-03-261-8/+26
| | | | | | | | | | This broke when refactoring carrier statistics to allow cross-carrier migration.
* | Merge branch 'maint'Rickard Green2020-03-131-1/+1
|\ \ | |/ | | | | | | * maint: Update copyright year
| * Update copyright yearRickard Green2020-03-131-1/+1
| |
* | erts: Include block types in allocation statisticsJohn Högberg2020-01-071-17/+26
|/ | | | | | | | | | Now that carriers can migrate freely, a binary allocator may find itself responsible for a bunch of heap fragments. We used to present such blocks as if they were still in the pool ("foreign blocks") but it was a bit too counter-intuitive. This commit presents all blocks on the allocator that employs their carrier, regardless of their type.
* erts_alloc: Fix header packing on Win64John Högberg2019-04-291-1/+3
|
* erts_alloc: Fix incorrect header word packingJohn Högberg2019-04-241-2/+3
|
* Mark free blocks in pooled carriers as unused (MADV_FREE)John Högberg2018-12-071-1/+3
| | | | | | | | | This lets the OS reclaim the physical memory associated with these blocks which reduces the impact of long-lived awkward allocations. A small allocated block will still keep a huge carrier alive, but the unused part of the carrier will now be available to the OS. Co-authored-by: Dmytro Lytovchenko <dmytro.lytovchenko@erlang-solutions.com>
* Allow cross-type carrier migrationJohn Högberg2018-06-281-27/+54
|
* Update copyright yearHenrik Nord2018-06-181-1/+1
|
* erts: Let allocator pooled_tree also use Age OrderSverker Eriksson2018-05-221-0/+4
| | | | | | | | | | | | | if configured for the allocator. This was not implemented and pooled_tree always used address order first fit. The "problem" was as a carrier can be part of both the pooled tree (of its owner) and the allocation tree (of a foreign instance) at the same time. Solved by duplicating 'birth_time' in both AOFF_RBTree_t nodes for each carrier. Blocks still cannot use age order and does not pay any memory cost for birth_time.
* erts: Rewrite memory instrumentationJohn Högberg2018-04-231-0/+35
| | | | | | | | | | | | | | | | | | | | | | This commit replaces the old memory instrumentation with a new implementation that scans carriers instead of wrapping erts_alloc/erts_free. The old implementation could not extract information without halting the emulator, had considerable runtime overhead, and the memory maps it produced were noisy and lacked critical information. Since the new implementation walks through existing data structures there's no longer a need to start the emulator with special flags to get information about carrier utilization/fragmentation. Memory fragmentation is also easier to diagnose as it's presented on a per-carrier basis which eliminates the need to account for "holes" between mmap segments. To help track allocations, each allocation can now be tagged with what it is and who allocated it at the cost of one extra word per allocation. This is controlled on a per-allocator basis with the +M<S>atags option, and is enabled by default for binary_alloc and driver_alloc (which is also used by NIFs).
* Merge PR-1699 from sverker/hipe-amd64-high-code/OTP-14951Sverker Eriksson2018-03-131-1/+1
|\ | | | | Remove low memory need for HiPE on x86_64
| * erts: Remove hipe amd64 code super carrier (exec_mmap)Sverker Eriksson2018-03-051-1/+1
| |
* | Merge 'sverker/maint-20/alloc-n-migration/ERIERL-88'Sverker Eriksson2018-02-121-53/+100
|\ \ | |/ |/| | | into 'sverker/master/alloc-n-migration/ERIERL-88'
| * Merge 'sverker/maint-19/alloc-n-migration/ERIERL-88'Sverker Eriksson2018-02-121-56/+107
| |\ | | | | | | | | | | | | | | | | | | | | | | | | into 'sverker/maint-20/alloc-n-migration/ERIERL-88' OTP-14915 OTP-14916 OTP-14917 OTP-14918
| | * Merge 'sverker/carrier-migration-improvements'Sverker Eriksson2018-02-121-55/+93
| | |\ | | | | | | | | | | | | into 'sverker/maint-19/alloc-n-migration/ERIERL-88'
| | | * erts: Add more stats for mbcs_poolSverker Eriksson2017-12-201-0/+11
| | | | | | | | | | | | | | | | similar to the ones in OTP-19.2.3.1
| | | * erts: Improve carrier pool searchSverker Eriksson2017-12-201-12/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Give back carrier to owner when put in pool with use of dd-queue. * Replace pooled_list with pooled_tree for more efficient search of all owned pooled carriers. * Remove traitor_list as it does not serve much purpose anymore. * Add HOMECOMING bit flag in crr->allctr atomic to (1) avoid double enqueue into dd-enqueue. (2) trigger read barrier in get_used_allctr for newly received carriers.
| | | * erts: Refactor carrier dealloc migrationSverker Eriksson2017-12-201-50/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | by adding a dedicated 'homecoming_dd_block' to use in dd-queue. + Preparation for dd-queue-migration of non-empty carriers. + Get rid of ugly hack where blk->carrier pointer is overwritten by dd-queue and then have to be restored.
| | * | erts: Add system_flags(erts_alloc,"+M?sbct *")Sverker Eriksson2018-02-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | to change sbct limit in runtime for chosen allocator type. With great power comes great responsibility.
| | * | erts: Add migration options "acnl" and "acfml"Sverker Eriksson2018-02-081-2/+10
| | |/ | | | | | | | | | | | | acnl: Abandon Carrier Nr Limit acfml: Abandon Carrier Free block Min Limit
* | | Merge branch 'maint'John Högberg2017-09-111-4/+0
|\ \ \ | |/ /
| * | Replace ad-hoc MIN/MAX macros with common onesJohn Högberg2017-09-071-4/+0
| | | | | | | | | | | | | | | | | | Besides being noisy, they were already defined by a global Unix- specific header, causing the Windows build to fail if one forgot to define them.
* | | erts: Replace usage of all erts_smp prefixes to just ertsLukas Larsson2017-07-171-2/+2
| | |
* | | erts: Remove ERTS_SMP and USE_THREAD definesLukas Larsson2017-07-171-22/+0
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge branch 'john/erts/runtime-lcnt' into maintJohn Högberg2017-07-061-1/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * | Allow toggling lock counting at runtimeJohn Högberg2017-07-061-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Update copyright yearHans Nilsson2017-06-141-1/+1
| | |
* | | erts: Make allocator functions staticSalikhov Dinislam2017-05-211-7/+0
|/ /
* | Merge branch 'maint'Sverker Eriksson2016-11-221-5/+5
|\ \ | |/
| * erts: Refactor crash dumping with cbprintfSverker Eriksson2016-11-171-5/+5
| | | | | | | | | | | | Instead of passing around a file descriptor use a function pointer to facilitate more advanced backend write logic such as size limitation or compression.
* | erts: Enable exec_alloc for all hipe architecturesSverker Eriksson2016-10-141-0/+6
|/ | | | | For non-amd64 it's a "normal" allocator with a wrapper around mseg_alloc to call mprotect(PROT_EXEC).
* Merge branch 'sverker/hipe-code-alloc'Sverker Eriksson2016-04-201-11/+13
|\
| * erts: Make sure literal MBCs have super aligned sizesSverker Eriksson2016-04-201-8/+8
| | | | | | | | | | on 32-bit, as the granularity of the literal bit vector is super-alignment.
| * erts: Refactor callbacks for literal mseg allocSverker Eriksson2016-04-151-3/+5
| | | | | | | | | | Make the callbacks more general to be usable for any allocator that that uses its own ErtsMemMapper.
* | Merge branch 'henrik/update-copyrightyear'Henrik Nord2016-04-131-1/+1
|\ \ | |/ |/| | | | | * henrik/update-copyrightyear: update copyright-year
| * update copyright-yearHenrik Nord2016-03-151-1/+1
| |
* | erts: Add lttng tracepoints for memory carriersBjörn-Egil Dahlberg2016-04-061-0/+13
|/ | | | | | | * carrier_create * carrier_destroy * carrier_pool_put * carrier_pool_get