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

[wasm] Implement MONO_MEMORY_BARRIER in jiterpreter #107325

Merged
merged 6 commits into from
Sep 6, 2024

Conversation

kg
Copy link
Member

@kg kg commented Sep 3, 2024

This opcode is fairly high in the abort statistics for System.Runtime.Tests, so it's worth the trouble to wire it up

Fixes #100273

@jkotas
Copy link
Member

jkotas commented Sep 4, 2024

Should this be just a no-op in single threaded wasm?

@pavelsavara
Copy link
Member

Right now jiterp is disabled in MT, so we need to enable it in order to test this PR.
#100273

DEFINE_BOOL_READONLY(jiterpreter_traces_enabled, "jiterpreter-traces-enabled", FALSE, "JIT interpreter opcode traces into WASM")

@kg
Copy link
Member Author

kg commented Sep 4, 2024

I'll do a few runs with traces enabled for MT tomorrow.

@kg kg force-pushed the jiterp-memory-barrier branch from 26ad367 to 8de6f60 Compare September 6, 2024 03:00
Comment on lines 3982 to 3983
// The text format and other parts of the spec say atomic.fence has no operands,
// but the binary encoding requires a dummy zero byte for some reason
Copy link
Member

Choose a reason for hiding this comment

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

It's for the memory ordering. See this part of the shared everythign threads proposal. 0 means sequential consistency, 1 will mean acquire-release https://github.com/WebAssembly/shared-everything-threads/blob/main/proposals/shared-everything-threads/Overview.md#memory-orderings

Copy link
Member Author

Choose a reason for hiding this comment

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

And sync_synchronize is sequential consistency, right?

Copy link
Member

Choose a reason for hiding this comment

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

And sync_synchronize is sequential consistency, right?

It's a "full barrier" which presumably means seq cst. https://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html

@kg kg merged commit a349912 into dotnet:main Sep 6, 2024
79 of 81 checks passed
jtschuster pushed a commit to jtschuster/runtime that referenced this pull request Sep 17, 2024
…p traces (dotnet#107325)

* Implement MONO_MEMORY_BARRIER in jiterpreter
* Enable jiterp traces for MT wasm
sirntar pushed a commit to sirntar/runtime that referenced this pull request Sep 30, 2024
…p traces (dotnet#107325)

* Implement MONO_MEMORY_BARRIER in jiterpreter
* Enable jiterp traces for MT wasm
@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2024
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.

[browser][MT] enable jiterp
4 participants