[前][次][番号順一覧][スレッド一覧]

ruby-changes:64015

From: Takashi <ko1@a...>
Date: Tue, 8 Dec 2020 14:13:45 +0900 (JST)
Subject: [ruby-changes:64015] b7dc04e518 (master): Revert some recent JIT changes

https://git.ruby-lang.org/ruby.git/commit/?id=b7dc04e518

From b7dc04e51823f9fe8b5355c30a304ecdb11fe5ed Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Mon, 7 Dec 2020 21:06:00 -0800
Subject: Revert some recent JIT changes

Revert "Lock the entire active_units loop"

This reverts commit 5c2ff88be2e515613dfe54823e8429656f688e9f.

Revert "Lock active_units references on compaction"

This reverts commit 556a7285080c1344c75bb93a333c9bfc5d631c61.

Revert "Wait for GC before unload_units"

This reverts commit a8f16df615daa55901bb351efe038e86b61fbb92.

Well, the previous revert actually didn't fix it, but this series of
reverts seems to rollback the situation a little.

diff --git a/mjit_worker.c b/mjit_worker.c
index 557db56..725a922 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -936,7 +936,6 @@ compile_compact_jit_code(char* c_file) https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L936
     // TODO: Consider using a more granular lock after we implement inlining across
     // compacted functions (not done yet).
     bool success = true;
-    CRITICAL_SECTION_START(3, "before active_units list_for_each");
     list_for_each(&active_units.head, child_unit, unode) {
         char funcname[MAXPATHLEN];
         sprint_funcname(funcname, child_unit);
@@ -952,7 +951,6 @@ compile_compact_jit_code(char* c_file) https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L951
         fprintf(f, "\n/* %s%s%s:%ld */\n", iseq_label, sep, iseq_path, iseq_lineno);
         success &= mjit_compile(f, child_unit->iseq, funcname, child_unit->id);
     }
-    CRITICAL_SECTION_FINISH(3, "after active_units list_for_each");
 
     // release blocking mjit_gc_start_hook
     CRITICAL_SECTION_START(3, "after mjit_compile to wakeup client for GC");
@@ -1361,27 +1359,16 @@ mjit_worker(void) https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L1359
     while (!stop_worker_p) {
         struct rb_mjit_unit *unit;
 
-        // Wait until a unit becomes available
+        // wait until unit is available
         CRITICAL_SECTION_START(3, "in worker dequeue");
         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");
 
-            // Unload some units as needed
             if (unload_requests >= throttle_threshold) {
-                while (in_gc) {
-                    verbose(3, "Waiting wakeup from GC");
-                    rb_native_cond_wait(&mjit_gc_wakeup, &mjit_engine_mutex);
-                }
-                in_jit = true; // Lock GC
-
                 RB_DEBUG_COUNTER_INC(mjit_unload_units);
                 unload_units();
                 unload_requests = 0;
-
-                in_jit = false; // Unlock GC
-                verbose(3, "Sending wakeup signal to client in a mjit-worker for GC");
-                rb_native_cond_signal(&mjit_client_wakeup);
             }
             if (active_units.length == mjit_opts.max_cache_size && mjit_opts.wait) { // Sometimes all methods may be in use
                 mjit_opts.max_cache_size++; // avoid infinite loop on `rb_mjit_wait_call`. Note that --jit-wait is just for testing.
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]