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

Refine the logic for scanning Julia stacks #4058

Merged
merged 1 commit into from
Jun 30, 2020

Conversation

rbehrends
Copy link
Contributor

This fixes how we handle scanning the root task of the main thread. It also improves the comments that explain stack scanning logic.

@coveralls
Copy link

coveralls commented Jun 24, 2020

Coverage Status

Coverage decreased (-0.0005%) to 84.891% when pulling 5c431b5 on rbehrends:julia-gc-stackscan into 9ea64ed on gap-system:master.

src/julia_gc.c Outdated Show resolved Hide resolved
src/julia_gc.c Outdated Show resolved Hide resolved
src/julia_gc.c Outdated Show resolved Hide resolved
src/julia_gc.c Outdated Show resolved Hide resolved
src/julia_gc.c Outdated Show resolved Hide resolved
src/julia_gc.c Show resolved Hide resolved
src/julia_gc.c Outdated Show resolved Hide resolved
src/julia_gc.c Outdated Show resolved Hide resolved
src/julia_gc.c Outdated Show resolved Hide resolved
src/julia_gc.c Outdated Show resolved Hide resolved
src/julia_gc.c Outdated Show resolved Hide resolved
src/julia_gc.c Outdated Show resolved Hide resolved
src/julia_gc.c Show resolved Hide resolved
@fingolfin fingolfin added topic: julia Julia GC integration and related matters topic: kernel labels Jun 26, 2020
src/julia_gc.c Outdated
if (task->copy_stack) {
// task->copy_stack, if not zero or one, is an upper bound for the
// size of the stack.
if (task->copy_stack > 1) {
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure this is quite right now -- the value task->copy_stack == 1 should probably still be treated separately? I think it can only occur for "fresh" tasks which don't have a stack allocation yet; so I assume we could just do if (task->copy_stack ==1) return; or so?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I'll go and have a look at that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, task->copy_stack == 1 implies task->bufsz == 0. This means that the logic is accidentally correct, but the comment would have to change. But I think that making control flow more explicit by aborting stack scanning for task->copy_stack == 1 is much clearer, so I'll go with that.

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

One minor typo, otherwise looks good and is ready to be merged.

I assume we'll want to backport this to 4.11, too...

src/julia_gc.c Outdated Show resolved Hide resolved
@fingolfin
Copy link
Member

Done in 74cfb2a

@fingolfin fingolfin deleted the julia-gc-stackscan branch July 3, 2020 14:30
@PaulaHaehndel PaulaHaehndel self-assigned this Feb 16, 2021
@PaulaHaehndel PaulaHaehndel added the release notes: added PRs introducing changes that have since been mentioned in the release notes label Feb 16, 2021
@PaulaHaehndel PaulaHaehndel removed their assignment Feb 16, 2021
@PaulaHaehndel PaulaHaehndel changed the title Refine the logic for scanning Julia stacks. Refine the logic for scanning Julia stacks Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-4.11-DONE release notes: added PRs introducing changes that have since been mentioned in the release notes topic: julia Julia GC integration and related matters topic: kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants