Commit graph

64552 commits

Author SHA1 Message Date
git
b408d32bf2 * 2020-11-30 [ci skip] 2020-11-30 05:12:18 +09:00
Koichi Sasada
77936ad679 support SIGSEGV/BUS while read_barrier_handler()
read_barrier_handler() can cause SIGSEGV/BUS so it should show
the errors.
2020-11-30 05:10:48 +09:00
Nobuyoshi Nakada
02c32b2e92
Get rid of allocation when the capacity is small 2020-11-29 15:01:41 +09:00
git
9c5d1a2964 * 2020-11-29 [ci skip] 2020-11-29 11:50:48 +09:00
Takashi Kokubun
dbdeb92b68
Do not throttle the workaround for --jit-wait
--jit-wait CI can be stuck when the workaround is throttled
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3274091
2020-11-28 18:49:47 -08:00
Nobuyoshi Nakada
fd329e24c5
NEWS for [Feature #17136] [ci skip] 2020-11-28 18:52:22 +09:00
Nobuyoshi Nakada
85aabef023 [Feature #17136] Remove special behavior from $KCODE 2020-11-28 18:51:36 +09:00
Nobuyoshi Nakada
3db21cf25f
Revived the getenv macro for dln_find.c
This partially reverts commit "Windows: Improve readablity of
getenv() encoding" 14453a256d.

The `getenv` macro defined here is to also substitute the function
in dln_find.c, not only in this file.
2020-11-28 18:47:56 +09:00
Lars Kanis
14453a256d
Windows: Improve readablity of getenv() encoding
getenv() did use the expected codepage as an implicit parameter of the macro.
This is mis-leading since include/ruby/win32.h has a different definition.
Using the "cp" variable explicit (like the other function calls) makes it
more readable and consistent.
2020-11-28 17:49:47 +09:00
Takashi Kokubun
95edb3ec10
Increase timeout for MJIT Actions
It's too short for --jit-wait
1466690076
2020-11-28 00:17:56 -08:00
Takashi Kokubun
3378a1ccef
Fix compactions.size for throttling
096f54428d changes the behavior for this kind of cases.
2020-11-27 23:46:46 -08:00
Takashi Kokubun
096f54428d
Throttle JIT compaction
The compilation for JIT compaction is very heavy. Triggering a second
compaction to include one more new method is probably not worth it. So
this triggers JIT compaction for ten more new methods after each
compaction.
2020-11-27 23:25:32 -08:00
Takashi Kokubun
2a7e858617
Try to fix the mswin CI failure
Sorry, I forgot to add this in 122cd35939 while I said I did something
for it.
2020-11-27 23:13:18 -08:00
Takashi Kokubun
122cd35939
Throttle unload_units
Because d80226e7bd often reduces the number of unloaded units, it
increases the number of unload_units calls, which are heavy.

To mitigate that, this throttles unload_units per `max_cache_size / 10`.

Also hoping to fix
36552382/job/kjmjgw9cjyf2ksd7
2020-11-27 23:06:40 -08:00
Nobuyoshi Nakada
95bef7b69a Subsecond of Time::tm should be 0 2020-11-28 15:41:41 +09:00
Jeremy Evans
276f6a225d Don't double fractional seconds when passing timezone object to Time.new
I found that fractional seconds were doubled when using the timezone
feature of Time in Sequel's named_timezones extension (which uses
TZInfo for the timezone object), and traced the problem to this code.

There is no subsecx being modified in the utc_to_local call below
this, and I'm not sure why you would want to add in the fractional
seconds unless you assumed the timezone conversion would drop the
existing fractional seconds (TZInfo doesn't drop fractional seconds).
2020-11-28 15:41:41 +09:00
Takashi Kokubun
d80226e7bd
Avoid unloading units which have enough total_calls
instead of just unloading worst 10% methods.
2020-11-27 22:26:14 -08:00
Takashi Kokubun
12866b0d31
Log when JIT compaction is skipped due to ISeq GC 2020-11-27 21:52:47 -08:00
git
46a49536e3 * 2020-11-28 [ci skip] 2020-11-28 14:39:27 +09:00
Takashi Kokubun
16dab6b692
Run unload_units in the JIT worker thread
to avoid "Too many JIT code, but skipped unloading units for JIT compaction".
Now we can forget the `in_compact` locking.

Moving some functions from mjit.c to mjit_worker.c because mjit_worker.c
should have functions executed in the JIT worker.
2020-11-27 21:38:51 -08:00
Benoit Daloze
ddb1736bfc Update to ruby/spec@c4170a3 2020-11-27 15:47:17 +01:00
Benoit Daloze
f02d2f82bf Update to ruby/spec@ac878ad 2020-11-27 14:55:31 +01:00
Benoit Daloze
f0bfa266d7 Update to ruby/mspec@b58e665 2020-11-27 14:55:29 +01:00
Nobuyoshi Nakada
039ba387aa
Use opaque struct pointer than void 2020-11-27 21:38:08 +09:00
Yusuke Endoh
5d8fe1267d configure.ac: Check x86intrin.h only when the target CPU is x86
The check output a warning on M1 Mac mini

20201127T074507Z.log.html.gz
```
checking x86intrin.h usability... no
checking x86intrin.h presence... yes
configure: WARNING: x86intrin.h: present but cannot be compiled
configure: WARNING: x86intrin.h:     check for missing prerequisite headers?
configure: WARNING: x86intrin.h: see the Autoconf documentation
configure: WARNING: x86intrin.h:     section "Present But Cannot Be Compiled"
configure: WARNING: x86intrin.h: proceeding with the compiler's result
checking for x86intrin.h... no
```
2020-11-27 19:53:21 +09:00
Benoit Daloze
f0e2ea2859 Clarify spec and change of behavior for Random::DEFAULT 2020-11-27 10:29:39 +01:00
Takashi Kokubun
d409837729
Cache access to reg_cfp->self on JIT
```
$ benchmark-driver -v --rbenv 'before --jit;after --jit' --repeat-count=12 --alternate --output=all benchmark.yml
before --jit: ruby 3.0.0dev (2020-11-27T06:41:15Z master 8ce1711c25) +JIT [x86_64-linux]
after --jit: ruby 3.0.0dev (2020-11-27T08:36:02Z master 2c592126b9) +JIT [x86_64-linux]
last_commit=Cache access to reg_cfp->self on JIT
Calculating -------------------------------------
                                 before --jit           after --jit
Optcarrot Lan_Master.nes    82.40522392468650     82.66023870551237 fps
                            82.67998539899482     83.08660305312587
                            85.51280693947453     87.09311989553235
                            86.32925337181406     87.16115255191410
                            87.35617494926235     87.30699391518075
                            87.91865339426212     88.47590342996875
                            88.11573661006648     88.64778616696353
                            88.16060826662158     88.67015079203991
                            88.21639244865058     89.19630739497482
                            88.47241577897603     89.23443637947730
                            89.37087287229809     89.57052723997015
                            89.46969964699964     89.97803363889025
```
2020-11-27 00:42:42 -08:00
Koichi Sasada
5496415d31 mark default_rand
default_rand can points a Bignum seed, so it should be marked.
2020-11-27 17:36:02 +09:00
Koichi Sasada
2db2fb9f6c per-ractor Random::DEFAULT
Random generators are not Ractor-safe, so we need to prepare
per-ractor default random genearators. This patch set
`Random::DEFAULT = Randm` (not a Random instance, but the Random
class) and singleton methods like `Random.rand()` use a per-ractor
random generator.

[Feature #17322]
2020-11-27 17:03:30 +09:00
Takashi Kokubun
8ce1711c25
Revert "Set VM_FRAME_FLAG_FINISH at once on MJIT"
This reverts commit 4d2c8edca6.

Unfortunately this seems to cause several issues:
1462188376
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3272802
2020-11-26 22:41:15 -08:00
Takashi Kokubun
4d2c8edca6
Set VM_FRAME_FLAG_FINISH at once on MJIT
Performance is probably improved?

$ benchmark-driver -v --rbenv 'before --jit;after --jit' --repeat-count=12 --alternate --output=all benchmark.yml
before --jit: ruby 3.0.0dev (2020-11-27T04:37:47Z master 69e77e81dc) +JIT [x86_64-linux]
after --jit: ruby 3.0.0dev (2020-11-27T05:28:19Z master df6b05c6dd) +JIT [x86_64-linux]
last_commit=Set VM_FRAME_FLAG_FINISH at once
Calculating -------------------------------------
                                 before --jit           after --jit
Optcarrot Lan_Master.nes    80.89292998533379     82.19497327502751 fps
                            80.93130641142331     85.13943315260148
                            81.06214830270119     87.43757879797808
                            82.29172808453910     87.89942441487113
                            84.61206450455929     87.91309779491075
                            85.44545883567997     87.98026086648694
                            86.02923132404449     88.03081060383973
                            86.07411817365879     88.14650206137341
                            86.34348799602836     88.32791633649961
                            87.90257338977324     88.57599644892220
                            88.58006509876580     88.67426384743277
                            89.26611118140011     88.81669430874207

This should have no bad impact on VM because this function is ALWAYS_INLINE.
2020-11-26 21:32:14 -08:00
Takashi Kokubun
69e77e81dc
Run rb_print_backtrace first on ruby_on_ci
Unfortunately we couldn't see a C backtrace with the previous commit
http://ci.rvm.jp/results/trunk-random2@phosphorus-docker/3272697.
2020-11-26 20:37:47 -08:00
Takashi Kokubun
4dbf6f1e51
Call rb_bug_without_die on CI
when GC.compact's SEGV handler is installed
2020-11-26 20:09:57 -08:00
Nobuyoshi Nakada
82541df081
Separated tests for $KCODE and $= 2020-11-27 13:09:20 +09:00
Nobuyoshi Nakada
eca854041f
[DOC] Mersenne Twister isn't cryptographically secure [ci skip] 2020-11-27 12:47:31 +09:00
git
ead32e6e64 * 2020-11-27 [ci skip] 2020-11-27 12:25:32 +09:00
Takashi Kokubun
1898e9558a
Always clean up leftovers at ci.rvm.jp
to prevent failures like
http://ci.rvm.jp/logfiles/brlog.trunk-mjit.20201126-182515.

Since fa1250a506, it should be safe to do
this.
2020-11-26 19:23:35 -08:00
Nobuyoshi Nakada
f5ca3ff4db
Store all kinds of syntax errors [Bug #17345] 2020-11-26 20:14:34 +09:00
Nobuyoshi Nakada
1df3896382
Removed a duplicate assertion 2020-11-26 20:03:38 +09:00
Yusuke Endoh
6be9d18a4d Update TypeProf to 0.7.0 2020-11-26 15:13:32 +09:00
Nobuyoshi Nakada
af80df1820
Keep patched zlib files 2020-11-26 09:37:38 +09:00
Alan Wu
e0944bde91 Prefer rb_module_new() over rb_define_module_id()
rb_define_module_id() doesn't do anything with its parameter so
it's a bit confusing.
2020-11-25 17:05:06 -05:00
git
526d0f46f3 * 2020-11-26 [ci skip] 2020-11-26 04:29:50 +09:00
Aaron Patterson
c32218de1b
Disable auto compaction on platforms that can't support it
Both explicit compaction routines (gc_compact and the verify references form)
need to clear the heap before executing compaction.  Otherwise some
objects may not be alive, and we'll need the read barrier.  The heap
must only contain *live* objects if we want to disable the read barrier
during explicit compaction.

The previous commit was missing the "clear the heap" phase from the
"verify references" explicit compaction function.

Fixes [Bug #17306]
2020-11-25 11:29:14 -08:00
Koichi Sasada
7aaf6676c4 should stop other ractors on transient_heap_evacuate
transient_heap_evacuate() evacuates all living objects from theap
to malloc mangaed memory. This evacuation can run in any ractors
in parallel with other ractor's execution and it is danger.

To stop such danger parallel execution, use rb_vm_barrier() to
stop all other ractors.
2020-11-25 16:14:01 +09:00
Koichi Sasada
d43d4acf26 fix error message 2020-11-25 15:51:31 +09:00
Koichi Sasada
a79fe07db6 show the error message before Ractor.yield
Ractor's error will be printed if Thread#report_on_exception
is true (default), and error message is used. Without this patch,
the exception object is sent by Ractor.yield and it can be shared
with another ractor.

http://ci.rvm.jp/results/trunk-random3@phosphorus-docker/3269368

To prevent such sharing, show errors befor Ractor.yield().
2020-11-25 15:08:10 +09:00
Aaron Patterson
fed67fe6b2
Revert "Disable auto compaction on platforms that can't support it"
This reverts commit 63ad55cd88.

Revert "Disable read barrier on explicit compaction request"

This reverts commit 490b57783d.
2020-11-24 21:30:13 -08:00
Takashi Kokubun
00f046ef57
Report a full_message on a worker crash
A worker crash happens very often, but we're not sure why.
I'd like to know a backtrace if it's available.
2020-11-24 20:36:39 -08:00
Takashi Kokubun
eaa87be5f6
Skip test_ractor.rb:137 for --jit-min-calls=5
It's failing like
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3270373 but I
have no bandwidth to fix it for now.

We're still checking --jit-wait (without --jit-min-calls=5) on GitHub
Actions.
2020-11-24 20:18:05 -08:00