Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r1247:9164eaf02d1a
Date: 2014-05-28 17:01 +0200
http://bitbucket.org/pypy/stmgc/changeset/9164eaf02d1a/

Log:    Always enable this logic: we don't want any random false conflict at
        all, even if they are rare, until we are sure about the trade-offs
        involved.

diff --git a/c7/stm/gcpage.c b/c7/stm/gcpage.c
--- a/c7/stm/gcpage.c
+++ b/c7/stm/gcpage.c
@@ -484,17 +484,15 @@
     /* this is called by _stm_largemalloc_sweep() */
     object_t *obj = (object_t *)(data - stm_object_pages);
     if (!mark_visited_test_and_clear(obj)) {
-#ifndef NDEBUG
         /* This is actually needed in order to avoid random write-read
-           conflicts with objects read and freed long in the past. Still,
-           it is probably rare enough so that we don't need this additional
-           overhead. (test_random hits it sometimes) */
+           conflicts with objects read and freed long in the past.
+           It is probably rare enough, but still, we want to avoid any
+           false conflict. (test_random hits it sometimes) */
         long i;
         for (i = 1; i <= NB_SEGMENTS; i++) {
             ((struct stm_read_marker_s *)
              (get_segment_base(i) + (((uintptr_t)obj) >> 4)))->rm = 0;
         }
-#endif
         return false;
     }
     return true;
diff --git a/c7/stm/nursery.c b/c7/stm/nursery.c
--- a/c7/stm/nursery.c
+++ b/c7/stm/nursery.c
@@ -280,7 +280,8 @@
 
         TREE_LOOP_FORWARD(*pseg->young_outside_nursery, item) {
             assert(!_is_in_nursery((object_t *)item->addr));
-            /* mark slot as unread */
+            /* mark slot as unread (it can only have the read marker
+               in this segment) */
             ((struct stm_read_marker_s *)
              (pseg->pub.segment_base + (item->addr >> 4)))->rm = 0;
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to