mutex: move nxmutex to sched#8645
Conversation
8047165 to
3926ae5
Compare
|
I'm still not sure about this change. I know that some time in the past I drafter something similar, but after re-thinking I'm looking into a next direction: there is already one mutex layer available in user space and it is |
@pkarashchenko
|
cce5b1e to
1e7e1b8
Compare
8f24d1b to
5356830
Compare
1ff51b4 to
56616b5
Compare
|
@xiaoxiang781216 @pkarashchenko Any comments on this PR? Please help to review it again. |
|
I will take a look over the weekend. |
@pkarashchenko do you finish the review? |
Done. Sorry, I experienced many delays during my trip, so was not able to review on time |
pkarashchenko
left a comment
There was a problem hiding this comment.
In general I do not see any issues that stop this PR from merging except one.
I'm missing the overall roadmap for the mutex support. The nxmutex is not a cancellation point but if I recall correctly (@xiaoxiang781216 please correct me if I'm wrong) there is an intention to move pthread_mutex (and maybe pthead_rwlock) to use nxmutex interface. The pthread_mutex interface is not a cancellation point, so all seems to be fine, but pthread_rwlock is a cancellation point.
I really would like to re-inspect the affected area and have nxmutex discussion moving to the mailing list before we are not too far away. By the affected area I mean that printf for example is a cancellation point and many other places as well. I will spend some time this week to figure out if those functions rely on the sem/pthread_mutex interface in user mode and how this change will affect that.
@pkarashchenko About pthread rwlock, although pthread_mutex is not a cancellation point, but pthread_cond_wait is, so i think this should be no problem. But it's still necessary to re-inspect the affected area. |
1. Move nxmutex to sched and directly depends on the nxsem; 2. Mutex is not cancellation point, delete cancellation point check; Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
add nxmutex_clocklock, nxmutex_set_protocol and nxmutex_get_protocol interface Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
|
I'm planning to start mailing list discussion till the end of this week. |
Summary
Impact
Mutex
Testing
sabre-6quad:nsh ostest