[pypy-commit] stmgc c8-tcp-style-trx-length: Set exponential base to two, i.e., double trx length on commit

tobweber pypy.commits at gmail.com
Mon Jul 31 19:22:56 EDT 2017


Author: Tobias Weber <tobias_weber89 at gmx.de>
Branch: c8-tcp-style-trx-length
Changeset: r2130:dba308a7d960
Date: 2017-07-17 16:53 +0200
http://bitbucket.org/pypy/stmgc/changeset/dba308a7d960/

Log:	Set exponential base to two, i.e., double trx length on commit

diff --git a/c8/stm/nursery.c b/c8/stm/nursery.c
--- a/c8/stm/nursery.c
+++ b/c8/stm/nursery.c
@@ -18,23 +18,24 @@
 #define DEFAULT_FILL_MARK_NURSERY_BYTES (NURSERY_SIZE / 4)
 
 // #define LARGE_FILL_MARK_NURSERY_BYTES   DEFAULT_FILL_MARK_NURSERY_BYTES
-#define LARGE_FILL_MARK_NURSERY_BYTES   0x10000000L
+#define LARGE_FILL_MARK_NURSERY_BYTES   0x100000000L
 // #define LARGE_FILL_MARK_NURSERY_BYTES   0x1000000000000000L
 
-// corresponds to ~270 bytes nursery fill
-#define STM_MIN_RELATIVE_TRANSACTION_LENGTH (0.000001)
-#define BACKOFF_MULTIPLIER (20 / -log10(STM_MIN_RELATIVE_TRANSACTION_LENGTH))
+// corresponds to ~430 bytes nursery fill
+#define STM_MIN_RELATIVE_TRANSACTION_LENGTH (0.0000001)
+#define BACKOFF_COUNT (20)
+#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: 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);
-    tl->linear_transaction_length_increment = rel_trx_len;
+    tl->linear_transaction_length_increment = rel_trx_len / BACKOFF_COUNT;
 }
 
 static inline double get_new_transaction_length(stm_thread_local_t *tl, bool aborts) {
-    const int multiplier = 100;
+    const int multiplier = 2;
     double previous = tl->relative_transaction_length;
     double new = previous;
     if (aborts) {


More information about the pypy-commit mailing list