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

julia_gc: remove SKIP_GUARD_PAGES mode #5727

Merged
merged 1 commit into from
May 28, 2024

Conversation

fingolfin
Copy link
Member

Two reasons for the removal: 1. it doesn't work as implemented; e.g. on my system it skips 4kb guard page but there actually is an 8kb guard page; 2. it is conceptually the wrong place to do it here.

Instead, the Julia function jl_active_task_stack needs to be adapted to skip guard pages. Only it has enough information to do so correctly and in all cases. Indeed, in some task stacks, there is a guard page allocated by the operating system and hence the code removed by this commit would do the right thing.

But for other task stacks the guard page is actually created by Julia (which explains why it can be larger than whatever guard page size is configured in pthreads), but the details actually depend on the platform, and so we don't have enough information about it.

So we just drop the guard page code here. In a future version of Julia, jl_active_task_stack will skip guard pages. And then the jl_get_safe_restore / jl_set_safe_restore mechanism just won't be triggered anymore, and we can eventually remove it, in a future revision of this code.

Two reasons for the removal: 1. it doesn't work as implemented;
e.g. on my system it skips 4kb guard page but there actually is an
8kb guard page; 2. it is conceptually the wrong place to do it
here.

Instead, the Julia function `jl_active_task_stack` needs to be
adapted to skip guard pages. Only it has enough information to do
so correctly and in all cases. Indeed, in some task stacks, there
is a guard page allocated by the operating system and hence the
code removed by this commit would do the right thing.

But for other task stacks the guard page is actually created by
Julia (which explains why it can be larger than whatever guard
page size is configured in pthreads), but the details actually
depend on the platform, and so we don't have enough information
about it.

So we just drop the guard page code here. In a future version of
Julia, `jl_active_task_stack` will skip guard pages. And then the
`jl_get_safe_restore` / `jl_set_safe_restore` mechanism just won't
be triggered anymore, and we can eventually remove it, in a future
revision of this code.
@fingolfin fingolfin added topic: kernel release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes topic: julia Julia GC integration and related matters backport-to-4.13 labels May 27, 2024
@fingolfin fingolfin merged commit d74e52b into gap-system:master May 28, 2024
25 checks passed
@fingolfin fingolfin deleted the mh/julia_gc_guard_pages branch May 28, 2024 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-4.13-DONE release notes: not needed PRs introducing changes that are wholly irrelevant to 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.

2 participants