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

Switch macOS task mechanism back to ASM #39679

Merged
merged 1 commit into from
Feb 18, 2021
Merged

Switch macOS task mechanism back to ASM #39679

merged 1 commit into from
Feb 18, 2021

Conversation

Keno
Copy link
Member

@Keno Keno commented Feb 15, 2021

5327824 rearranged the ifdefs here and
accidentally switched macOS to unwind based switching, which is much slower.

5327824 rearranged the ifdefs here and
accidentally switched macOS to unwind based switching, which is much slower.
@Keno Keno added performance Must go faster system:mac Affects only macOS kind:embarrassing-bugfix Whoops! labels Feb 15, 2021
@Keno Keno requested a review from vtjnash February 15, 2021 23:02
@vtjnash
Copy link
Sponsor Member

vtjnash commented Feb 15, 2021

This was intentional. In benchmarks, it was somewhat slower than the best, but nowhere near how abysmal linux was.

@Keno
Copy link
Member Author

Keno commented Feb 15, 2021

I don't think slowing down the task switch path with something that needs to read unwind tables is an acceptable solution to this. Can you explain what the problem is with using the ASM implementation?

@vtjnash
Copy link
Sponsor Member

vtjnash commented Feb 15, 2021

It reads them pretty fast (around the cost of the kernel context switch we also already do). Perhaps it shouldn't do either one, but people haven't generally complained about it much.

@Keno Keno removed the kind:embarrassing-bugfix Whoops! label Feb 15, 2021
@Keno
Copy link
Member Author

Keno commented Feb 16, 2021

From offline discussion with @vtjnash, this change was intentional, because GDB like to crash when it encounters setjmp/longjmp, so this needs to be enabled for effective debugging of tasks. However, we already turn it off on Linux for performance reasons and I noticed additional performance concerns (over and above the 5x slow down reported in the additional PR) with the upcoming switch to the LLVM unwind library. In the fullness of time, we should switch to something even faster on all platforms, which I wrote down over in #39680.

@Keno Keno changed the title Fix regression in macOS task switch performance Switch macOS task mechanism back to ASM Feb 16, 2021
@Keno Keno merged commit 0d47bfe into master Feb 18, 2021
@Keno Keno deleted the kf/macostaskswitch branch February 18, 2021 21:43
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
5327824 rearranged the ifdefs here and
switched macOS to unwind based switching, which is somewhat slower. That was
deemed acceptable at the time, because it work around some GDB misbehavior
in setjmp. However, we're about to update to the LLVM libunwind fork, which
appears to be even slower here, so switch back to ASM to avoid that performance
regression.
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request May 9, 2021
5327824 rearranged the ifdefs here and
switched macOS to unwind based switching, which is somewhat slower. That was
deemed acceptable at the time, because it work around some GDB misbehavior
in setjmp. However, we're about to update to the LLVM libunwind fork, which
appears to be even slower here, so switch back to ASM to avoid that performance
regression.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster system:mac Affects only macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants