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

Skip sending ETW trace event for nested lock which is always granted automatically #1301

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

lifengl
Copy link
Member

@lifengl lifengl commented Apr 16, 2024

Asking nested lock was not considered to be costly, but sending extra ETW event makes them to pop in performance traces. Since they don't provide much value to understand those traces, we should suppress them.

(Note: we don't send ETW when lock is released, so there is no work there.)

The reason behind this change is that this specific ETW event sometime is the primary delay of certain code path, and sometime could cause incorrect interpreting the trace.

During around 7s solution loading trace, the total thread delay from ETW events is about 1.8s, and this event contributed 0.8s, 2x more than any other events. Because capturing stack of ordinal nested lock does not provide lots of value, i think we should suppress it. It would still send event for all top level locks and when an upgradable lock becomes a write lock.

image

Note: the real CPU usage in VS is much lower, the overhead is mostly when the system collects stacks during capturing the event. It adds extra time to the code path, instead of direct CPU usage.

…automatically.

Asking nested lock was not considered to be costly, but sending extra ETW event makes them to pop in performance traces. Since they don't provide much value to understand those traces, we should suppress them.

(Note: we don't send ETW when lock is released, so there is no work there.)
@lifengl lifengl requested a review from AArnott April 16, 2024 00:48
@AArnott AArnott added this to the v17.11 milestone Apr 18, 2024
@AArnott AArnott merged commit d23c489 into main Apr 18, 2024
6 checks passed
@AArnott AArnott deleted the dev/lifengl/skipETWForOrdinalNestedLock branch April 18, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants