summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/code_ix.c
Commit message (Collapse)AuthorAgeFilesLines
* erts: Modernize K&R-style functionsFrej Drejhammar2023-04-061-4/+4
| | | | | | Clang 16 now warns about functions using K&R syntax. Instead of juggling with compiler warning options, it is better to just bite the bullet and modernize the source code.
* erts: Fix overlapping blocking code barriers in the same tickJohn Högberg2023-03-201-6/+17
|
* Update copyright yearErlang/OTP2023-02-141-1/+1
|
* erts: Remove workaround for broken assertionJohn Högberg2023-02-011-23/+0
|
* Merge branch 'john/erts/instruction-synchronization-barriers/OTP-18418' into ↵John Högberg2023-02-011-0/+163
|\ | | | | | | | | | | | | | | | | | | john/erts/merge-isb-26 * john/erts/instruction-synchronization-barriers/OTP-18418: jit: Clear instruction cache ourselves jit: Refactor breakpoints jit: Issue ISBs on all schedulers when modifying code jit: Remove an eyesore
| * jit: Issue ISBs on all schedulers when modifying codeJohn Högberg2023-02-011-1/+164
| |
* | erts: Fix race in fun loadingJohn Högberg2022-12-121-85/+205
|/ | | | | | | | | | | | | | | | Because funs are tied to their canonical module rather than a specific instance of a module, they are "moved over" to the newest instance whenever we reload _the exact same module_ over itself. This quirk, together with how fun entries are updated when a module is loaded, caused a small window where it was possible for a holder of an "old" fun to call the new instance before it was fully loaded. This commit fixes that by versioning funs in roughly the same way we do exports. It also fixes a related bug where fun purging could be messed up if a new module instance was loaded in the middle of purging, solving the issue by disallowing code loading while purging a module with funs.
* Update copyright yearRickard Green2021-12-131-1/+1
|
* erts: Add forced trap for erts_try_seize_code_write_permissionSverker Eriksson2021-03-221-0/+15
| | | | for DEBUG and ADDRESS_SANITIZER
* erts: Make load_nif/2 nonblockingSverker Eriksson2020-02-041-17/+57
|
* Update copyright yearHenrik Nord2018-06-181-1/+1
|
* erts: Replace usage of all erts_smp prefixes to just ertsLukas Larsson2017-07-171-16/+16
|
* erts: Remove ERTS_SMP and USE_THREAD definesLukas Larsson2017-07-171-2/+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
* Allow toggling lock counting at runtimeJohn Högberg2017-07-061-1/+2
| | | | | | | | 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
* erts: Implement tracer modulesLukas Larsson2016-04-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* update copyright-yearHenrik Nord2016-03-151-1/+1
|
* Allow erlang:finish_loading/1 to load more than one moduleBjörn Gustavsson2016-02-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BIFs prepare_loading/2 and finish_loading/1 have been designed to allow fast loading in parallel of many modules. Because of the complications with on_load functions, the initial implementation of finish_loading/1 only allowed a single element in the list of prepared modules. finish_loading/1 does not suspend other processes, but it must wait for all schedulers to pass a write barrier ("thread progress"). The time for all schedulers to pass the write barrier is highly variable, depending on what kind of code they are executing. Therefore, allowing finish_loading/1 to finish the loading for more than one module before passing the write barrier could potentially be much faster than calling finish_loading/1 multiple times. The test case many/1 run on my computer shows that with "heavy load", finish loading of 100 modules in parallel is almost 50 times faster than loading them sequentially. With "light load", the gain is still almost 10 times. Here follows an actual sample of the output from the test case on my computer (an 2012 iMac): Light load ========== Sequential: 22361 µs Parallel: 2586 µs Ratio: 9 Heavy load ========== Sequential: 254512 µs Parallel: 5246 µs Ratio: 49
* Change license text to APLv2Bruce Yinhe2015-06-181-9/+10
|
* Optimized timer implementationRickard Green2015-05-081-2/+2
|
* ose,erts: Specify name for tsd keysLukas Larsson2014-02-241-1/+2
| | | | | This simplified debugging on OSE and also limits the number of ppdata keys that are created when beam is restarted.
* erts: Fix faulty lock check assertSverker Eriksson2012-09-071-6/+7
|
* erts: Refactor naming regarding code_write_permissionSverker Eriksson2012-08-311-22/+23
| | | | | The concept of code_write_permission is used by tracing as well and is not specific to code_ix.
* Make the lock check in erts_is_code_ix_locked() strongerBjörn Gustavsson2012-06-251-1/+15
| | | | | Make sure that the the currently running thread has the lock, not only that that some thread has the lock.
* erts: Fix faulty assert in non-smp debug vmSverker Eriksson2012-02-241-1/+2
| | | | "is_blocking" always returns true on non-smp
* erts: Refactor code loading with renamingSverker Eriksson2012-02-231-7/+5
| | | | | | | | | Rename lock_code_ix as seize_code_write_permission. Don't want to call it a "lock" as it can be held between schedulings and different threads and is not managed by lock checker. Rename "activate" staging as "commit" staging. Why not be consistent and use git terminology all the way.
* erts: Switch order between code_ix lock and thread blockingSverker Eriksson2012-02-231-0/+2
| | | | | | Make for simpler code when we just can block threads and continue without having to release code_ix lock and repeat code lookups to avoid race.
* erts: Refactor export staging lockSverker Eriksson2012-02-211-2/+3
| | | | Renamed it export_staging_lock and made change it to ordinary mutex.
* erts: Activate staged code in a thread safe waySverker Eriksson2012-02-211-12/+15
| | | | | | | Activation of staged code is scheduled for a later moment when all schedulers have done a full memory barrier. This allow them to read active code index while executing without any memory barriers at all.
* erts: Suspend processes waiting for code_ix lockSverker Eriksson2012-02-211-10/+47
| | | | | This will prevent blocking entrire schedulers in the rare case when several processes are racing to load/upgrade/delete/purge code.
* erts: Refactor code_ixSverker Eriksson2012-02-211-0/+110
Move implementation from beam_load into new file code_ix.c and module.c and make some function inline.