Age | Commit message (Collapse) | Author |
|
|
|
|
|
This patch introduce M:N thread scheduler for Ractor system.
In general, M:N thread scheduler employs N native threads (OS threads)
to manage M user-level threads (Ruby threads in this case).
On the Ruby interpreter, 1 native thread is provided for 1 Ractor
and all Ruby threads are managed by the native thread.
From Ruby 1.9, the interpreter uses 1:1 thread scheduler which means
1 Ruby thread has 1 native thread. M:N scheduler change this strategy.
Because of compatibility issue (and stableness issue of the implementation)
main Ractor doesn't use M:N scheduler on default. On the other words,
threads on the main Ractor will be managed with 1:1 thread scheduler.
There are additional settings by environment variables:
`RUBY_MN_THREADS=1` enables M:N thread scheduler on the main ractor.
Note that non-main ractors use the M:N scheduler without this
configuration. With this configuration, single ractor applications
run threads on M:1 thread scheduler (green threads, user-level threads).
`RUBY_MAX_CPU=n` specifies maximum number of native threads for
M:N scheduler (default: 8).
This patch will be reverted soon if non-easy issues are found.
[Bug #19842]
|
|
Remove the bad example that can lead to misunderstanding as if this
precision is defined in Ruby.
|
|
|
|
|
|
|
|
|
|
Similar to releasing free GC pages, releasing free malloc pages
reduce the amount of page faults post fork.
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/8392
|
|
`Process::Status#&` and `Process::Status#>>` are provided only for
the backward compatibility with older Ruby than 1.8 where `$?` was
a `Fixnum`, and the knowledge about internals of system dependent
macros is necessary to use them. Modern programs and libraries
should not need these methods.
Notes:
Merged: https://github.com/ruby/ruby/pull/8392
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/8392
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
|
|
- Signal names can be symbols, as stated above.
- Supported signals and those values are platform dependent.
- Key sequences to send signal are configurable.
- Fix description of signal 0.
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
Notes:
Merged: https://github.com/ruby/ruby/pull/8367
Merged-By: nobu <nobu@ruby-lang.org>
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/8361
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
This commit adds `free_empty_pages` which frees all empty heap pages and
moves the number of pages freed to the allocatable pages counter. This
is used in Process.warmup to improve performance because page
invalidation from copy-on-write is slower than allocating a new page.
Notes:
Merged: https://github.com/ruby/ruby/pull/8257
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/8256
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
Notes:
Merged-By: peterzhu2118 <peter@peterzhu.ca>
|
|
These arguments can only be `true` or `false` now. Also add markups.
|
|
This both save time for when it will be eventually needed,
and avoid mutating heap pages after a potential fork.
Instrumenting some large Rails app, I've witnessed up to
58% of String instances having their coderange still unknown.
Notes:
Merged: https://github.com/ruby/ruby/pull/8112
|
|
[Feature #18885]
For now, the optimizations performed are:
- Run a major GC
- Compact the heap
- Promote all surviving objects to oldgen
Other optimizations may follow.
Notes:
Merged: https://github.com/ruby/ruby/pull/7662
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/8050
|
|
This retries the compatible parts of the previously reverted PR so we can continue to update related code without breaking backwards compatibility.
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
This reverts commit 18e55fc1e1ec20e8f3166e3059e76c885fc9f8f2.
fix [Bug #19704]
https://bugs.ruby-lang.org/issues/19704
This breaks compatibility for extension libraries. Such changes
need a discussion.
|
|
* Add rb_io_path and rb_io_open_descriptor.
* Use rb_io_open_descriptor to create PTY objects
* Rename FMODE_PREP -> FMODE_EXTERNAL and expose it
FMODE_PREP I believe refers to the concept of a "pre-prepared" file, but
FMODE_EXTERNAL is clearer about what the file descriptor represents and
aligns with language in the IO::Buffer module.
* Ensure that rb_io_open_descriptor closes the FD if it fails
If FMODE_EXTERNAL is not set, then it's guaranteed that Ruby will be
responsible for closing your file, eventually, if you pass it to
rb_io_open_descriptor, even if it raises an exception.
* Rename IS_EXTERNAL_FD -> RUBY_IO_EXTERNAL_P
* Expose `rb_io_closed_p`.
* Add `rb_io_mode` to get IO mode.
---------
Co-authored-by: KJ Tsanaktsidis <ktsanaktsidis@zendesk.com>
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Now, calling `rb_fork` directly breaks the PID cache and the timer
thread, so must use `rb_fork_ruby` or similar instead.
Notes:
Merged: https://github.com/ruby/ruby/pull/7834
|
|
Include the failed clock argument in the error message from
`Process.clock_gettime` and `Process.clock_getres`.
Notes:
Merged: https://github.com/ruby/ruby/pull/7687
|
|
Since Ruby 2.7 it prints the message and backtrace of $!
Fixes [Bug #19578]
Notes:
Merged: https://github.com/ruby/ruby/pull/7664
|
|
This reverts commit 87253d047ce35e7836b6f97edbb4f819879a3b25.
Revert "Implement `Process.warmup`"
This reverts commit ba6ccd871442f55080bffd53e33678c0726787d2.
|
|
[Feature #18885]
For now, the optimizations performed are:
- Run a major GC
- Compact the heap
- Promote all surviving objects to oldgen
Other optimizations may follow.
Notes:
Merged: https://github.com/ruby/ruby/pull/7346
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7649
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7585
|
|
[Feature #19443]
Until recently most libc would cache `getpid()` so this was a cheap check to make.
However as of glibc version 2.25 the PID cache is removed and calls to getpid() always
invoke the actual system call which significantly degrades the performance of existing applications.
The reason glibc removed the cache is that some libraries were bypassing fork(2)
by issuing system calls themselves, causing stale cache issues.
That isn't a concern for Ruby as bypassing MRI's primitive for forking would
render the VM unusable, so we can safely cache the PID.
Notes:
Merged: https://github.com/ruby/ruby/pull/7434
|