Descriptionruntime: make lock-free stack work with high canonical amd64
addresses
On most amd64 systems, all user-space addresses are in the
lower canonical half (most significant 16-bits set to zero)
and all kernel-space addresses are in the upper canonical half
(most significant 16-bits set to one). Solaris is an exception
to this, user-space addresses are in both canonical halves. The
heap, text, and anonymous memory mappings are in the lower half,
but the stack and shared object mappings are in the top half.
The lock-free stack algorithm uses the most significant unused
bits in an address for the ABA counter. The algorithm used to
assume all addresses are in the lower canonical half; it used
all 16+1bit unused space and created pointers with top 16+1 bits
set to zero.
The behavior is unchanged on non-Solaris systems. On Solaris,
only 15 bits are used for ABA counter, and the 49th bit is
used to keep track if a pointer originated from low or high
memory. When the algorithm re-creates a pointer, it now makes
sure the most significant 16 bits are a copy of the 49th bit.
This change almost fixes the Solaris build, runtime tests pass
except for the crash handler test, which will be addressed in
a different CL
Patch Set 1 #Patch Set 2 : diff -r cc53451c5af3c6f2b45b8889e072c81dfb494164 https://code.google.com/p/go #Patch Set 3 : diff -r cc53451c5af3c6f2b45b8889e072c81dfb494164 https://code.google.com/p/go #
MessagesTotal messages: 11
|
||||||||||||||||||||||||||||||||||||||||||||||