aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_alloc.c
AgeCommit message (Collapse)Author
2017-07-17erts: Cleanup removal of non-smp emulatorsLukas 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-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-16Merge pull request #1436 from garazdawi/lukas/erts/remove_unused_functionsLukas Larsson
erts: Remove old unused functions
2017-05-16erts: Remove old unused functionsLukas Larsson
The functions have been found using: https://github.com/caolanm/callcatcher
2017-05-04Update copyright yearRaimo Niskanen
2017-04-18Remove accessor BIF timer implementationRickard Green
2017-02-20Merge branch 'master' into sverker/enif_selectSverker Eriksson
Conflicts: erts/emulator/beam/erl_binary.h erts/emulator/beam/erl_monitors.c erts/emulator/beam/erl_nif.c erts/emulator/beam/global.h erts/emulator/test/nif_SUITE_data/nif_SUITE.c
2017-02-13Magic indirectionRickard Green
2017-02-06Implement magic referencesRickard Green
Magic references are *intentionally* indistinguishable from ordinary references for the Erlang software. Magic references do not change the language, and are intended as a pure runtime internal optimization. An ordinary reference is typically used as a key in some table. A magic reference has a direct pointer to a reference counted magic binary. This makes it possible to implement various things without having to do lookups in a table, but instead access the data directly. Besides very fast lookups this can also improve scalability by removing a potentially contended table. A couple of examples of planned future usage of magic references are ETS table identifiers, and BIF timer identifiers. Besides future optimizations using magic references it should also be possible to replace the exposed magic binary cludge with magic references. That is, magic binaries that are exposed as empty binaries to the Erlang software.
2017-02-03Merge branch 'master' into sverker/enif_selectSverker Eriksson
2017-01-12Return and exception trace for nif-export scheduled BIFsRickard Green
The support is somewhat primitive, since it is determined at call time if trace on return or exception should be sent.
2016-11-30erts: Add enif_select & enif_open_resource_type_xSverker Eriksson
2016-11-22Merge branch 'maint'Sverker 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-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-14erts: Fill freed EXEC memory with illegal instructions on DEBUGSverker Eriksson
to get a nice SIGILL crash. For x86 and x86_64 only.
2016-05-17Merge branch 'sverker/hipe-amd64-code-alloc/OTP-13359'Sverker Eriksson
This merge is actually only some left overs. The bulk work for hipe-amd64-code-alloc has already been merge (without ticket number) at 42a1166b47721cd444.
2016-05-09Merge branch 'sverker/system_info-erts_mmap/OTP-13560'Sverker Eriksson
2016-05-04erts: Show exec_alloc as disabled when not usedSverker Eriksson
2016-05-04erts: Refactor ERTS_ALC_INFO_A_* constantsSverker Eriksson
as an enum and replace _MAX with _END
2016-05-04erts: Add Sender in 'receive' trace matchspecSverker Eriksson
All 'EXIT' and monitor messages are sent from 'system' Timeouts are "sent" from 'clock_service'
2016-05-04erts: Add macro HAVE_ERTS_MMAPSverker Eriksson
and make erts_mmap unavailable at compile time if not supported.
2016-04-29erts: Fix system_info({allocator_sizes, mseg_alloc})Sverker Eriksson
will now return [{instance,0,[{segments_size,9961472,9961472,11010048}]}, {instance,1,[{segments_size,6291456,6291456,6815744}]}, {instance,2,[{segments_size,524288,524288,786432}]}, {instance,3,[{segments_size,1048576,1048576,1835008}]}, {instance,4,[{segments_size,0,0,262144}]}] and not just empty lists.
2016-04-29erts: Add erts_mmap to system_info(allocator)Sverker Eriksson
to the Settings list {Allocator, Version, Features, Settings}
2016-04-29erts: Add literal_mmap and exec_mmap to system_infoSverker Eriksson
erlang:system_info(allocator) -> {Allocator, Version, Features, Settings} Features includes 'literal_mmap' and/or 'exec_mmap' if they exist.
2016-04-20erts: Produce statistics for literal and hipe super carriersSverker Eriksson
called 'literal_mmap' and 'exec_mmap'. Also moved existing erts_mmap info from 'mseg_alloc' to its own system_info({allocator, erts_mmap}) with "allocators" default_mmap, literal_mmap and exec_mmap.
2016-04-20Merge branch 'sverker/hipe-code-alloc'Sverker Eriksson
2016-04-15erts: Add 'exec_alloc' for hipe codeSverker Eriksson
that uses its own super carrier (erts_exec_mmapper) to guarantee low addressed and executable memory (PROT_EXEC). Currently only used on x86_64 that needs low memory for HiPE/AMD64's small code model. By initializing erts_exec_mapper early we secure its low memory area before erts_literal_mmapper might steal it.
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-15erts: Tweak defaults for literal allocatorSverker Eriksson
Reduce main carrier size and number of free descriptors.
2016-04-15erts: Implement tracer modulesLukas Larsson
Add the possibility to use modules as trace data receivers. The functions in the module have to be nifs as otherwise complex trace probes will be very hard to handle (complex means trace probes for ports for example). This commit changes the way that the ptab->tracer field works from always being an immediate, to now be NIL if no tracer is present or else be the tuple {TracerModule, TracerState} where TracerModule is an atom that is later used to lookup the appropriate tracer callbacks to call and TracerState is just passed to the tracer callback. The default process and port tracers have been rewritten to use the new API. This commit also changes the order which trace messages are delivered to the potential tracer process. Any enif_send done in a tracer module may be delayed indefinitely because of lock order issues. If a message is delayed any other trace message send from that process is also delayed so that order is preserved for each traced entity. This means that for some trace events (i.e. send/receive) the events may come in an unintuitive order (receive before send) to the trace receiver. Timestamps are taken when the trace message is generated so trace messages from differented processes may arrive with the timestamp out of order. Both the erlang:trace and seq_trace:set_system_tracer accept the new tracer module tracers and also the backwards compatible arguments. OTP-10267
2016-04-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-04-04Merge tag 'OTP-18.3.1'Henrik Nord
=== OTP-18.3.1 === Changed Applications: - erts-7.3.1 - inets-6.2.1 - mnesia-4.13.4 Unchanged Applications: - asn1-4.0.2 - common_test-1.12 - compiler-6.0.3 - cosEvent-2.2 - cosEventDomain-1.2 - cosFileTransfer-1.2 - cosNotification-1.2.1 - cosProperty-1.2 - cosTime-1.2.1 - cosTransactions-1.3.1 - crypto-3.6.3 - debugger-4.1.2 - dialyzer-2.9 - diameter-1.11.2 - edoc-0.7.18 - eldap-1.2.1 - erl_docgen-0.4.2 - erl_interface-3.8.2 - et-1.5.1 - eunit-2.2.13 - gs-1.6 - hipe-3.15 - ic-4.4 - jinterface-1.6.1 - kernel-4.2 - megaco-3.18 - observer-2.1.2 - odbc-2.11.1 - orber-3.8.1 - os_mon-2.4 - ose-1.1 - otp_mibs-1.1 - parsetools-2.1.1 - percept-0.8.11 - public_key-1.1.1 - reltool-0.7 - runtime_tools-1.9.3 - sasl-2.7 - snmp-5.2.2 - ssh-4.2.2 - ssl-7.3 - stdlib-2.8 - syntax_tools-1.7 - test_server-3.10 - tools-2.8.3 - typer-0.9.10 - webtool-0.9.1 - wx-1.6.1 - xmerl-1.3.10 Conflicts: OTP_VERSION erts/emulator/test/save_calls_SUITE.erl erts/vsn.mk
2016-03-16erts: Create erl_crash.dump when out of memoryLukas Larsson
This was accidentally removed in commit cd6903be0740db
2016-03-15update copyright-yearHenrik Nord
2016-03-08Merge branch 'sverk/literal-alloc-polish'Sverker Eriksson
* sverk/literal-alloc-polish: erts: Add emulator flag +MIscs for literal super carrier size erts: Refactor init of erts_literal_mmapper erts: Make literal_alloc documented and configurable
2016-03-01Merge branch 'sverk/halt-INT_MIN' into maintSverker Eriksson
OTP-13251 * sverk/halt-INT_MIN: erts: Make erlang:halt() accept bignums as Status erts: Change erl_exit into erts_exit kernel: Remove calls to erl_exit
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-02-23erts: Add emulator flag +MIscs for literal super carrier sizeSverker Eriksson
2016-02-23erts: Refactor init of erts_literal_mmapperSverker Eriksson
2016-02-23erts: Make literal_alloc documented and configurableSverker Eriksson
Except it cannot be disabled and cannot be multi-threaded. The bit-vector 'erts_literal_vspace_map' on 32-bit is currently only protected by the literal allocator mutex. We could allow multiple instances on 64-bit (I think), but what would be the point?
2016-02-08Merge branch 'sverk/thread-unsafe-alloc'Sverker Eriksson
* sverk/thread-unsafe-alloc: erts: Fix faulty assert for non-smp erts: Add checks for thread safe allocation
2016-02-03Merge branch 'maint'Lukas Larsson
* maint: erts: When erts_alloc fails, the emulator no longer aborts
2016-02-02erts: Add ERTS_WRITE_UNLIKELYLukas Larsson
ERTS_WRITE_UNLIKELY can be used to place global variables in a specific section where only data that is very rarely modified sits. This is used to improve cache locality.
2016-01-27erts: When erts_alloc fails, the emulator no longer abortsLukas Larsson
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-12-08Merge branch 'rickard/ohmq-fixup/OTP-13047'Rickard Green
* rickard/ohmq-fixup/OTP-13047: Replace off_heap_message_queue option with message_queue_data option Always use literal_alloc Distinguish between GC disabled by BIFs and other disabled GC Fix process_info(_, off_heap_message_queue) Off heap message queue test suite Remove unused variable Fix memory leaks
2015-12-08Always use literal_allocRickard Green