RE: test_stack on powerpc (power7)

Will Schmidt <will_schmidt-DhXWPJtHtuFWk0Htik3J/[email protected]>
Newsgroups gmane.comp.programming.garbage-collection.boehmgc
Organization Internation Business Machines
Message-ID <1391108163.7066.110.camel@brimstone>
On Wed, 2014-01-29 at 07:05 +0000, Boehm, Hans wrote:
> Interesting.
<...snip...>

> I would also check that the recheck of first against AO_load(list) appears in the assembly code where it should.

Thanks for the suggestions. :-)

I looked closer at the code that does the x_bits twiddling, and after a
bit of quality time single-stepping within gdb, have found an issue.
The AO_load() function is being mapped to AO_load() in
sysdeps/loadstore/atomic_load.h, rather than the AO_load_acquire() in
powerpc.h like I had initialy thought, per the #defines I was lookging
at in generalize-small.h.  The critical detail in that is the lack of an
isync in the atomic_load.h version.

I'm admittedly unclear of how the path through the header file includes
should be.

The patch below (inline and attached) seems a bit hackish to me, but is
also sufficient to allow test_stack to run to completion on the P7 here.
(test_stack running in a loop, ~ 1000 successful runs so far).   For
inclusion as-is, or as inspiration to whomever better understands the
include hierarchy.

Thanks, 
-Will

--

Force AO_load() to map to AO_load_acquire() for powerpc.  The
AO_load_acquire() function includes isync instructions that
are critical for proper behavior on power system.


Signed-Off-By: Will Schmidt <will_schmidt-DhXWPJtHtuFWk0Htik3J/[email protected]>


diff -aur --exclude='*.Plo' --exclude='*.Po' libatomic_ops-7.4.0/src/atomic_ops/sysdeps/gcc/powerpc.h libatomic_ops-7.4.0.new/src/atomic_ops/sysdeps/gcc/powerpc.h
--- libatomic_ops-7.4.0/src/atomic_ops/sysdeps/gcc/powerpc.h	2013-11-10 03:57:17.000000000 -0600
+++ libatomic_ops-7.4.0.new/src/atomic_ops/sysdeps/gcc/powerpc.h	2014-01-30 12:17:20.819984940 -0600
@@ -29,6 +29,8 @@
 
 #include "../all_aligned_atomic_load_store.h"
 
+#define AO_load(addr) AO_load_acquire(addr)
+
 #include "../test_and_set_t_is_ao_t.h"
         /* There seems to be no byte equivalent of lwarx, so this       */
         /* may really be what we want, at least in the 32-bit case.     */

_______________________________________________
Gc mailing list
Gc-V9/[email protected]
http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
libatomic_ops_powerpc_adjust_AO_load_definition.jan30.2014.diff (text/x-patch, 669 B)
diff -aur --exclude='*.Plo' --exclude='*.Po' libatomic_ops-7.4.0/src/atomic_ops/sysdeps/gcc/powerpc.h libatomic_ops-7.4.0.new/src/atomic_ops/sysdeps/gcc/powerpc.h
--- libatomic_ops-7.4.0/src/atomic_ops/sysdeps/gcc/powerpc.h	2013-11-10 03:57:17.000000000 -0600
+++ libatomic_ops-7.4.0.new/src/atomic_ops/sysdeps/gcc/powerpc.h	2014-01-30 12:17:20.819984940 -0600
@@ -29,6 +29,8 @@
 
 #include "../all_aligned_atomic_load_store.h"
 
+#define AO_load(addr) AO_load_acquire(addr)
+
 #include "../test_and_set_t_is_ao_t.h"
         /* There seems to be no byte equivalent of lwarx, so this       */
         /* may really be what we want, at least in the 32-bit case.     */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.