-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
sched/sem_rw: convert read-lock to write-lock when self already holds write-lock #13797
Conversation
[Experimental Bot, please feedback here] The PR summary partially meets the requirements, but is missing some key information: What's Missing in Summary:
Impact Section is Insufficient:
Testing Section is Inadequate:
In summary, while the PR addresses a specific issue, the provided description lacks the necessary detail and completeness expected in a NuttX PR. Expand the summary, thoroughly address all impact points, and provide specific details and logs for the testing section. |
@Donny9 please include the Summary content in the commit log message |
… a write-lock If the write lock is already held by oneself and sine the write lock can be recursively held, so, this operation can be converted to a write lock to avoid deadlock. Signed-off-by: dongjiuzhu1 <[email protected]>
inode_find don't need to modify inode tree Signed-off-by: dongjiuzhu1 <[email protected]>
Signed-off-by: dongjiuzhu1 <[email protected]>
Done~ |
Summary
The PR is releated to #13736 (comment), to fix issue about:
In some scenarios, inode_find and inode_remove are used in combination, such as in shm_open and shm_unlink. The remove operation requires a write lock. If we were to switch to a read lock in inode_find, then a lock would need to be added in inode_remove, and additional checks would be required elsewhere.
Impact
convert read-lock to write-lock when self already holds write-lock
Testing
Local test