julia_gc: remove SKIP_GUARD_PAGES mode #5727
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thejl_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.