#2604 rebased - fork() based garbage collector#3514
Conversation
|
Thanks for your pull request, @rainers! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + druntime#3514" |
|
Thanks for doing this @rainers ! Fingers crossed! Things look good momentarily. |
|
https://sourceware.org/bugzilla/show_bug.cgi?id=4737 On 2.34 with now have _Fork (c32c868ab8b2b) which is a async-signal-safe fork() replacement added by Austin Group issue 62 [1]. The Austin defect also dropped the async-signal-safe requirement for fork, so currently there is no plan to try make fork() async-signal-safe. |
|
@ibuclaw Thanks for the link. It seems the fork issue might actually be causing the failures (most seem to be deadlocking and are terminated by timeout). libc 2.34 doesn't seem to be released yet and might take some time before being available in major distros. Do you think it would be possible now to emulate what |
|
|
I have tried to imitate that for Linux/x86_64. Let's see if this platform passes now. |
d52d679 to
f784ff8
Compare
|
This has passed all tests with the forking GC enabled, so should be ready for review.
Running the GC benchmarks (in a VM with 4 cores on an i5-2865U), I get The last value on each line is the most interesting one: the maximum pause time. Compare this with the non-forking GC (with parallel marking disabled): For reference, these are the results with parallel marking: Observations:
|
|
fork:
parallel marking:
Does this mean the forking GC increases the runtime by > 100% and requires more than 200x as much RAM?! |
I guess this is an extreme example made worse by running in a VM. All the test does is allocating random chunks of memory. That's a pattern that isn't handled very well as there is no throttling of the allocation rate. GC time is quite a bit less than without forking, but overall run time is usually worse. I suspect this is the penalty for COW, which is probably exaggerated by the VM. It would be nice if someone could test this on a native linux system. |
bce649e to
869303d
Compare
|
Hi @llucax, you might be interested in this, too. |
Hi @rainers, thanks! As @ibuclaw said, I recently got a notification about the new I'll have a look at when I have some time, at least to the clone part, as the rest if it's what @FraMecca did, I already reviewed it during SAOC. |
I want to add to this that in my experiments (that are almost 11 years old 😱 ) I notice in real programs (actually I only tested one real program) the total runtime was less, which was unexpected. The COW and other overhead should make the totl runtime worse, but it also adds concurrency for free, at least for single-threaded programs (so this benefits might only be present in such programs), so if instead of waiting for the GC to finish to do actual calculations you are still doing the calculations your program is supposed to do, it means it will finish earlier, and this is what I observed with this particular program (and some other benchmarks that follow this pattern, you can see in these benchmarks that So which GC to use might depend a lot on your particular program, there is no silver bullet. Hopefully the default GC should be good enough for the majority of cases, but when you are bumping into walls, you certainly might benefit from trying different GC configurations. For reference, this is the 11 years old blog post where I did the first GC benchmarks of the fully concurrent GC, |
|
Everyone OK with merging this? |
|
It now needs a rebase after merging #3523 though... |
…ed in the wrong process
Done. |
- it doesn't test any specific code generation, but rather puts pressure on the GC - it has been added to druntime in dlang/druntime#3514 as it uncovered issues for the concurrent GC - it uses phobos
- it doesn't test any specific code generation, but rather puts pressure on the GC - it has been added to druntime in dlang/druntime#3514 as it uncovered issues for the concurrent GC - it uses phobos
- it doesn't test any specific code generation, but rather puts pressure on the GC - it has been added to druntime in dlang/druntime#3514 as it uncovered issues for the concurrent GC - it uses phobos
- it doesn't test any specific code generation, but rather puts pressure on the GC - it has been added to druntime in dlang/druntime#3514 as it uncovered issues for the concurrent GC - it uses phobos
- it doesn't test any specific code generation, but rather puts pressure on the GC - it has been added to druntime in dlang/druntime#3514 as it uncovered issues for the concurrent GC - it uses phobos
Attempt to rebase #2604 to see whether it still fails