Age | Commit message (Collapse) | Author |
|
|
|
For non-amd64 it's a "normal" allocator with a
wrapper around mseg_alloc to call mprotect(PROT_EXEC).
|
|
creation and destruction.
|
|
|
|
from hipe_purge_module.
|
|
that is only called once.
Basically switch hipe_free_loader_state and hipe_loader_state_dtor.
|
|
Did not work with purge and made worse by new purge strategy.
Did yield terrible performance when fun thing is created *before*
fun code is loaded. Like when receiving not yet loaded fun
from other node. The cached 'native_address' in ErlFunThing
will not be updated leading to mode switch and error_handler
being called for every call to the fun from native code.
|
|
by introducing hipe_bifs:commit_patch_load/1
that creates the HipeModule.
|
|
|
|
|
|
to get a nice SIGILL crash.
For x86 and x86_64 only.
|
|
This is part of commit 1bd508921dd93086b05e7d0038b816b36c421d86.
I did not include the fun-checking as we have a new purge strategy
for funs in OTP 20. That remains to be solved some other way for hipe.
|
|
Just like the BEAM loader state (as returned by
erlang:prepare_loading/2), the HiPE loader state is contained in a magic
binary.
Eventually, we will separate HiPE loading into a prepare and a finalise
phase, like the BEAM loader, where the prepare phase will be implemented
by hipe_unified_loader and the finalise phase be implemented in C by
hipe_load.c and beam_load.c, making prepare side-effect free and
finalise atomic. The finalise phase will be exposed through the
erlang:finish_loading/1 API, just like the BEAM loader, as this will
allow HiPE and BEAM modules to be mixed in the same atomic "commit".
The usage of a loader state makes it easier to keep track of all
resources allocated during loading, and will not only make it easy to
prevent leaks when hipe_unified_loader crashes, but also paves the way
for proper, leak-free, unloading of HiPE modules.
|
|
and hipe_bifs:update_code_size
|
|
A step toward better integration of hipe load and purge
Highlights:
* code_server no longer needs to call hipe_unified_loader:post_beam_load/1
Instead new internal function hipe_redirect_to_module()
is called by loading BIFs to patch native call sites if needed.
* hipe_purge_module() is called by erts_internal:purge_module/2
to purge any native code.
* struct hipe_mfa_info redesigned and only used for exported
functions that are called from or implemented by native code.
A list of native call sites (struct hipe_ref) are kept for each hipe_mfa_info.
* struct hipe_sdesc used by hipe_find_mfa_from_ra()
to build native stack traces.
|
|
with a copy_module() function.
|
|
|
|
|
|
|
|
|
|
|
|
* sverker/remove-nif-reload:
erts: Cuddle nif_SUITE:consume_timeslice
erts: Remove old doc note for erlang:load_nif
erts: Remove deprecated nif 'reload' feature
erts: Fix trace_nif_SUITE to load nif lib only once
|
|
* sverker/include-erl_nif/PR-1171:
Use more correct delimiters for erl_nif.h include
|
|
* sverker/ets-load-factor:
erts: Unify reduction count for ets:select
stdlib: Cuddle ets_SUITE for valgrind
stdlib: Fix ets_SUITE:smp_select_delete
erts: Tweak ets grow/shrink to keep up at contention
erts: Fix ets_SUITE:memory
erts: Suppress failed ETS memory checks
erts: Reduce ets hash load factor
erts: Enable a smaller first hash segment for ets
erts: Redesign ets with separate segment tables
erts: Remove unnecessary access of 'is_resizing'
erts: Add ErtsSizeofMember macro
erts: Add ErtsContainerStruct_ for array members
|
|
Anywhere but the beam sources we shouldn't #include "erl_nif.h", because
what "erl_nif.h" does is: (1) fail to find it outside of -I dirs, (2)
then treat it as if it was written like <erl_nif.h>. Using <erl_nif.h>
skips (1).
More information can be found in 6.10.2 of the C standard.
Because the examples use "erl_nif.h", NIF projects in the Erlang
ecosystem copy this verbatim and make the same mistake.
|
|
to be per object as the other select-variants
and not per table slot.
|
|
|
|
by simply asking for the size of struct ext_segtab
|
|
due to the grow/shrink hysteresis of the meta tables
|
|
for faster lookup/insert/delete
at the expense of about one word per object.
|
|
|
|
* Keep it simple(r)
* To prepare for both dynamic sized segments and segtabs
|
|
in tables without write_concurrency
and remove it totally #ifndef ERTS_SMP
|
|
(in case it matters)
|
|
|
|
and instead let erlang:load_nif/2 return {error, {reload, _}}
before even trying to load the library
if a NIF library has already been successfully loaded
for the calling module instance.
|
|
|
|
* raimo/diffserv-socket-option/OTP-13582:
Tune 'tclass' semantics
Implement IPV6_TCLASS
|
|
|
|
* maint:
erts: Add nif_SUITE:t_on_load
erts: Improve nif_SUITE:upgrade test
Don't leak old code when loading a modules with an on_load function
Conflicts:
erts/preloaded/ebin/erts_code_purger.beam
erts/preloaded/ebin/erts_internal.beam
erts/preloaded/src/erts_code_purger.erl
|
|
* bjorn/erts/on_load/ERL-240/OTP-13893:
erts: Add nif_SUITE:t_on_load
erts: Improve nif_SUITE:upgrade test
Don't leak old code when loading a modules with an on_load function
|
|
Conflicts:
OTP_VERSION
|
|
|
|
|
|
|
|
|
|
to include upgrade from deleted (old) module instance
|
|
Normally, calling code:delete/1 before re-loading the code for a
module is unnecessary but causes no problem.
But there will be be problems if the new code has an on_load function.
Code with an on_load function will always be loaded as old code
to allowed it to be easily purged if the on_load function would fail.
If the on_load function succeeds, the old and current code will be
swapped.
So in the scenario where code:delete/1 has been called explicitly,
there is old code but no current code. Loading code with an
on_load function will cause the reference to the old code to be
overwritten. That will at best cause a memory leak, and at worst
an emulator crash (especially if NIFs are involved).
To avoid that situation, we will put the code with the on_load
function in a special, third slot in Module.
ERL-240
|
|
* maint:
Ensure long enough sleep in driver_SUITE:timer_delay driver
|
|
* rickard/test-cuddle:
Ensure long enough sleep in driver_SUITE:timer_delay driver
|