Age | Commit message (Collapse) | Author |
|
The ethread atomics API now also provide double word size atomics.
Double word size atomics are implemented using native atomic
instructions on x86 (when the cmpxchg8b instruction is available)
and on x86_64 (when the cmpxchg16b instruction is available). On
other hardware where 32-bit atomics or word size atomics are
available, an optimized fallback is used; otherwise, a spinlock,
or a mutex based fallback is used.
The ethread library now performs runtime tests for presence of
hardware features, such as for example SSE2 instructions, instead
of requiring this to be determined at compile time.
There are now functions implementing each atomic operation with the
following implied memory barrier semantics: none, read, write,
acquire, release, and full. Some of the operation-barrier
combinations aren't especially useful. But instead of filtering
useful ones out, and potentially miss a useful one, we implement
them all.
A much smaller set of functionality for native atomics are required
to be implemented than before. More or less only cmpxchg and a
membar macro are required to be implemented for each atomic size.
Other functions will automatically be constructed from these. It is,
of course, often wise to implement more that this if possible from a
performance perspective.
|
|
|
|
* rickard/driver_async_cancel/OTP-9302:
Fix driver_async_cancel()
|
|
|
|
* sverker/hipe-misc-fixing/OTP-9298:
hipe_mkliterals print argv[0] in generated files
Fix code:is_module_native segv on deleted module
lock checking fix in hipe_bif2.c
|
|
* rickard/barriers/OTP-9281:
Silence warnings
Fix build with hipe on amd64
Reduce number of atomic ops
Use 32-bit atomic for port snapshot
Remove pointless erts_ports_alive variable
Ensure quick break
Ensure that all rehashing information are seen when done
Ensure that stack updates are seen when stack is released
Add needed barriers for write_concurrency tables
Homogenize memory barriers on atomics
|
|
|
|
|
|
Counters for active, and used schedulers have been coalesced in
order to reduce the amount of atomic operations needed.
Some currently not strictly necessary barriers have also been added
in order to be future proof.
|
|
|
|
|
|
This is not a bugfix. The change is done in order to avoid a
future bug.
|
|
Ets tables using ordered_set could potentially get into an
internally inconsistent state.
|
|
* bjorn/fix-warnings/OTP-9250:
Eliminate alias warning in gcc 4.5.2
erl_trace: Eliminate alias warning
|
|
* bjorn/fix-binary-overflow/OTP-9118:
Fix overflow in list_to_bitstring/1
Replace io_list_len() with erts_iolist_size()
Make port_command/2 reject non-byte sized bitstrings
io.c: Make io_list_vec_len() less general
iolist_size/1: Fix truncation of result
Test iolist_size/1 with bad arguments
binary_SUITE: Remove workaround for avoiding stack overflow
|
|
Ets tables using the write_concurrency option could potentially get
into an internally inconsistent state.
|
|
* sverker/halfword-printf-relative-terms/OTP-9292:
ETS usage of erts_printf %R
erts_printf %R for relative ets-terms in halfword-vm
Another halfword is_same-bug for ETS ordered_set
|
|
* sverker/halfword-high-alloc/OTP-9291:
Present 'low' memory count for halfword-vm with erlang:memory()
Fix faulty values from erlang:memory() on halfword-vm
Allow allocator disable for high memory (better valgrind for halfword)
Expand the use of high memory allocation in halfword emulator
|
|
|
|
* rickard/gc-other/OTP-9211:
Fix bad assertions
Avoid scheduling of processes being garbage collected by others
|
|
|
|
|
|
Avoid creating two variable names referring to the same memory
area, because that can cause aliasing warnings in some versions of
gcc.
|
|
|
|
Noticed-by: Jon Meredith
|
|
The io_list_len() function returns an int, where a negative return
value indicates a type error. One problem is that an int only consists
of 32 bits in a 64-bit emulator. Changing the return type to Sint
will solve that problem, but in the 32-bit emulator, a large iolist
and a iolist with a type error will both return a negative number.
(Noticed by Jon Meredith.)
Another problem is that for iolists whose total size exceed the
word size, the result would be truncated, leading to a subsequent
buffer overflow and emulator crash.
Therefore, introduce the new erts_iolist_size() function which
returns a status indication and writes the result size through
a passed pointer. If the result size does not fit in a word,
return an overflow indication.
|
|
Use of Uint instead of UWord could cause overflow errors on systems
with large memory use.
|
|
|
|
Also add 'low' field in system_info(allocator)
SHORT_LIVED is still in low memory
|
|
|
|
Conflicts:
erts/emulator/beam/erl_printf_term.c
|
|
This one is less likely to provoke error as one of the terms is
always NULL-based.
|
|
Also rename the fun_to_port/1 test case to outputv_errors/1 and
test sending more kinds of bad data to an outputv-enabled driver.
|
|
io_list_vec_len() is slightly more general than it needs to be.
Specifically:
* The only caller always passes ERL_SMALL_IO_BIN_LIMIT as the
value for the bin_limit parameter, so the bin_limit parameter
can be eliminated.
* The only caller never passes any NULL pointers, so there is
no need test the pointers before writing through them.
|
|
* ms/beam-fix-format-specifiers-in-erl_exit-msg:
Fix format specifiers in erl_exit messages
OTP-9262
|
|
Conflicts:
erts/vsn.mk
|
|
iolist_size/1 would silently return a truncated result for iolists
whose size exceeded the word size. For example:
iolist(lists:duplicate(256, <<0:(1 bsl 24)/unit:8>>)).
would return 0 (instead of 4294967296 or 1 bsl 32).
Rewrite iolist_size/1 to accumulate the size in a bignum if
necessary and result the correct result.
|
|
|
|
* ta/driver_entry-typo:
driver_entry: Remove gratuitous paren and fix typo
OTP-9254
|
|
* sverker/enif_is_exception/OTP-9150:
add support for checking if an ERL_NIF_TERM is an exception
|
|
* sverker/erts_printf-halfword:
erts_printf %be to print integers of size Eterm
Fix use of type BeamInstr in hipe_debug.c
Conflicts:
erts/emulator/hipe/hipe_debug.c
|
|
|
|
Conflicts:
erts/vsn.mk
|
|
* rickard/process-status/OTP-9197:
Fix thread unsafe access
Fix lost wakeup when process garbage collected by other
Only set status P_WAITING when needed
Add testcase for process_info() badarg bug
|
|
|
|
Fix thread unsafe access to process status field introduced in OTP-9125.
|
|
|
|
The status of a process was unnecessarily set to waiting before
the process was enqueued in a run queue. This bug was harmless
up until OTP-R14B01. In OTP-R14B02 erlang:hibernate/3 was fixed
(OTP-9125). After the introduction of OTP-9125, the previously
harmless process status bug sometimes caused erroneous badarg
exceptions from process_info().
|
|
|
|
* ta/erts-unused-vars:
erts: Remove unused variables
OTP-9205
|