-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Excessive clock queries causing slowdown on freebsd #38877
Comments
I'm a bit confused though, because FreeBSD appears to have the same vDSO based acceleration for this system call (https://github.com/lattera/freebsd/blob/401a161083850a9a4ce916f37520c084cff1543b/lib/libc/sys/__vdso_gettimeofday.c) |
Hmm:
This is on AWS, but it looks like if the TSC timecounter is disabled, then so is the gettime fastpath: https://github.com/lattera/freebsd/blob/401a161083850a9a4ce916f37520c084cff1543b/sys/x86/x86/tsc.c#L760 |
Two action items here:
|
@kostikbel, apologies for the ping, but do you have any insight on the FreeBSD internals aspect here? I ask because you're on the copyright for the file in question. 🙂 |
Problem is that smp_tsc == 0. For start, try to set the loader tunables kern.timecounter.smp_tsc=1 and kern.timecounter.smp_tsc_adjust=1 and see
|
@ararslan Can you experiment with this? E.g. just time the build of
|
Note that I'm just using the stock AMI that's available on EC2. |
Meanwhile I'm working on a PR to disable spamming the timer unless during |
Yes but only on a local machine; I don't have a virtualized FreeBSD environment. Will that still be useful? |
I can spin you up a freebsd box on AWS with identical configuration. |
If anyone has a test system up, it may be good to double check that #38885 removes all unwanted |
Alright, this issue is resolved for us, but I think it's worth for @ararslan to continue following up with upstream to see why the vdso optimization is disabled on the default AWS images. After all, what's the point of such an optimization if it doesn't actually run a lot of the time. |
For reference, upstream code review to stop avoiding TSC in VMs (which will enable the vdso optimization): https://reviews.freebsd.org/D27629 |
I suspect that virtualization techniques improved from the time when we have to effectively disable TSC use in VM. For instance, it was reported (complained) in JuliaLang/julia#38877 that FreeBSD is groundlessly slow on AWS with some loads. Remove the check and start watching for complaints. Reviewed by: emaste, grehan Discussed with: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27629
I suspect that virtualization techniques improved from the time when we have to effectively disable TSC use in VM. For instance, it was reported (complained) in JuliaLang/julia#38877 that FreeBSD is groundlessly slow on AWS with some loads. Remove the check and start watching for complaints. Reviewed by: emaste, grehan Discussed with: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27629
I suspect that virtualization techniques improved from the time when we have to effectively disable TSC use in VM. For instance, it was reported (complained) in JuliaLang/julia#38877 that FreeBSD is groundlessly slow on AWS with some loads. Remove the check and start watching for complaints. Reviewed by: emaste, grehan Discussed with: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27629
I suspect that virtualization techniques improved from the time when we have to effectively disable TSC use in VM. For instance, it was reported (complained) in JuliaLang/julia#38877 that FreeBSD is groundlessly slow on AWS with some loads. Remove the check and start watching for complaints. Reviewed by: emaste, grehan Discussed with: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27629
I suspect that virtualization techniques improved from the time when we have to effectively disable TSC use in VM. For instance, it was reported (complained) in JuliaLang/julia#38877 that FreeBSD is groundlessly slow on AWS with some loads. Remove the check and start watching for complaints. Reviewed by: emaste, grehan Discussed with: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27629
I suspect that virtualization techniques improved from the time when we have to effectively disable TSC use in VM. For instance, it was reported (complained) in JuliaLang/julia#38877 that FreeBSD is groundlessly slow on AWS with some loads. Remove the check and start watching for complaints. Reviewed by: emaste, grehan Discussed with: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27629
I suspect that virtualization techniques improved from the time when we have to effectively disable TSC use in VM. For instance, it was reported (complained) in JuliaLang/julia#38877 that FreeBSD is groundlessly slow on AWS with some loads. Remove the check and start watching for complaints. Reviewed by: emaste, grehan Discussed with: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27629
I suspect that virtualization techniques improved from the time when we have to effectively disable TSC use in VM. For instance, it was reported (complained) in JuliaLang/julia#38877 that FreeBSD is groundlessly slow on AWS with some loads. Remove the check and start watching for complaints. Reviewed by: emaste, grehan Discussed with: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27629
I suspect that virtualization techniques improved from the time when we have to effectively disable TSC use in VM. For instance, it was reported (complained) in JuliaLang/julia#38877 that FreeBSD is groundlessly slow on AWS with some loads. Remove the check and start watching for complaints. Reviewed by: emaste, grehan Discussed with: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27629
I suspect that virtualization techniques improved from the time when we have to effectively disable TSC use in VM. For instance, it was reported (complained) in JuliaLang/julia#38877 that FreeBSD is groundlessly slow on AWS with some loads. Remove the check and start watching for complaints. Reviewed by: emaste, grehan Discussed with: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27629
On freebsd, the
jl_hrtime
calls that we use to compute time spent in the compiler appear to be taking 70% of total execution time of compile-heavy julia processes. On linux it's not quite as bad, because this syscall has a special fastpath, but either way, this time is clearly excessive. cc @ianshmean who added this timer in #37678. At the very least, it should only be on in@time
.The text was updated successfully, but these errors were encountered: