Author: Tobias Weber <[email protected]>
Branch: c8-tcp-style-trx-length
Changeset: r2133:08a8d7fd1866
Date: 2017-07-21 14:19 +0200
http://bitbucket.org/pypy/stmgc/changeset/08a8d7fd1866/

Log:    Backed out changeset c6265dd2c77c

diff --git a/c8/stm/nursery.c b/c8/stm/nursery.c
--- a/c8/stm/nursery.c
+++ b/c8/stm/nursery.c
@@ -22,18 +22,12 @@
 // #define LARGE_FILL_MARK_NURSERY_BYTES   0x1000000000000000L
 
 // corresponds to ~4 KB nursery fill
-#define STM_DEFAULT_REL_TRANSACTION_LENGTH (0.000001)
-// commit after ~4 B or likely after every instruction
-#define STM_MIN_RELATIVE_TRANSACTION_LENGTH (0.000000001)
-
+#define STM_MIN_RELATIVE_TRANSACTION_LENGTH (0.000001)
 #define BACKOFF_COUNT (10)
-#define BACKOFF_MULTIPLIER (BACKOFF_COUNT / 
-log10(STM_DEFAULT_REL_TRANSACTION_LENGTH))
+#define BACKOFF_MULTIPLIER (BACKOFF_COUNT / 
-log10(STM_MIN_RELATIVE_TRANSACTION_LENGTH))
 
 static inline void set_backoff(stm_thread_local_t *tl, double rel_trx_len) {
-    /* the shorter the trx, the more backoff:
-    think a*x + b = backoff, x := -log(rel-trx-len),
-    backoff is <BACKOFF_COUNT> + b at default trx length,
-    linear decrease to b at max trx length */
+    // the shorter the trx, the more backoff: 100 at min trx length, 
proportional decrease to 5 at max trx length (think a/x + b = backoff)
     tl->transaction_length_backoff =
         (int)((BACKOFF_MULTIPLIER * -log10(rel_trx_len)) + 5);
     // printf("thread %d, backoff %d\n", tl->thread_local_counter, 
tl->transaction_length_backoff);
diff --git a/c8/stm/setup.c b/c8/stm/setup.c
--- a/c8/stm/setup.c
+++ b/c8/stm/setup.c
@@ -247,7 +247,7 @@
     tl->thread_local_counter = ++thread_local_counters;
 
     /* init adaptive transaction length mode */
-    tl->relative_transaction_length = STM_DEFAULT_REL_TRANSACTION_LENGTH;
+    tl->relative_transaction_length = STM_MIN_RELATIVE_TRANSACTION_LENGTH;
     tl->transaction_length_backoff = 0;
     tl->linear_transaction_length_increment = 0;
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to