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

Two fixes for sys_rwlock #5907

Merged
merged 4 commits into from May 7, 2019
Merged

Two fixes for sys_rwlock #5907

merged 4 commits into from May 7, 2019

Conversation

elad335
Copy link
Contributor

@elad335 elad335 commented May 2, 2019

Both regarding readers blocked because theres a writer on the sleep queue.

First fix: fix signaling bit when ownership passed to a writer, yet there are still readers waiting on the sleep queue.

Second fix: Do not signal readers while the lock is still acquired by a writer when the last writer on the sleep queue quits.

readers can wait on the sleep queue if a writer lock has been blocked before it, in this case after runlock: writer should acquire the lock but the r's sleep queue is still not empty!
If the rwlock is currently acquired by a writer signaling readers is wrong and will lead to EPERM for wunlock!
Only signal blocked readers if the rwlock is currently acquired by readers
@kd-11
Copy link
Contributor

kd-11 commented May 5, 2019

Looks like you added another fix, doesn't that make it three fixes now?

@kd-11 kd-11 merged commit 13d8e33 into RPCS3:master May 7, 2019
@elad335 elad335 deleted the rwlock branch May 7, 2019 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants