Author: Tobias Weber <[email protected]>
Branch: c8-tcp-style-trx-length
Changeset: r2140:3bc9bfa7d481
Date: 2017-07-24 16:24 +0200
http://bitbucket.org/pypy/stmgc/changeset/3bc9bfa7d481/
Log: Initialize trx len roughly to old default of 1MB and hard cap on
lower limit of 4KB
diff --git a/c8/stm/nursery.c b/c8/stm/nursery.c
--- a/c8/stm/nursery.c
+++ b/c8/stm/nursery.c
@@ -17,12 +17,14 @@
#define DEFAULT_FILL_MARK_NURSERY_BYTES (NURSERY_SIZE / 4)
-// #define LARGE_FILL_MARK_NURSERY_BYTES DEFAULT_FILL_MARK_NURSERY_BYTES
+// corresponds to ~4 GB
#define LARGE_FILL_MARK_NURSERY_BYTES 0x100000000L
-// #define LARGE_FILL_MARK_NURSERY_BYTES 0x1000000000000000L
+// corresponds to ~4 MB nursery fill
+#define STM_DEFAULT_RELATIVE_TRANSACTION_LENGTH (0.001)
// corresponds to ~4 KB nursery fill
#define STM_MIN_RELATIVE_TRANSACTION_LENGTH (0.000001)
+
#define BACKOFF_COUNT (20)
#define BACKOFF_MULTIPLIER (BACKOFF_COUNT /
-log10(STM_MIN_RELATIVE_TRANSACTION_LENGTH))
@@ -45,8 +47,7 @@
if (aborts) {
new = previous / multiplier;
if (new < STM_MIN_RELATIVE_TRANSACTION_LENGTH) {
- // reached min trx length, only decrease slowly
- new = 0.9 * previous;
+ new = STM_MIN_RELATIVE_TRANSACTION_LENGTH;
}
set_backoff(tl, new);
} else if (tl->transaction_length_backoff == 0) {
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_MIN_RELATIVE_TRANSACTION_LENGTH;
+ tl->relative_transaction_length = STM_DEFAULT_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