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

gcext: add ptls argument to task scanner #54638

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fingolfin
Copy link
Member

Access to ptls is generally necessary when marking objects so it makes sense to pass it to the task scanner.

We pass it as the last argument to the callback so that existing consumers of this API hopefully keep working without recompilation, they will just ignore this new argument.

I hope this can still be put into 1.11.

From my POV it could also go into 1.10, as existing binaries linked again prior Julia 1.10.x releases should keep working; but compiling consumers of this API will trigger a warning or even error (trivial to fix), which seems somewhat problematic to me? So perhaps better not.

@fingolfin fingolfin added the backport 1.11 Change should be backported to release-1.11 label May 31, 2024
@vchuravy
Copy link
Member

While I agree that this is a good simplification of the API, I would like to understand the rational for backporting it a bit better.

E.g. why isn't jl_ptls_t ptls = jl_get_ptls_states(); from inside the root scanner sufficient?

@fingolfin
Copy link
Member Author

That's a great question and actually I've been debating back and forth with myself whether to submit this in the first place (ignoring backports), and so perhaps this should just be closed outright (sorry, I should have made that clear in the PR description but was too tired last night/morning).

So first off, the root scanner actually does jl_ptls_t ptls = jl_get_ptls_states();, but for the task scanner, this is currently broken (as in: crashing) in 1.10. However, I hope the fix for this will be backported in time for 1.10.4, see #54632.

That said, it still seems like an oversight to me that we don't pass the ptls to those callbacks, all other GC internals calls get the ptls as an argument. But it may not be worth the pain to do it at all, given that jl_get_ptls_states now works again while the GC is active. So perhaps this PR is redundant. At the very least it seems OK to only do it for 1.12 (or perhaps 1.12 and 1.11, assuming it has a chance of getting in before 1.11.0)

@vchuravy
Copy link
Member

Yeah at this point in the 1.11 cycle it becomes a risk assessment. Since you are one of the primary users of this interface it's up to you.

My concern is that there may already be binaries built against 1.11 and while the change should not be an issue on x86 Linux I am less sure about other ABIs.

So LGTM for 1.12 but for 1.11 I would be conservative.

@fingolfin fingolfin removed the backport 1.11 Change should be backported to release-1.11 label Jun 2, 2024
Access to ptls is generally necessary when marking objects so it
makes sense to pass it to the task scanner.

We pass it as the last argument to the callback so that existing
consumers of this API hopefully keep working, they will just
ignore this new argument.
@tecosaur
Copy link
Contributor

With @vchuravy's "LGTM for 1.12", I imagine this could probably be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants