<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/gc/mmtk, branch master</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/mmtk] Use rb_gc_obj_needs_cleanup_p</title>
<updated>2026-06-04T02:54:35+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2026-06-03T12:41:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=585919619774d0cf08559d85d98ddea591ff6324'/>
<id>585919619774d0cf08559d85d98ddea591ff6324</id>
<content type='text'>
https://github.com/ruby/mmtk/commit/031785b41c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/mmtk/commit/031785b41c
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/mmtk] Fix compiler warnings in mmtk.c</title>
<updated>2026-05-31T10:35:05+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2026-05-31T01:21:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=12c8599ffa3c0a0b8df7741e06ae352e52cb463e'/>
<id>12c8599ffa3c0a0b8df7741e06ae352e52cb463e</id>
<content type='text'>
    gc/mmtk/mmtk.c:505:1: warning: function 'rb_mmtk_gc_thread_panic_handler' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
      505 | {
          | ^
    gc/mmtk/mmtk.c:987:27: warning: variable length array folded to constant array as an extension [-Wgnu-folding-constant]
      987 |         char obj_info_buf[info_size];
          |                           ^~~~~~~~~
    gc/mmtk/mmtk.c:990:34: warning: variable length array folded to constant array as an extension [-Wgnu-folding-constant]
      990 |         char parent_obj_info_buf[info_size];
          |                                  ^~~~~~~~~

https://github.com/ruby/mmtk/commit/8ce21cdf10
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
    gc/mmtk/mmtk.c:505:1: warning: function 'rb_mmtk_gc_thread_panic_handler' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
      505 | {
          | ^
    gc/mmtk/mmtk.c:987:27: warning: variable length array folded to constant array as an extension [-Wgnu-folding-constant]
      987 |         char obj_info_buf[info_size];
          |                           ^~~~~~~~~
    gc/mmtk/mmtk.c:990:34: warning: variable length array folded to constant array as an extension [-Wgnu-folding-constant]
      990 |         char parent_obj_info_buf[info_size];
          |                                  ^~~~~~~~~

https://github.com/ruby/mmtk/commit/8ce21cdf10
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/mmtk] Switch logging from debug to info level</title>
<updated>2026-05-23T13:04:55+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2026-05-23T01:56:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6c6df00bbcefe7986111606948e96a9c1815c9c6'/>
<id>6c6df00bbcefe7986111606948e96a9c1815c9c6</id>
<content type='text'>
https://github.com/ruby/mmtk/commit/9f730cc709
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/mmtk/commit/9f730cc709
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/mmtk] Add cpu heap mode based on Tavakolisomeh et al. (MPLR '23)</title>
<updated>2026-05-23T13:04:55+00:00</updated>
<author>
<name>Ufuk Kayserilioglu</name>
<email>ufuk.kayserilioglu@shopify.com</email>
</author>
<published>2026-05-07T14:51:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=06190d1f5c051eddf141839c0d52db0fb9eaea8d'/>
<id>06190d1f5c051eddf141839c0d52db0fb9eaea8d</id>
<content type='text'>
Adds MMTK_HEAP_MODE=cpu, a dynamic heap-sizing policy that grows
or shrinks the heap after each GC cycle to keep measured GC CPU
overhead near a configurable target. The control law follows
Tavakolisomeh et al., 'Heap Size Adjustment with CPU Control', MPLR
'23: a sigmoid of the (averaged) GC CPU overhead error in (-inf, +inf)
maps to a heap-size adjustment factor in (0.5, 1.5).

Implementation lives alongside the existing 'ruby' delegated trigger
in gc/mmtk/src/heap/. T_GC is wall-clock GC duration; T_APP is process
CPU time delta read via clock_gettime(CLOCK_PROCESS_CPUTIME_ID), which
correctly credits multi-threaded mutator parallelism. Nursery-only
generational GCs are skipped so the trigger only re-sizes at full
collections.

Configuration:

  MMTK_GC_CPU_TARGET   target GC CPU overhead, percent. Default 5.
  MMTK_GC_CPU_WINDOW   number of recent cycles averaged. Default 3.

The default differs from the paper's recommended 15. The paper
targets ZGC, a concurrent generational collector; MMTk-Ruby currently
ships stop-the-world Immix, where every percent of GC CPU also blocks
the mutator. An empirical sweep of MMTK_GC_CPU_TARGET across
ruby-bench (railsbench, lobsters, psych-load, liquid-render, lee)
found 5-6 to be Pareto-optimal vs the existing 'ruby' heap mode:
about 6 percent geomean throughput improvement at essentially equal
peak RSS. Targets &gt;=10 trade large amounts of throughput for modest
RSS savings on this collector.

bin/smoke-test, bin/ruby-mmtk-mode, bin/compare-heap-modes, and
doc/testing-cpu-heap-mode.md are included so reviewers and future
contributors can reproduce the sweep against ruby/ruby-bench.

https://github.com/ruby/mmtk/commit/1f223f5ad5

Co-Authored-By: Claude Opus 4.7 &lt;noreply@anthropic.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds MMTK_HEAP_MODE=cpu, a dynamic heap-sizing policy that grows
or shrinks the heap after each GC cycle to keep measured GC CPU
overhead near a configurable target. The control law follows
Tavakolisomeh et al., 'Heap Size Adjustment with CPU Control', MPLR
'23: a sigmoid of the (averaged) GC CPU overhead error in (-inf, +inf)
maps to a heap-size adjustment factor in (0.5, 1.5).

Implementation lives alongside the existing 'ruby' delegated trigger
in gc/mmtk/src/heap/. T_GC is wall-clock GC duration; T_APP is process
CPU time delta read via clock_gettime(CLOCK_PROCESS_CPUTIME_ID), which
correctly credits multi-threaded mutator parallelism. Nursery-only
generational GCs are skipped so the trigger only re-sizes at full
collections.

Configuration:

  MMTK_GC_CPU_TARGET   target GC CPU overhead, percent. Default 5.
  MMTK_GC_CPU_WINDOW   number of recent cycles averaged. Default 3.

The default differs from the paper's recommended 15. The paper
targets ZGC, a concurrent generational collector; MMTk-Ruby currently
ships stop-the-world Immix, where every percent of GC CPU also blocks
the mutator. An empirical sweep of MMTK_GC_CPU_TARGET across
ruby-bench (railsbench, lobsters, psych-load, liquid-render, lee)
found 5-6 to be Pareto-optimal vs the existing 'ruby' heap mode:
about 6 percent geomean throughput improvement at essentially equal
peak RSS. Targets &gt;=10 trade large amounts of throughput for modest
RSS savings on this collector.

bin/smoke-test, bin/ruby-mmtk-mode, bin/compare-heap-modes, and
doc/testing-cpu-heap-mode.md are included so reviewers and future
contributors can reproduce the sweep against ruby/ruby-bench.

https://github.com/ruby/mmtk/commit/1f223f5ad5

Co-Authored-By: Claude Opus 4.7 &lt;noreply@anthropic.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/mmtk] Fix compiler warnings for noreturn</title>
<updated>2026-05-20T01:10:50+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2026-05-19T00:22:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8638931df2c60901dce4c66e8e5caa3ca27a3d67'/>
<id>8638931df2c60901dce4c66e8e5caa3ca27a3d67</id>
<content type='text'>
    gc/mmtk/mmtk.c:480:1: warning: function 'rb_mmtk_gc_thread_bug' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
      480 | {
          | ^
    gc/mmtk/mmtk.c:510:1: warning: function 'rb_mmtk_mutator_thread_panic_handler' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
      510 | {
          | ^

https://github.com/ruby/mmtk/commit/a57746d575
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
    gc/mmtk/mmtk.c:480:1: warning: function 'rb_mmtk_gc_thread_bug' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
      480 | {
          | ^
    gc/mmtk/mmtk.c:510:1: warning: function 'rb_mmtk_mutator_thread_panic_handler' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
      510 | {
          | ^

https://github.com/ruby/mmtk/commit/a57746d575
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/mmtk] Move rb_gc_obj_suffix to gc.h</title>
<updated>2026-05-17T20:20:06+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2026-05-17T12:32:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cfff91a3b08d78667834fb7fd24d3672632e320f'/>
<id>cfff91a3b08d78667834fb7fd24d3672632e320f</id>
<content type='text'>
https://github.com/ruby/mmtk/commit/40053354bd
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/mmtk/commit/40053354bd
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/mmtk] Respect alignment in rb_mmtk_alloc_fast_path</title>
<updated>2026-05-16T01:34:36+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2026-05-16T00:20:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f315ca67eea90a1a6806ac1673ece7c37217169e'/>
<id>f315ca67eea90a1a6806ac1673ece7c37217169e</id>
<content type='text'>
https://github.com/ruby/mmtk/commit/9772a1d30a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/mmtk/commit/9772a1d30a
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/mmtk] Remove dead ractor_check_mode field</title>
<updated>2026-05-14T23:54:55+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2026-05-14T01:34:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=356c0cd0e7953baafd240914476213566f526c85'/>
<id>356c0cd0e7953baafd240914476213566f526c85</id>
<content type='text'>
https://github.com/ruby/mmtk/commit/a46b68fe5b
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/mmtk/commit/a46b68fe5b
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/mmtk] Remove call to rb_ractor_setup_belonging</title>
<updated>2026-05-14T21:50:04+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2026-05-14T20:59:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=63397319b4a3a66f1464289aa4a68e8fa19ba4cf'/>
<id>63397319b4a3a66f1464289aa4a68e8fa19ba4cf</id>
<content type='text'>
Don't need to call it after https://github.com/ruby/ruby/pull/16961.

https://github.com/ruby/mmtk/commit/ae5638ac00
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't need to call it after https://github.com/ruby/ruby/pull/16961.

https://github.com/ruby/mmtk/commit/ae5638ac00
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/mmtk] Introduce event_hook_mutex for RUBY_INTERNAL_EVENT_FREEOBJ</title>
<updated>2026-05-09T13:08:44+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2026-05-08T00:02:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=56cd26f8353713c485f49fa68d804e0f04777e08'/>
<id>56cd26f8353713c485f49fa68d804e0f04777e08</id>
<content type='text'>
We can stop using rb_gc_worker_thread_set_vm_context because rb_gc_event_hook
now uses rb_gc_get_ec since https://github.com/ruby/ruby/pull/16880

https://github.com/ruby/mmtk/commit/04bcf8456a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We can stop using rb_gc_worker_thread_set_vm_context because rb_gc_event_hook
now uses rb_gc_get_ec since https://github.com/ruby/ruby/pull/16880

https://github.com/ruby/mmtk/commit/04bcf8456a
</pre>
</div>
</content>
</entry>
</feed>
