diff --git a/Kconfig b/Kconfig index 4a796726303bf..f5dcc67996b2a 100644 --- a/Kconfig +++ b/Kconfig @@ -1873,20 +1873,6 @@ config STACK_COLORATION Only supported by a few architectures. -config STACK_USAGE_SAFE_PERCENT - int "Stack usage safe percent" - default 0 - range 0 100 - depends on STACK_COLORATION - ---help--- - Stack usage percent = up_check_tcbstack() * 100 / tcb->adj_stack_size, - this should be lower than STACK_USAGE_SAFE_PERCENT. - - Idle thread will periodically check stack usage when this macro - value > 0. - - N.B. This feature should not be used in production code. - config STACK_CANARIES bool "Compiler stack canaries" depends on ARCH_HAVE_STACKCHECK diff --git a/mm/mm_heap/mm_sem.c b/mm/mm_heap/mm_sem.c index b7c64b7d4c227..a4d4e869c7c4f 100644 --- a/mm/mm_heap/mm_sem.c +++ b/mm/mm_heap/mm_sem.c @@ -80,13 +80,9 @@ bool mm_takesemaphore(FAR struct mm_heap_s *heap) if (up_interrupt_context()) { -#ifdef CONFIG_DEBUG_MM - return _SEM_TRYWAIT(&heap->mm_semaphore) >= 0; -#else /* Can't take semaphore in the interrupt handler */ return false; -#endif } else #endif diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c index a5ce3bbe0bb98..d7894640e9292 100644 --- a/sched/init/nx_start.c +++ b/sched/init/nx_start.c @@ -787,39 +787,6 @@ void nx_start(void) sinfo("CPU0: Beginning Idle Loop\n"); for (; ; ) { -#if defined(CONFIG_STACK_COLORATION) && CONFIG_STACK_USAGE_SAFE_PERCENT > 0 - - /* Check stack in idle thread */ - - for (i = 0; i < g_npidhash; i++) - { - FAR struct tcb_s *tcb; - irqstate_t flags; - - flags = enter_critical_section(); - - tcb = g_pidhash[i]; - if (tcb && (up_check_tcbstack(tcb) * 100 / tcb->adj_stack_size - > CONFIG_STACK_USAGE_SAFE_PERCENT)) - { -#if CONFIG_TASK_NAME_SIZE > 0 - _alert("Stack check failed, pid %d, name %s\n", - tcb->pid, tcb->name); -#else - _alert("Stack check failed, pid %d\n", tcb->pid); -#endif - PANIC(); - } - - leave_critical_section(flags); - } - -#endif - - /* Check heap in idle thread */ - - kmm_checkcorruption(); - /* Perform any processor-specific idle state operations */ up_idle(); diff --git a/sched/semaphore/sem_trywait.c b/sched/semaphore/sem_trywait.c index 506add37f0107..2da213907dc0c 100644 --- a/sched/semaphore/sem_trywait.c +++ b/sched/semaphore/sem_trywait.c @@ -69,11 +69,9 @@ int nxsem_trywait(FAR sem_t *sem) irqstate_t flags; int ret; -#ifndef CONFIG_DEBUG_MM /* This API should not be called from interrupt handlers */ DEBUGASSERT(sem != NULL && up_interrupt_context() == false); -#endif if (sem != NULL) {