You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/09/28 23:16:47 UTC

[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #4619: sched: Fix CPU affinity issues in SMP

masayuki2009 commented on a change in pull request #4619:
URL: https://github.com/apache/incubator-nuttx/pull/4619#discussion_r718030443



##########
File path: sched/sched/sched_removereadytorun.c
##########
@@ -209,20 +209,16 @@ bool nxsched_remove_readytorun(FAR struct tcb_s *rtcb)
 
       if (rtrtcb != NULL && rtrtcb->sched_priority >= nxttcb->sched_priority)
         {
-          FAR struct tcb_s *tmptcb;
-
           /* The TCB at the head of the ready to run list has the higher
            * priority.  Remove that task from the head of the g_readytorun
            * list and add to the head of the g_assignedtasks[cpu] list.

Review comment:
       I think we need to modify these comments as well.
   Please change the comments and merge them into this commit.
   

##########
File path: sched/sched/sched_setpriority.c
##########
@@ -69,12 +68,12 @@ static FAR struct tcb_s *nxsched_nexttcb(FAR struct tcb_s *tcb)
    * then use the 'nxttcb' which will probably be the IDLE thread.
    */
 

Review comment:
       I think the above comments `if the affinity mask includes the current CPU` should be modified as well.
   

##########
File path: sched/sched/sched_setpriority.c
##########
@@ -69,12 +68,12 @@ static FAR struct tcb_s *nxsched_nexttcb(FAR struct tcb_s *tcb)
    * then use the 'nxttcb' which will probably be the IDLE thread.
    */
 
-  if (!nxsched_islocked_global() && !irq_cpu_locked(cpu))
+  if (!nxsched_islocked_global() && !irq_cpu_locked(this_cpu()))
     {
       /* Search for the highest priority task that can run on this CPU. */

Review comment:
       I think this comment should be modified as well.
   




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org