patacongo commented on code in PR #11226:
URL: https://github.com/apache/nuttx/pull/11226#discussion_r1399880424
##########
sched/sched/sched_removereadytorun.c:
##########
@@ -194,22 +194,15 @@ bool nxsched_remove_readytorun(FAR struct tcb_s *rtcb,
bool merge)
* next tcb in the assigned task list (nxttcb) or a TCB in the
* g_readytorun list. We can only select a task from that list if
* the affinity mask includes the current CPU.
- *
- * If pre-emption is locked or another CPU is in a critical section,
- * then use the 'nxttcb' which will probably be the IDLE thread.
- * REVISIT: What if it is not the IDLE thread?
Review Comment:
With REGARD to the REVISIT: I don't believe that this is a problem in the
current design. A lot has changed and we need @masayuki2009 to verify this.
In the past, there could be multiple TCBs in the assigned task list. But it
looks like assigned (but not running) TCBs are now held in the ready-to-run
list.
If that is corrected, then the assigned task list can be in only one of two
states:
1. It contains only the running IDLE thread's TCB only, or
2. It contains the TCB of the running task AND the ready-to-run IDLE thread.
So removing the TCB of the running task should always leave only the IDLE
task. Assuming state 2!
It seems like there should be a check to assure that the IDLE thread's TCB
is never removed by nxsched_remove_readytorun(). The chuck must be there, but
I don't see it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]