-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
runtime: contended mutex profiling doesn't work for sync.RWMutex #18496
Comments
Some profiling information is collected when using the Lock/Unlock methods of a |
This is probably an oversight but I am not willing to change it at this point in the release cycle. Let's fix it early in Go 1.9. /cc @pjweinb |
Is it worth a note in the documentation or is this issue good enough? |
Sent https://go-review.googlesource.com/34831 for the docs. Thanks.
|
CL https://golang.org/cl/34831 mentions this issue. |
For #18496. Change-Id: I50ced7c9f0fe5d9c627eef1f59a7f73be742e04c Reviewed-on: https://go-review.googlesource.com/34831 Run-TryBot: Russ Cox <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
I will produce a CL for 1.9. |
How's it going @pjweinbgo, still interested in working on this issue? |
Has this been fixed? One can use |
i don't think so.
…On Tue, Nov 7, 2017 at 2:02 AM, Alec Matusis ***@***.***> wrote:
Has this been fixed?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18496 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFKAIxXi-Xhdv8N6lEXC10nGJNeK3rCNks5s0AB8gaJpZM4LZP_2>
.
|
Change https://golang.org/cl/87095 mentions this issue: |
I've created a "straw man" CL based on the comments in this issue. Testing with the following makes pprof report contention on both RWMutex.Unlock and RWMutex.RUnlock. func BenchmarkRWMutex(b *testing.B) {
var mu sync.RWMutex
mu.Lock()
go func() {
for {
time.Sleep(10 * time.Millisecond)
mu.Unlock()
time.Sleep(10 * time.Millisecond)
mu.Lock()
}
}()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
mu.RLock()
time.Sleep(10 * time.Millisecond)
mu.RUnlock()
}
})
} I'm not sure whether the measurements are attributed to the right call stack though. |
What version of Go are you using (
go version
)?go version devel +9def857072 Mon Jan 2 20:21:02 2017 +0000 darwin/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
Ran a benchmark with a RWMutex and
-mutexprofile
enabled.Example:
What did you expect to see?
Mutex contention information.
Example from a similar test using
Lock/Unlock
:What did you see instead?
I see that
sync.Mutex
was changed to useruntime_SemacquireMutex
instead ofruntime_Semacquire
in https://golang.org/cl/29650/, butsync.RWMutex
continues to useruntime_Semacquire
.I'm unsure if
sync.RWMutex
was excluded from profiling intentionally, but the lack of profiling information was surprising to me.The text was updated successfully, but these errors were encountered: