-
Notifications
You must be signed in to change notification settings - Fork 1.5k
IDLE thread will not boost up when IDLE hold sem #5266
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
Conversation
Avoid priority rollover Signed-off-by: anjiahao <anjiahao@xiaomi.com>
|
@GUIDINGLI why were these removed? We had to do some refactoring to |
|
@GUIDINGLI as mentioned here, removing the check does not solve the issue. There is already a way to disable this check, through Kconfig. The fix (even if temporary) should aim in having this check working specifically when priority inheritance is enabled. My thought for a temporal fix would be something like this: |
@Ouss4 You can see 9a53601, that's why removed. @fjpanag Actually, there is another way to resolve the issue caused by idle hold sem. We can do: Thus, there is no way to switch out during mm_checkcurrption(), and the issue will not happen. |
|
The idle thread should always have lowest possible priority and that is by its definition, so I like a way that we do not boost for idle thread. |
Yes, that's this patch want to enforce. |
Signed-off-by: ligd <liguiding1@xiaomi.com>
|
@fjpanag could you try this patch whether fix your problem. |
|
Granted it is a diagnostic mode. This effectively defeats PI. Is it a good idea for idle to not immediately yield? I would suspect this changes the RT nature of the system in a not ideal. |
A better fix is boost the idle thread to the high priority, but this will make the idle thread not at the tail of the ready list, which may introduce more bad side effect. As you ready said, the check is just for debugging, the user who enable CONFIG_MM_DEBUG should expect the slow response. |
Sorry, too busy yesterday. However I think that this is a bad solution, because it has the potential for an ugly deadlock. Since the priority of the Idle Task cannot be boosted anymore, and since it holds the mm, if it doesn't get the chance to run again then we lost access to the mm. And this chance seems quite high, because the Idle task mostly holds this semaphore and because it is normal for real-time systems to never return to idle. This solution is better, since it cannot cause this issue. I believe that this is even better, because it has the disadvantages of the previous solution only if it is actually needed, not every time. It is still harmful though. At this moment I am of the strong belief that the Idle Task must do nothing at all. |
|
Just a note:
I don't agree with this, because:
This PR (and this feature in general) is not that it makes the system slower. |
|
If we want to do the health check in idle thread and still keep real time behavior as much as possible, boosting idle thread priority is the best option as far as I know. But, the risk of this change is very high since it change the fundamental assumption that idle thread priority is always zero.
Yes, I agree too. How about we remove the health check instead? |
Let's move it, not remove it. These are a bit busy days here at work. So unless someone wants to get into this issue, I will fix this, maybe by next week. I am thinking of moving all these checks to a worker thread. |
commit miss named upstream as: idle: remove heap & stack check in idle thread see PR apache/nuttx#5266 Added DEBUGASSERT to trap condition under test Signed-off-by: ligd <liguiding1@xiaomi.com>
commit miss named upstream as: idle: remove heap & stack check in idle thread see PR apache/nuttx#5266 Signed-off-by: ligd <liguiding1@xiaomi.com>
commit miss named upstream as: idle: remove heap & stack check in idle thread see PR apache/nuttx#5266 Signed-off-by: ligd <liguiding1@xiaomi.com>
commit miss named upstream as: idle: remove heap & stack check in idle thread see PR apache/nuttx#5266 Signed-off-by: ligd <liguiding1@xiaomi.com>
commit miss named upstream as: idle: remove heap & stack check in idle thread see PR apache/nuttx#5266 Signed-off-by: ligd <liguiding1@xiaomi.com>
commit miss named upstream as: idle: remove heap & stack check in idle thread see PR apache/nuttx#5266 Signed-off-by: ligd <liguiding1@xiaomi.com>
commit miss named upstream as: idle: remove heap & stack check in idle thread see PR apache/nuttx#5266 Signed-off-by: ligd <liguiding1@xiaomi.com>
Summary
IDLE thread will not boost up when IDLE hold sem
Impact
Testing
VELA