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

disable interrupts for global mutex #488

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sberkun
Copy link
Collaborator

@sberkun sberkun commented Oct 7, 2024

Possible fix for #393

Untested; to make sure this is viable, would need to demonstrate that (1) deadlocks actually occur without this fix, (2) this solves the deadlocks, and (3) there are no forseeable adverse affects from this additional logic.

On most platforms, disabling/enabling interrupts is a no-op, so there should be no performance impact on these platforms.

The main problem with this approach is I don't think it works with enclaves; I remember considering whether interrupts should be disabled for other environments besides the global environment (but it's been a while since I originally wrote this and I've forgotten why I didn't).

Copy link
Contributor

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

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

This looks to me like an important change. Is there a reason this a draft PR? I’ve made one small suggestion, but otherwise, I think we should merge this.

return lf_mutex_unlock(&global_mutex);
int ret_code = lf_mutex_unlock(&global_mutex);
if (ret_code != 0) {
return ret_code;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return ret_code;
lf_enable_interrupts_nested();
return ret_code;

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

Successfully merging this pull request may close these issues.

2 participants