I agree with Greg! If we can have stable operation of priority inheritance with semaphores then we can build mutex as a macro based wrapper (mostly as it is now).
One thing that I can think of is adding a "mutex" attribute to a semaphore and creating a separate task list for faster scheduling, but even that is up to discussion with the community. Best regards, Petro чт, 6 квіт. 2023 р. о 15:58 Gregory Nutt <spudan...@gmail.com> пише: > Oh my God! That sounds terrible! Does this change actually do > /anything /positive. > > Duplicating the internal implementation of Linux is /NOT /positive. It > is irrelevant. > > Adopting GNU/Linux interfaces as a functional specification made since. > But duplicating the ibnternal implementation of Linux is the dumbest > thing I have ever heard. > > Losing any real time performance is /catastrophic /for an RTOS. > > Significantly increasing code size is /catastrophic /for an embedded OS. > > This is a very bad change that should never come into the repository. > My recommendation is that you quietly close the PR without merge and be > done with it. > > The solution that we want is: > > * One that conforms to interface standards > * Results in the smallest footprint possible > * Gives the best real time behavior possible. > > Nothing else should be accepted. > > On 4/6/2023 5:27 AM, zyfeier wrote: > > Hi, All: > > > > The main purpose of this PR is to separate mutex and semaphore and to > improve the performance of mutex. > > Regarding the issues mentioned in the email , here is a summary: > > > > 1. The number of system calls will increase. > > > > After separating mutex and semaphore, futex support will be added in the > next step, which can reduce the number of system calls. > > > > 2. Code size will increase. > > > > The increase in code size is a drawback of this modification, but the > mutex performance has improved by 200 cycles. I think code size can be > considered as a potential optimization item in the future. > > > > 3. Removing semaphore priority inheritance will affect real-time > performance. > > > > Semaphore priority inheritance will be retained. After separating mutex > and semaphore, they will have their own priority inheritance handling. > Choose which one to enable according to your needs. > > > > > > Thanks. > > Yuan. > > >