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

ruby-changes:64234

From: Koichi <ko1@a...>
Date: Thu, 17 Dec 2020 18:13:44 +0900 (JST)
Subject: [ruby-changes:64234] 7f11c8086a (master): reduce barrier counts for GC events

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

From 7f11c8086a4b5924737223322e24be23e9ff34c5 Mon Sep 17 00:00:00 2001
From: Koichi Sasada <ko1@a...>
Date: Thu, 17 Dec 2020 17:20:29 +0900
Subject: reduce barrier counts for GC events

mark needs barrier (stop other ractors), but other GC events don't need
barriers (maybe...).

diff --git a/gc.c b/gc.c
index c067ac4..a5ef670 100644
--- a/gc.c
+++ b/gc.c
@@ -8438,7 +8438,15 @@ gc_enter(rb_objspace_t *objspace, enum gc_enter_event event, unsigned int *lock_ https://github.com/ruby/ruby/blob/trunk/gc.c#L8438
 {
     // stop other ractors
     RB_VM_LOCK_ENTER_LEV(lock_lev);
-    rb_vm_barrier();
+
+    switch (event) {
+      case gc_enter_event_start:
+      case gc_enter_event_mark_continue:
+        rb_vm_barrier();
+        break;
+      default:
+        break;
+    }
 
     gc_enter_count(event);
     GC_ASSERT(during_gc == 0);
-- 
cgit v0.10.2


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

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