aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_bif_load.c
AgeCommit message (Collapse)Author
2015-06-18Change license text to APLv2Bruce Yinhe
2015-06-10Merge branch 'egil/fix-purge-literals/OTP-12821'Björn-Egil Dahlberg
* egil/fix-purge-literals/OTP-12821: erts: Fix garbage collect literals in code purge
2015-05-25erts: Fix garbage collect literals in code purgeBjörn-Egil Dahlberg
During code purging and check_process_code, the checking of the binary reference embedded in the match binary state was omitted for the tracing tests. This would cause the binary match state to reference deallocated memory.
2015-05-08Merge branch 'rickard/timer-optimization/OTP-12650'Rickard Green
* rickard/timer-optimization/OTP-12650: Optimized timer implementation Reusable red-black tree implementation Conflicts: erts/emulator/beam/erl_bif_timer.c
2015-05-08Optimized timer implementationRickard Green
2015-05-07Add module_info entry for native codeRichard Carlsson
2014-02-24Added support for ENEA OSELukas Larsson
This port has support for both non-smp and smp. It contains a new way to do io checking in which erts_poll_wait receives the payload of the polled entity. This has implications for all linked-in drivers.
2013-11-18Functionality for disabling garbage collectionRickard Green
Being able to disable garbage collection over context switches vastly simplifies implementation of yielding native code that builds large or complex data structures on the heap. This since the heap can be left in an inconsistent state over the context switch.
2013-11-18Execution of system tasks in context of another processRickard Green
A process requesting a system task to be executed in the context of another process will be notified by a message when the task has executed. This message will be on the form: {RequestType, RequestId, Pid, Result}. A process requesting a system task to be executed can set priority on the system task. The requester typically set the same priority on the task as its own process priority, and by this avoiding priority inversion. A request for execution of a system task is made by calling the statically linked in NIF erts_internal:request_system_task(Pid, Prio, Request). This is an undocumented ERTS internal function that should remain so. It should *only* be called from BIF implementations. Currently defined system tasks are: * garbage_collect * check_process_code Further system tasks can and will be implemented in the future. The erlang:garbage_collect/[1,2] and erlang:check_process_code/[2,3] BIFs are now implemented using system tasks. Both the 'garbage_collect' and the 'check_process_code' operations perform or may perform garbage_collections. By doing these via the system task functionality all garbage collect operations in the system will be performed solely in the context of the process being garbage collected. This makes it possible to later implement functionality for disabling garbage collection of a process over context switches. Newly introduced BIFs: * erlang:garbage_collect/2 - The new second argument is an option list. Introduced option: * {async, RequestId} - making it possible for users to issue asynchronous garbage collect requests. * erlang:check_process_code/3 - The new third argument is an option list. Introduced options: * {async, RequestId} - making it possible for users to issue asynchronous check process code requests. * {allow_gc, boolean()} - making it possible to issue requests that aren't allowed to garbage collect (operation will abort if gc should be needed). These options have been introduced as a preparation for parallelization of check_process_code operations when the code_server is about to purge a module.
2013-02-22Update copyright yearsBjörn-Egil Dahlberg
2013-02-18erts: Fix code:is_module_nativeSverker Eriksson
code:is_module_native returned false for hipe compiled module if the first function in the module was a BIF stub
2013-01-28erts: Fix ASSERT crash in erts_try_seize_code_write_permissionSverker Eriksson
ASSERT(code_writing_process != c_p); The assert was actually harmless and could be removed as one solution. But I think it's better to keep it as a way to catch bugs that would otherwise lead to horrible deadlocks if a thread "forgets" to call erts_release_code_write_permission(). As a result erts_release_code_write_permission() must be called BEFORE resuming the suspended process.
2012-12-07Merge branch 'rickard/port-optimizations/OTP-10336' into ↵Rickard Green
rickard/r16/port-optimizations/OTP-10336 * rickard/port-optimizations/OTP-10336: Change annotate level for emacs-22 in cerl Update etp-commands Add documentation on communication in Erlang Add support for busy port message queue Add driver callback epilogue Implement true asynchronous signaling between processes and ports Add erl_drv_[send|output]_term Move busy port flag Use rwlock for driver list Optimize management of port tasks Improve configuration of process and port tables Remove R9 compatibility features Use ptab functionality also for ports Prepare for use of ptab functionality also for ports Atomic port state Generalize process table implementation Implement functionality for delaying thread progress from unmanaged threads Conflicts: erts/doc/src/erl_driver.xml erts/doc/src/erlang.xml erts/emulator/beam/beam_bif_load.c erts/emulator/beam/beam_bp.c erts/emulator/beam/beam_emu.c erts/emulator/beam/bif.c erts/emulator/beam/copy.c erts/emulator/beam/erl_alloc.c erts/emulator/beam/erl_alloc.types erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_bif_port.c erts/emulator/beam/erl_bif_trace.c erts/emulator/beam/erl_init.c erts/emulator/beam/erl_message.c erts/emulator/beam/erl_port_task.c erts/emulator/beam/erl_process.c erts/emulator/beam/erl_process.h erts/emulator/beam/erl_process_lock.c erts/emulator/beam/erl_trace.c erts/emulator/beam/export.h erts/emulator/beam/global.h erts/emulator/beam/io.c erts/emulator/sys/unix/sys.c erts/emulator/sys/vxworks/sys.c erts/emulator/test/port_SUITE.erl erts/etc/unix/cerl.src erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/prim_inet.beam erts/preloaded/src/prim_inet.erl lib/hipe/cerl/erl_bif_types.erl lib/kernel/doc/src/inet.xml lib/kernel/src/inet.erl
2012-12-03Generalize process table implementationRickard Green
2012-10-05Merge branch 'sverk/code-load-refactor-later-op'Sverker Eriksson
* sverk/code-load-refactor-later-op: erts: Fix faulty lock check assert erts: Refactor naming regarding code_write_permission erts: Refactor tracing to use erts_schedule_thr_prgr_later_op erts: Allow thr_prgr_later_op to reschedule erts: Refactor code loading to use erts_schedule_thr_prgr_later_op erts: Remove some compiler warnings
2012-08-31erts: Refactor code loading to use erts_schedule_thr_prgr_later_opSverker Eriksson
2012-08-31Merge branch 'maint'Björn-Egil Dahlberg
Conflicts: lib/diameter/autoconf/vxworks/sed.general xcomp/README.md
2012-08-31Update copyright yearsBjörn-Egil Dahlberg
2012-06-25Don't go to single-scheduler mode when managing breakpointsBjörn Gustavsson
Calls to erlang:set_trace_pattern/3 will no longer block all other schedulers. We will still go to single-scheduler mode when new code is loaded for a module that is traced, or when loading code when there is a default trace pattern set. That is not impossible to fix, but that requires much closer cooperation between tracing BIFs and the loader BIFs.
2012-06-20Merge branch 'maint'Rickard Green
* maint: Fix faulty use of thread progress in handle_aux_work() Conflicts: erts/emulator/beam/erl_process.c Needed modifications: erts/emulator/beam/beam_bif_load.c
2012-06-04Merge branch 'maint'Lukas Larsson
* maint: Remove stale code for hybrid heap and incremental GC Remove the hipe_bifs:show_message_area/0 BIF Remove support for erlang:system_info(global_heaps_size) Remove the erlang:garbage_collect_message_area/0 BIF Remove workarounds for hybrid and shared heaps in test suites Conflicts: erts/doc/src/erlang.xml erts/emulator/beam/erl_message.c erts/emulator/beam/erl_process.c erts/emulator/beam/erl_process.h erts/emulator/hipe/hipe_bif2.tab lib/hipe/cerl/erl_bif_types.erl
2012-05-10Remove stale code for hybrid heap and incremental GCBjörn Gustavsson
The hybrid heap emulator was last working in the non-SMP R11B run-time system. When the constant pools were introduced in R12B, the hybrid heap emulator was not updated to handle them. At this point, the harm from reduced readability of the code is greater than any potential usefulness of keeping the code.
2012-03-06erts: Fix memory leak in code loadingSverker Eriksson
All magic binaries returned by prepare_loading/2 was leaking. prepare_loading/2 left the reference count as 2 of the magic binary when it should be 1 (only owned by the returned term).
2012-02-24erts: Set correct default tracing when loading codeSverker Eriksson
Default trace (on_load) was lost in commit 64bcf5db63d73fe when load_module/2 was split.
2012-02-23erts: Use correct macro for "yield-return"Sverker Eriksson
2012-02-23erts: Refactor code loading with renamingSverker Eriksson
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.
2012-02-23erts: Switch order between code_ix lock and thread blockingSverker Eriksson
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.
2012-02-21erts: Fix race bug in finish_after_on_loadSverker Eriksson
Must block system before looking up module to not race with other "code upgrader".
2012-02-21erts: Activate staged code in a thread safe waySverker Eriksson
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.
2012-02-21erts: Suspend processes waiting for code_ix lockSverker Eriksson
This will prevent blocking entrire schedulers in the rare case when several processes are racing to load/upgrade/delete/purge code.
2012-02-21erts: Fix single threaded fallback in new BIF finish_loading_1Sverker Eriksson
Must "start staging" even when we go single threaded.
2012-02-21Break apart erlang:load_module/2 into two separate BIFsBjörn Gustavsson
Introduce two new BIFs, erlang:prepare_loading/2 and erlang:finish_loading/1, and re-implement erlang:load_module/2 in Erlang code. We have two reasons for doing this: * To facilitate suspending a process if another process is already doing code loading. * In the future, we can implement parallel and atomic loading of several modules. Atomic loading works except for modules with on_load handlers. Because of that issue, erlang:finish_loading/2 will currently only accept a list with a single magic binary.
2012-02-21Use magic binaries in erts_prepare_loading() and erts_finish_loading()Björn Gustavsson
2012-02-21erts: Cleanup non-blocking loadSverker Eriksson
2012-02-21erts: Fix tracing bug for new non-blocking loadSverker Eriksson
Made on_load-tracing always set after commit on active code_ix when system is still blocked. Bug caused cprof_SUITE:on_load to fail.
2012-02-21erts: Fallback to blocking upgrade when tracing is enabledSverker Eriksson
2012-02-21erts: Keep count of number of global traced functions per moduleSverker Eriksson
2012-02-21erts: Move number-of-breakpoint counter from code to Module structSverker Eriksson
The is a refactoring in preparation to add a counter in Module struct for export entry tracing. It is nicer if the two are kept together.
2012-02-21erts: Rename "loader" code_ix as "staging" code_ixSverker Eriksson
Staging is a better and more general name as does not necessary need to involve code loading (can be deletion, tracing, etc).
2012-02-21erts: Fix purge of module with loaded nif librarySverker Eriksson
Easy fallback solution that goes single threaded if the module to be purged has a loaded nif lib.
2012-02-21erts: Fix case of breakpoint when deleting moduleSverker Eriksson
2012-02-21erts: Call erts_export_consolidate automaticallySverker Eriksson
Renamed merge_secondary_table and called by export_start_load
2012-02-21First try at non-blocking code loading!Sverker Eriksson
Implemented some code_ix locks and commented calls to erts_smp_thr_progress_block()
2012-02-21BEAM loader: Break out handling of ranges into beam_ranges.cBjörn Gustavsson
Having the entire implementation of range handling (address table) in one source file will help when we'll need to update the ranges without stopping all schedulers in the next commit.
2012-02-21erts: Fix code_ix handling and locking for some more bifsSverker Eriksson
2012-02-21erts: Multiple module tables using code_ixSverker Eriksson
2012-02-21erts: Use several addresses in each ExportSverker Eriksson
2012-02-21erts: Multiple export tab's using code_ixSverker Eriksson
Still blocking code loading
2012-02-21erts: First stab at code_ix interface and beam_catches using itSverker Eriksson
Code loading still blocking
2012-02-21erts: Refactor Module structSverker Eriksson