summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2021-05-22 14:59:05 +0900
committernagachika <nagachika@ruby-lang.org>2021-05-22 14:59:05 +0900
commite175917f66f0b51638d9d9e143918d4109d489f4 (patch)
treeaec48b3e2cd224b74723b159411ea85fdc57a6fb
parent2a70d2148453aeb39443f4c84147ace722d53a9a (diff)
merge revision(s) dfe21ef7a15a30fc33f3a5cc089e15d09e905eb4: [Backport #17874] [Backport #17876]
Do not block JIT with pending_stale_p Because we want to flush pending stale units before unloading units, the pending_stale_p check is implemented in this waiting loop. However, once all methods are called more than --jit-min-calls, mjit_worker_wakeup will not be signaled again. As a result, when mjit_recompile is called after that and pending_stale_p becomes true, MJIT stops processing methods in the unit queue even if the queue is very long and MJIT does nothing, waiting for the signal. There should be a better way to handle this, but as a fix to be backported to Ruby 3.0, let me make an obvious simple commit here. --- mjit_worker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
-rw-r--r--mjit_worker.c2
-rw-r--r--version.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index ba90cca7b6..9157e3a78a 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -1380,7 +1380,7 @@ mjit_worker(void)
// Wait until a unit becomes available
CRITICAL_SECTION_START(3, "in worker dequeue");
- while ((pending_stale_p || list_empty(&unit_queue.head) || active_units.length >= mjit_opts.max_cache_size) && !stop_worker_p) {
+ while ((list_empty(&unit_queue.head) || active_units.length >= mjit_opts.max_cache_size) && !stop_worker_p) {
rb_native_cond_wait(&mjit_worker_wakeup, &mjit_engine_mutex);
verbose(3, "Getting wakeup from client");
diff --git a/version.h b/version.h
index 6eb5e0b0ee..c45284dc14 100644
--- a/version.h
+++ b/version.h
@@ -12,7 +12,7 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 2
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 76
+#define RUBY_PATCHLEVEL 77
#define RUBY_RELEASE_YEAR 2021
#define RUBY_RELEASE_MONTH 5