-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Optimize mutex atomic fast path #16030
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
Optimize mutex atomic fast path #16030
Conversation
|
[Experimental Bot, please feedback here] Yes, this PR appears to meet the NuttX requirements, although some minor improvements could be made. Strengths:
Areas for Improvement:
Recommendation: Add the missing build host details, clarify the |
0362941 to
7f733ba
Compare
|
There seems to be some issue with sim:citest target, and of course I can't even build the citest locally ( The same issue as in #12974 ). Need to get the docker build environment and try to resolve that ... |
7f733ba to
2ba7c1b
Compare
|
Changed the way how atomic.h is included, now it should compile. Re-tested on mpfs. |
2ba7c1b to
50b2e31
Compare
ac60716 to
bc30151
Compare
|
Re-tested on mpfs and qemu targets |
bc30151 to
5908cdc
Compare
|
Rebased against current master and cleaned up one comment. |
|
@nuttxpr test avaota-a1:nsh |
|
[Experimental Bot, please feedback here] Build and Test Successful (avaota-a1:nsh) |
|
@nuttxpr test milkv_duos:nsh |
|
[Experimental Bot, please feedback here] Build and Test Successful (milkv_duos:nsh) |
|
[Experimental Bot, please feedback here] Build and Test Successful (milkv_duos:nsh) |
lupyuen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retested OK with OSTest on Real Hardware. Thanks :-)
…TECT or CONFIG_PRIORITY_INHERITANCE When the semaphore priority flags is set to NONE, and the semaphore is a mutex, the fast locking path can be used, even when priority inheritance or priority protect are enabled globally. Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
3854169 to
427d51e
Compare
|
Modified the PR acc. to the review comments, re-tested on rv-virt:nsh64 (ostest) and on multiple real hw & build configurations (MPFS, CONFIG_BUILD_KERNEL and CONFIG_BUILD_FLAT, SMP and non SMP). |
This avoids unnecessary syscalls in memory protected builds, when mutex lock/unlock can be done with only atomic counter access Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
427d51e to
2c8f0cf
Compare
|
And had to modify still a bit to pass CI with debug assertions.... |
|
Update: Seems OK now :-) |
|
@nuttxpr test avaota-a1:nsh |
Ok, what happened? I re-checked the PR, and did some extra tests on i.MX93 (arm64) CONFIG_BUILD_KERNEL, but didn't find anything... |
|
[Experimental Bot, please feedback here] Build and Test Successful (avaota-a1:nsh) |
|
@nuttxpr test milkv_duos:nsh |
|
[Experimental Bot, please feedback here] Build and Test Successful (milkv_duos:nsh) |
lupyuen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retested OK with OSTest on Real Hardware. Thanks :-)
|
Sorry, clicked "close by accident" :) |
|
I will still do the following chages based on comments from @pussuw :
|
Summary
This further optimizes mutexes:
Impact
Has no functional impact, but increases performance especially for:
Testing
log.txt