Skip to content

[NativeAOT] Address some COOP native helpers that could cause suspension pauses. - #78450

Merged
VSadov merged 4 commits into
dotnet:mainfrom
VSadov:coopHelpers
Nov 16, 2022
Merged

[NativeAOT] Address some COOP native helpers that could cause suspension pauses.#78450
VSadov merged 4 commits into
dotnet:mainfrom
VSadov:coopHelpers

Conversation

@VSadov

@VSadov VSadov commented Nov 16, 2022

Copy link
Copy Markdown
Member

Fixes: #73655

Fixes common cases of unbounded data copying in COOP mode, that may cause suspension pauses.
(Such pauses were actually observed while testing and measuring suspension changes)

Also moves Buffer.Memmove<T> to shared code to be used by both CoreCLR and NativeAOT.

I think Mono may use it too and benefit form interruptibility, in theory, but I am not sure.
For blobs containing GC references, we perform GC-atomic card-updating copies in chunks which are not necessarily aligned to array elements. I am not sure if Mono BulkMoveWithWriteBarrier can be used like this.

@ghost

ghost commented Nov 16, 2022

Copy link
Copy Markdown

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes: #73655

Fixes common cases of unbounded data copying in COOP mode, that may cause suspension pauses.
(It was actually observed while testing and measuring suspension changes)

Also moves Buffer.Memmove<T> to shared code to be used by both CoreCLR and NativeAOT.

I think Mono may use it too and benefit form interruptibility, but I am not sure.
For blobs containing GC references, we perform GC-atomic card-updating copies in chunks aligned to GC words, but not to array elements. I am not sure if Mono BulkMoveWithWriteBarrier can be used like this.

Author: VSadov
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@VSadov

VSadov commented Nov 16, 2022

Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@VSadov

VSadov commented Nov 16, 2022

Copy link
Copy Markdown
Member Author

Thanks!

@VSadov
VSadov merged commit ab796de into dotnet:main Nov 16, 2022
@VSadov
VSadov deleted the coopHelpers branch November 16, 2022 18:48
@VSadov

VSadov commented Nov 16, 2022

Copy link
Copy Markdown
Member Author

@BrzVlad Re: BulkMoveWithWriteBarrier . Just wonder - can Mono change BulkMoveWithWriteBarrier to the same shape as in CoreCLR and NativeAOT?
If that is possible, Mono could also benefit from the shared implementation of Buffer.Memmove<T>

@BrzVlad

BrzVlad commented Nov 17, 2022

Copy link
Copy Markdown
Member

@VSadov Yeah, it is fairly straightforward. I opened issue #78498 so I remember to do it sometime in the future.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[NativeAOT] Review COOP helpers that may cause long GC suspension pauses.

3 participants