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

smp_acquire__after_ctrl_dep missing #30

Open
db7 opened this issue Nov 23, 2021 · 3 comments
Open

smp_acquire__after_ctrl_dep missing #30

db7 opened this issue Nov 23, 2021 · 3 comments

Comments

@db7
Copy link

db7 commented Nov 23, 2021

I'm trying some LKMM-based code and miss some functions. Most of them I could implement myself, eg, atomic_try_cmpxchg_release, but I am not sure what to do with smp_acquire__after_ctrl_dep. To what should I map it? To __LKMM_FENCE(aa) as in after atomic?

@michaliskok
Copy link
Collaborator

Why not simply:

#define smp_acquire__after_ctrl_dep() smp_rmb()

as in barrier.h?

I do not see any other architecture-specific mappings; mapping it to __LKMM_FENCE(aa) will basically yield a full fence, which is much stronger than the (acquire) ordering this fence is supposed to provide.

BTW, the reason this is not modeled is that it is not part of the LKMM's .cat model. (Also, since LKMM is still labeled experimental, if you come across any weird behaviors please do let me know.)

@db7
Copy link
Author

db7 commented Nov 24, 2021

Why not simply:

#define smp_acquire__after_ctrl_dep() smp_rmb()

as in barrier.h?

Great! Thank you.

BTW, the reason this is not modeled is that it is not part of the LKMM's .cat model. (Also, since LKMM is still labeled experimental, if you come across any weird behaviors please do let me know.)

I was not aware of that. Thank you.

@db7 db7 closed this as completed Nov 24, 2021
@db7
Copy link
Author

db7 commented Jan 25, 2022

The missing smp_acquire__after_ctrl_dep() hit me now that I need smp_cond_load_acquire as implemented in barrier.h. Because smp_rmb() seem to have some issue as discussed in #35. I can come up with an example if you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants