rcu tests: fix compilation on 32-bit ppc
authorPaolo Bonzini <pbonzini@redhat.com>
Sat, 21 Mar 2015 15:32:05 +0000 (16:32 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 25 Mar 2015 12:37:10 +0000 (13:37 +0100)
commit8a5956ad6392f115521dad774055c737c49fb0dd
tree7c9b30c6fefc1ee2a6d484b44fa2a863e54ebe44
parent549c4e49788bbb16bdac3fb5480a2177019899e2
rcu tests: fix compilation on 32-bit ppc

32-bit PPC cannot do atomic operations on long long.  Inside the loops,
we are already using local counters that are summed at the end of
the run---with some exceptions (rcu_stress_count for rcutorture,
n_nodes for test-rcu-list): fix them to use the same technique.
For test-rcu-list, remove the mostly unused member "val" from the
list.  Then, use a mutex to protect the global counts.

Performance does not matter there because every thread will only enter
the critical section once.

Remaining uses of atomic instructions are for ints or pointers.

Reported-by: Andreas Faerber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tests/rcutorture.c
tests/test-rcu-list.c