[pypy-commit] pypy stmgc-c7: import stmgc/10c636ae449e
arigo
noreply at buildbot.pypy.org
Mon Feb 2 21:23:51 CET 2015
Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r75654:79d715e680ed
Date: 2015-02-02 21:23 +0100
http://bitbucket.org/pypy/pypy/changeset/79d715e680ed/
Log: import stmgc/10c636ae449e
diff --git a/rpython/translator/stm/src_stm/revision b/rpython/translator/stm/src_stm/revision
--- a/rpython/translator/stm/src_stm/revision
+++ b/rpython/translator/stm/src_stm/revision
@@ -1,1 +1,1 @@
-88492dc56aa8
+10c636ae449e
diff --git a/rpython/translator/stm/src_stm/stm/core.c b/rpython/translator/stm/src_stm/stm/core.c
--- a/rpython/translator/stm/src_stm/stm/core.c
+++ b/rpython/translator/stm/src_stm/stm/core.c
@@ -1112,6 +1112,8 @@
dprintf(("become_inevitable: %s\n", msg));
timing_fetch_inev();
+ write_fence(); /* make sure others see a correct 'marker_inev'
+ if they see TS_INEVITABLE */
wait_for_end_of_inevitable_transaction();
STM_PSEGMENT->transaction_state = TS_INEVITABLE;
stm_rewind_jmp_forget(STM_SEGMENT->running_thread);
diff --git a/rpython/translator/stm/src_stm/stm/prof.c b/rpython/translator/stm/src_stm/stm/prof.c
--- a/rpython/translator/stm/src_stm/stm/prof.c
+++ b/rpython/translator/stm/src_stm/stm/prof.c
@@ -33,12 +33,27 @@
int len0 = 0;
int len1 = 0;
if (markers != NULL) {
+ /* Obscure. In rare cases we see an uninitialized object
+ at 'markers[1]->segment_base + object'. I *think* it
+ is related to the other thread busy privatizing the
+ page. We thus need to acquire the privatization_lock
+ here (any will do).
+
+ Note that we have to read the object from the foreign
+ segment. We can't assume the code object to be already
+ committed at all; maybe it was created during the remote
+ transaction.
+ */
+ acquire_privatization_lock();
+
if (markers[1].tl != NULL)
buf.other_thread_num = markers[1].tl->thread_local_counter;
if (markers[0].odd_number != 0)
len0 = profiling_expand_marker(&markers[0], buf.extra, 128);
if (markers[1].odd_number != 0)
len1 = profiling_expand_marker(&markers[1], buf.extra + len0, 128);
+
+ release_privatization_lock();
}
buf.marker_length[0] = len0;
buf.marker_length[1] = len1;
More information about the pypy-commit
mailing list