From 3521e6ba27b2b4270ef9b446df99323680e9b8d3 Mon Sep 17 00:00:00 2001 From: ligd Date: Thu, 28 Dec 2023 13:59:35 +0800 Subject: [PATCH] cpuload: remove ciritical_section() to fix recursive Recursive: 25 0x44000e5a in up_cpu_paused (cpu=cpu@entry=1) at armv7-a/arm_cpupause.c:120 26 0x440032f2 in enter_critical_section () at irq/irq_csection.c:275 27 0x44006f24 in nxsched_process_taskload_ticks (tcb=tcb@entry=0x442ba638 , ticks=0) at sched/sched_cpuload.c:104 28 0x44007310 in nxsched_suspend_critmon (tcb=tcb@entry=0x442ba638 ) at sched/sched_critmonitor.c:303 29 0x44006ef0 in nxsched_suspend_scheduler (tcb=tcb@entry=0x442ba638 ) at sched/sched_suspendscheduler.c:78 30 0x44000e5a in up_cpu_paused (cpu=cpu@entry=1) at armv7-a/arm_cpupause.c:120 31 0x440032f2 in enter_critical_section () at irq/irq_csection.c:275 32 0x44000f1a in arm_pause_handler (irq=, context=, arg=) at armv7-a/arm_cpupause.c:216 33 0x44002ffe in irq_dispatch (irq=irq@entry=2, context=context@entry=0x4449f6b8 ) at irq/irq_dispatch.c:146 34 0x44001612 in arm_doirq (irq=2, irq@entry=0, regs=0x4449f6b8 ) at armv7-a/arm_doirq.c:72 35 0x44000940 in arm_decodeirq (regs=) at armv7-a/arm_gicv2.c:403 36 0x440000b4 in arm_vectorirq () at armv7-a/arm_vectors.S:236 Signed-off-by: ligd --- sched/sched/sched_cpuload.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sched/sched/sched_cpuload.c b/sched/sched/sched_cpuload.c index 59cd5d88c23..a72b0bbf2ff 100644 --- a/sched/sched/sched_cpuload.c +++ b/sched/sched/sched_cpuload.c @@ -99,10 +99,6 @@ volatile uint32_t g_cpuload_total; void nxsched_process_taskload_ticks(FAR struct tcb_s *tcb, uint32_t ticks) { - irqstate_t flags; - - flags = enter_critical_section(); - tcb->ticks += ticks; g_cpuload_total += ticks; @@ -128,8 +124,6 @@ void nxsched_process_taskload_ticks(FAR struct tcb_s *tcb, uint32_t ticks) g_cpuload_total = total; } - - leave_critical_section(flags); } /****************************************************************************