Skip to content

Conversation

@VSadov
Copy link
Member

@VSadov VSadov commented Nov 16, 2022

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
Copy link

ghost commented Nov 16, 2022

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
Copy link
Member Author

VSadov commented Nov 16, 2022

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks!

@VSadov
Copy link
Member Author

VSadov commented Nov 16, 2022

Thanks!

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

VSadov commented Nov 16, 2022

@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
Copy link
Member

BrzVlad commented Nov 17, 2022

@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