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

Draft: Create _umtx_op shim for FreeBSD #3649

Closed
wants to merge 3 commits into from

Conversation

b-ncMN
Copy link
Contributor

@b-ncMN b-ncMN commented Jun 5, 2024

This PR lays the basic works for the _umtx_op shim for freebsd

I have implemented this by taking inspiration from the linux futex shim, so it may not be perfect and I am looking forward to criticism.

I will continue that on later commits because the tests do not currently pass

@b-ncMN b-ncMN marked this pull request as draft June 5, 2024 20:29
@RalfJung
Copy link
Member

RalfJung commented Jun 5, 2024

Just one quick nit because I saw the notification, the PR description and commit message could be a bit more descriptive. :) They should mention _umtx_op, and probably FreeBSD.

@b-ncMN b-ncMN changed the title Draft: Add basic shim mechanisms Draft: Create _umtx_op shim for FreeBSD Jun 5, 2024
similarly to Linux, the umtx_op_wait_uint_private, umtx_op_wake_private and umtx_op_nwake_private operations enable an optimization, preventing these from working across processes.
@b-ncMN
Copy link
Contributor Author

b-ncMN commented Jun 6, 2024

I think all of these commits will be merged into one before pulling this in main.
I tried to keep every commits as clean as possible. But it seems I am stuck on a clippy warning on HEAD, is it worth for me to fix it in order to keep the tree clean or is that not really a problem? Because further commit will override that faulty code and it will be all in one commit after.

@RalfJung
Copy link
Member

RalfJung commented Jun 7, 2024

When you mark this as ready for review, CI must be green. We won't land code that has clippy warnings.

For intermediate commits it doesn't matter.

@RalfJung RalfJung added the S-waiting-on-author Status: Waiting for the PR author to address review comments label Jun 9, 2024
let umtx_op_wait = this.eval_libc_i32("UMTX_OP_WAIT");

//FUTEX private operations are not supported by miri
match op & !umtx_op_wait_uint_private & !umtx_op_wake_private & !umtx_op_nwake_private {
Copy link
Contributor

Choose a reason for hiding this comment

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


//FUTEX private operations are not supported by miri
match op & !umtx_op_wait_uint_private & !umtx_op_wake_private & !umtx_op_nwake_private {
umtx_op_wait => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since umtx_op_wait is not a constant, I think this is the same as

match foo {
    bar => todo!(),
}

i.e. it matches anything.

@RalfJung
Copy link
Member

@b-ncMN what is your plan for this? If this is unlikely to be ready for at least some early feedback within the next 2 weeks, I'd prefer to close the PR so that we can keep the PR list for things that are actively being worked on. If you can out of time, you can always reopen the PR later. :)

@RalfJung
Copy link
Member

I'll close the PR due to inactivity, feel free to pick it up again any time. :)

@RalfJung RalfJung closed this Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: Waiting for the PR author to address review comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants