Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Apply SuppressGCAttribute to some SPCL functions.#27369

Merged
AaronRobinsonMSFT merged 2 commits intodotnet:masterfrom
AaronRobinsonMSFT:apply_suppressgctransition
Oct 23, 2019
Merged

Apply SuppressGCAttribute to some SPCL functions.#27369
AaronRobinsonMSFT merged 2 commits intodotnet:masterfrom
AaronRobinsonMSFT:apply_suppressgctransition

Conversation

@AaronRobinsonMSFT
Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 5.0 milestone Oct 22, 2019
@jkotas
Copy link
Member

jkotas commented Oct 22, 2019

You can also add it to QueryPerformanceCounter and SystemNative_GetTimestamp.

@stephentoub
Copy link
Member

We're confident adding these because we've looked at the implementations in Windows and know the target functions meet our constraints?

@AaronRobinsonMSFT
Copy link
Member Author

@jkotas I would prefer to scope this only to those methods that I personally vetted in this review. There should be a larger initiative to investigate benefit to those functions and ensure there is value.

@stephentoub The QueryPerformanceCounter() is a tricky function because it is heavily optimized on some systems and very fast. However, on some older hardware it could invalidate some of our recommended guidance. I believe on Windows 7 the chance of hitting some of those issues is also possible due to how it was implemented on that system. I would need to look into SystemNative_GetTimestamp.

@jkotas
Copy link
Member

jkotas commented Oct 22, 2019

Which part of the guidance do you believe is invalid for QueryPerformanceCounter on Win7?

@AaronRobinsonMSFT
Copy link
Member Author

@jkotas It is more than a few instructions and can call into an external device for the timestamp. Admittedly it isn't blocking, so perhaps my statement is a stronger than it should be. There is no SLA on how long it can occur nor its precise implementation so on older systems it can be much more complex than we currently observe. When I was on the VS profiler team we were informed this was a possibility on older systems.

@jkotas
Copy link
Member

jkotas commented Oct 22, 2019

You can also update the comment on the attribute "/// The eventual public attribute should replace this one: https://github.com/dotnet/corefx/issues/40740".

@AaronRobinsonMSFT
Copy link
Member Author

That is done in #27368

@jkotas
Copy link
Member

jkotas commented Oct 22, 2019

Admittedly it isn't blocking

Right. I think it should be pretty safe to add this on QueryPerformanceCounter .

on older systems.

There are many things that work in less ideal way on Win7. I am not particularly concerned about the GC pause time being 0.1ms longer on Win7 once in a while.

Only insert GC_POLL in first morph call.
@AaronRobinsonMSFT
Copy link
Member Author

@jkotas I applied to both QueryPerformanceCounter() and SystemNative_GetTimestamp(). These don't get consumed in SPCL right now so I didn't validate much but I guess I can iterate on issues quickly if we hit any in CoreFX. I was going to add to QueryPerformanceFrequency() but decided not to because that should be a single call and not called with the same frequency.

@stephentoub The implementation of SystemNative_GetTimestamp() appears to satisfy all our requirements so I am inclined to apply it there as well. I hit another JIT issue so needed to validate some things and went through the QPC check locally. I don't see any obvious issues with applying them.

@briansull Please review the JIT changes we spoke about. Thanks.

@stephentoub
Copy link
Member

The implementation of SystemNative_GetTimestamp() appears to satisfy all our requirements so I am inclined to apply it there as well. I hit another JIT issue so needed to validate some things and went through the QPC check locally. I don't see any obvious issues with applying them.

Thanks. My question was more general about everything in this PR, not just the two functions Jan mentioned. I just wanted to confirm that we're confident in these cases. It sounds like we are.

Copy link

@briansull briansull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit 8bc7fab into dotnet:master Oct 23, 2019
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the apply_suppressgctransition branch October 23, 2019 05:37
Dotnet-GitSync-Bot pushed a commit to Dotnet-GitSync-Bot/corefx that referenced this pull request Oct 23, 2019
Apply SuppressGCAttribute to some SPCL functions.

Only insert GC_POLL in first morph call.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Dotnet-GitSync-Bot pushed a commit to Dotnet-GitSync-Bot/corert that referenced this pull request Oct 23, 2019
Apply SuppressGCAttribute to some SPCL functions.

Only insert GC_POLL in first morph call.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Dotnet-GitSync-Bot pushed a commit to Dotnet-GitSync-Bot/mono that referenced this pull request Oct 23, 2019
Apply SuppressGCAttribute to some SPCL functions.

Only insert GC_POLL in first morph call.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
stephentoub pushed a commit to stephentoub/corefx that referenced this pull request Oct 23, 2019
Apply SuppressGCAttribute to some SPCL functions.

Only insert GC_POLL in first morph call.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
jkotas pushed a commit to dotnet/corert that referenced this pull request Oct 23, 2019
Apply SuppressGCAttribute to some SPCL functions.

Only insert GC_POLL in first morph call.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
vargaz pushed a commit to mono/mono that referenced this pull request Oct 24, 2019
* Apply SuppressGCAttribute to some SPCL functions. (dotnet/coreclr#27369)

Apply SuppressGCAttribute to some SPCL functions.

Only insert GC_POLL in first morph call.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>

* Remove unused methods (dotnet/coreclr#27370)

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>

* Move Matrix3x2/4x4, Plan, and Quaternion to the shared CoreLib partition (#42021)

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>

* Remove Socket.InnerSafeCloseSocket (dotnet/corefx#41888)

* Remove Socket.InnerSafeCloseSocket

* Move IsInvalid checks in SetHandle function

* PR feedback

* Remove unnecessary 'SocketPal.'

* Remove SafeSocketHandle.SetHandle

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
stephentoub pushed a commit to Dotnet-GitSync-Bot/corefx that referenced this pull request Oct 24, 2019
Apply SuppressGCAttribute to some SPCL functions.

Only insert GC_POLL in first morph call.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
stephentoub pushed a commit to dotnet/corefx that referenced this pull request Oct 24, 2019
Apply SuppressGCAttribute to some SPCL functions.

Only insert GC_POLL in first morph call.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apply new GC suppression attribute

4 participants