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/07/01 19:28:22 UTC

[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #4016: Add heap & stack check to idle thread

davids5 commented on a change in pull request #4016:
URL: https://github.com/apache/incubator-nuttx/pull/4016#discussion_r662540025



##########
File path: sched/init/nx_start.c
##########
@@ -789,17 +789,35 @@ void nx_start(void)
   sinfo("CPU0: Beginning Idle Loop\n");
   for (; ; )
     {
-      /* Check heap & stack in idle thread */
+#if defined(CONFIG_STACK_COLORATION) && CONFIG_STACK_USAGE_SAFE_PERCENT > 0
 
-      kmm_checkcorruption();
+      /* Check stack in idle thread */
 
-#if defined(CONFIG_STACK_COLORATION) && defined(CONFIG_DEBUG_MM)
-      for (i = 0; i < CONFIG_MAX_TASKS && g_pidhash[i].tcb; i++)
+      for (i = 0; i < CONFIG_MAX_TASKS; i++)
         {
-          assert(up_check_tcbstack_remain(g_pidhash[i].tcb) > 0);
+          FAR struct tcb_s *tcb;
+          irqstate_t flags;
+
+          flags = enter_critical_section();

Review comment:
       This seems like 1) it would not be power management friendly.  2) it is too draconian. This would be bad in production code.
   
   Margin is margin and if the interrupt stack is used it is a real margin.  If there is margin we do not want a hardfault.  The would be better as separate task that can report the margin, not fault. 




-- 
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