[pypy-commit] stmgc card-marking: make CARD_SIZE=128

Raemi noreply at buildbot.pypy.org
Thu May 22 17:29:10 CEST 2014


Author: Remi Meier <remi.meier at inf.ethz.ch>
Branch: card-marking
Changeset: r1238:05003fd59ebb
Date: 2014-05-22 17:27 +0200
http://bitbucket.org/pypy/stmgc/changeset/05003fd59ebb/

Log:	make CARD_SIZE=128

diff --git a/c7/stm/core.h b/c7/stm/core.h
--- a/c7/stm/core.h
+++ b/c7/stm/core.h
@@ -237,13 +237,11 @@
                                     == pseg->overflow_number)
 
 static inline uintptr_t get_card_index(uintptr_t byte_offset) {
-    assert(CARD_SIZE == 32);
-    return (byte_offset >> 5) + 1;
+    return (byte_offset / CARD_SIZE) + 1;
 }
 
 static inline uintptr_t get_card_byte_offset(uintptr_t card_index) {
-    assert(CARD_SIZE == 32);
-    return (card_index - 1) << 5;
+    return (card_index - 1) * CARD_SIZE;
 }
 
 
diff --git a/c7/stm/nursery.c b/c7/stm/nursery.c
--- a/c7/stm/nursery.c
+++ b/c7/stm/nursery.c
@@ -263,7 +263,7 @@
 
     dprintf(("mark cards of %p, size %lu with %d, all: %d\n",
              obj, size, mark_value, mark_all));
-
+    dprintf(("obj has %lu cards\n", last_card_index));
     while (card_index <= last_card_index) {
         uintptr_t card_lock_idx = first_card_index + card_index;
 
diff --git a/c7/stm/setup.c b/c7/stm/setup.c
--- a/c7/stm/setup.c
+++ b/c7/stm/setup.c
@@ -83,8 +83,7 @@
 {
     /* Check that some values are acceptable */
     assert(NB_SEGMENTS <= NB_SEGMENTS_MAX);
-    assert(CARD_SIZE > 0 && CARD_SIZE % 16 == 0);
-    assert(CARD_SIZE == 32);    /* actually, it is hardcoded in some places right now.. */
+    assert(CARD_SIZE >= 32 && CARD_SIZE % 16 == 0);
     assert(4096 <= ((uintptr_t)STM_SEGMENT));
     assert((uintptr_t)STM_SEGMENT == (uintptr_t)STM_PSEGMENT);
     assert(((uintptr_t)STM_PSEGMENT) + sizeof(*STM_PSEGMENT) <= 8192);
diff --git a/c7/stmgc.h b/c7/stmgc.h
--- a/c7/stmgc.h
+++ b/c7/stmgc.h
@@ -149,7 +149,7 @@
 #define _STM_GCFLAG_WRITE_BARRIER      0x01
 #define _STM_GCFLAG_HAS_CARDS          0x08
 #define _STM_GCFLAG_CARDS_SET          0x10
-#define _STM_CARD_SIZE                 32 /* >= 32 */
+#define _STM_CARD_SIZE                 128 /* >= 32 */
 #define _STM_NSE_SIGNAL_MAX     _STM_TIME_N
 #define _STM_FAST_ALLOC           (66*1024)
 
diff --git a/c7/test/test_card_marking.py b/c7/test/test_card_marking.py
--- a/c7/test/test_card_marking.py
+++ b/c7/test/test_card_marking.py
@@ -188,7 +188,7 @@
         self.commit_transaction()
 
     def test_synchronize_objs(self):
-        o = stm_allocate_old(2000)
+        o = stm_allocate_old(1000+20*CARD_SIZE)
 
         self.start_transaction()
         stm_set_char(o, 'a', 1000, False)


More information about the pypy-commit mailing list