3 ms·
Very interesting points about mutex profiles. When you say fast path, do you mean spin locks? For analyzing I/O via perf and looking at kernel stacks, I'm surp
by felixge 5y ago
Very interesting points about mutex profiles. When you say fast path, do you mean spin locks?
For analyzing I/O via perf and looking at kernel stacks, I'm surprised that would work. I'd think that perf will not show you much waiting on the network, because the netpoller implementation in Go uses epoll and friends to make that non-blocking under the hood. For disk I/O it probably works. Maybe I'm missing something?
- jrockway 5y agoThere's a CompareAndSwap to do a quick acquire when there isn't contention: https://github.com/golang/go/blob/master/src/sync/mutex.go#L72 https://github.com/golang/go/blob/master/src/sync/mutex.go#L... If you look at the slow path, there are many interesting paths that a lock can take in there. They are all potentially interesting when you're debugging contention.