]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-118093: Fix off-by-one errors in tier-up thresholds (GH-124447)
authorBrandt Bucher <brandtbucher@microsoft.com>
Fri, 27 Sep 2024 16:38:04 +0000 (09:38 -0700)
committerGitHub <noreply@github.com>
Fri, 27 Sep 2024 16:38:04 +0000 (09:38 -0700)
Include/internal/pycore_backoff.h

index 3db3aa3eb77879e38646734144e6c2b0ced4a70d..a9d1bce127e63d31bfd521c97dcd278ed9657f90 100644 (file)
@@ -108,7 +108,7 @@ backoff_counter_triggers(_Py_BackoffCounter counter)
 /* Initial JUMP_BACKWARD counter.
  * This determines when we create a trace for a loop.
 * Backoff sequence 16, 32, 64, 128, 256, 512, 1024, 2048, 4096. */
-#define JUMP_BACKWARD_INITIAL_VALUE 16
+#define JUMP_BACKWARD_INITIAL_VALUE 15
 #define JUMP_BACKWARD_INITIAL_BACKOFF 4
 static inline _Py_BackoffCounter
 initial_jump_backoff_counter(void)
@@ -122,7 +122,7 @@ initial_jump_backoff_counter(void)
  * otherwise when a side exit warms up we may construct
  * a new trace before the Tier 1 code has properly re-specialized.
  * Backoff sequence 64, 128, 256, 512, 1024, 2048, 4096. */
-#define SIDE_EXIT_INITIAL_VALUE 64
+#define SIDE_EXIT_INITIAL_VALUE 63
 #define SIDE_EXIT_INITIAL_BACKOFF 6
 
 static inline _Py_BackoffCounter