Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GC: Use upstream patch for green threads support #8225

Merged
merged 2 commits into from
Sep 26, 2019
Merged

Conversation

bcardiff
Copy link
Member

@bcardiff bcardiff commented Sep 24, 2019

This requires also an update of the distribution-scripts (reason why this PR is draft).
A compiler with the updated GC 8.0.4 + upstream patch will be available in circleci for a smoke testing. So far it seems to work locally.

The preview_mt jobs will fail with compilation issues since the 0.31.0 has the old patch bundled.

As of the changes itself, bdw-gc patch ended returning an opaque thread handler that is stored now in Thread.gc_thread_handler and a StackBase structure that is the stackbottom in most architectures. In IA-64 includes the reg_base, but we don't support IA-64. Since the fibers only knows about the stackbottom, I preferred to leave the reg_base commented.

Depends on: crystal-lang/distribution-scripts#47

Fixes: #8213

@bcardiff
Copy link
Member Author

A build with the upstream patch is available in snap refresh crystal --channel=edge/ci-update-gc-dev.

Unsigned rpm, deb packages and tar.gz can be downloaded from https://circleci.com/gh/crystal-lang/crystal/29489#artifacts/containers/0 in case someone is willing to smoke on their environment.

@bcardiff bcardiff marked this pull request as ready for review September 25, 2019 15:09
@bcardiff
Copy link
Member Author

On my side the smoke test went well. I've run the benchmarks and nothing explodes, memory consumption was similar than before.

If someone else wants to confirm/try and review the changes we can move forward here.

@bararchy
Copy link
Contributor

@bcardiff works for us 👍

@@ -17,6 +17,13 @@ lib LibGC
alias SizeT = LibC::SizeT
alias Word = LibC::ULong

struct StackBase
mem_base : Void*
# reg_base : Void* should be used also for IA-64 when/if supported
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will never support IA-64, the architecture is thoroughly dead.

@anatol
Copy link
Contributor

anatol commented Sep 26, 2019

I tested this patch with upstream GC changes at Arch Linux and it looks good. Thank you for the work.

One the patch lands crystal repo I'll push a new Arch crystal package.

@bararchy
Copy link
Contributor

@bcardiff seems both @anatol and our team verified it's working, this will really help up streamline development.
Can we cut a new version? 🙏

@bcardiff bcardiff merged commit cdafa0e into master Sep 26, 2019
@bcardiff bcardiff deleted the ci/update-gc branch September 27, 2019 17:59
bcardiff pushed a commit that referenced this pull request Sep 27, 2019
* Use bdw-gc upstream mt patch
* Update distribution-scripts
straight-shoota added a commit to straight-shoota/crystal that referenced this pull request Nov 26, 2019
This makes sure Fiber compiles on win32.

Fixes a merge order issue with crystal-lang#8225 and crystal-lang#7995.
straight-shoota added a commit that referenced this pull request Nov 27, 2019
This makes sure Fiber compiles on win32.

Fixes a merge order issue with #8225 and #7995.
dnamsons pushed a commit to dnamsons/crystal that referenced this pull request Jan 10, 2020
* Use bdw-gc upstream mt patch
* Update distribution-scripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port MT support to upstream bdw-gc getstackbottom patch
4 participants