-
Notifications
You must be signed in to change notification settings - Fork 1.5k
arch/risc-v/mpfs: Remove big kernel lock from several drivers #16031
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
arch/risc-v/mpfs: Remove big kernel lock from several drivers #16031
Conversation
|
[Experimental Bot, please feedback here] The PR mostly meets the NuttX requirements but is missing some crucial information. Here's a breakdown: Strengths:
Weaknesses and Missing Information:
Recommendation: The PR needs revisions to address the missing information and improve the level of detail. Specifically, the author should:
By addressing these points, the PR will be much more complete and easier for reviewers to evaluate. |
|
@pussuw nice work! Is there some way to test and display how much it improved the NuttX performance? |
I cannot share logs but in our use case total CPU load drops by ~3-5% in SMP mode. This is of course very situational. The big kernel lock is very contested because semaphores use it so removing its use from modules that don't need it usually has a noticeable impact. |
7f917c7 to
2bc652c
Compare
If the remote end just closes an endpoint and no longer handles it, the system is prone to intensive cpu polling via mpfs_write_tx_fifo() especially if the device side doesn't know a thing about what the remote did. Fix this by marking the EP as dead, which will skip all writes causing unnecessary polling. The EP is back in business if the remote end sends some data (rx) or the connection is re-established. Signed-off-by: Eero Nurkkala <[email protected]> Signed-off-by: Ville Juven <[email protected]>
Remove call to enter_critical_section (big kernel lock) and replace it with a smaller lock. Signed-off-by: Ville Juven <[email protected]>
Remove call to enter_critical_section (big kernel lock) and replace it with a smaller lock. Signed-off-by: Ville Juven <[email protected]>
Remove call to enter_critical_section (big kernel lock) and replace it with a smaller lock. Signed-off-by: Ville Juven <[email protected]>
2bc652c to
3d3209f
Compare
Remove call to enter_critical_section (big kernel lock) and replace it with a smaller lock to protect the USB clock and its reference counter. Signed-off-by: Ville Juven <[email protected]>
3d3209f to
892fee9
Compare
Summary
This replaces the big kernel lock (enter/leave_critical_section()) with local spinlocks from all MPFS drivers that still use it. The reason is obviously to alleviate big kernel lock congestion which has a massive performance impact in SMP
Impact
Only the MPFS target is impacted.
App impact: No
Doc impact: No
Build system impact: No
Testing
Tested with private downstream MPFS target that uses all of the changed drivers.