From aeaddd70b7250c1e9d43824f247d78fa4ecb6cbb Mon Sep 17 00:00:00 2001 From: Peter Mitsis Date: Thu, 7 Nov 2024 14:15:04 -0800 Subject: [PATCH] tests: Fix IRQ locking in sched benchmark Corrects an issue that was introduced when the interrupt locking/unlocking was added to the 'sched' benchmark by unlocking the interrupts before the context switch done by k_yield(), but after the call to z_unpend_first_thread(). Fixes PR #81050 Signed-off-by: Peter Mitsis --- tests/benchmarks/sched/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/benchmarks/sched/src/main.c b/tests/benchmarks/sched/src/main.c index 1a590af1eb3..a372ba3c1a8 100644 --- a/tests/benchmarks/sched/src/main.c +++ b/tests/benchmarks/sched/src/main.c @@ -112,6 +112,7 @@ int main(void) key = arch_irq_lock(); stamp(UNPENDING); z_unpend_first_thread(&waitq); + arch_irq_unlock(key); stamp(UNPENDED_READYING); z_ready_thread(th); stamp(READIED_YIELDING); @@ -124,7 +125,6 @@ int main(void) */ k_yield(); stamp(YIELDED); - arch_irq_unlock(key); uint32_t avg, whole = stamps[4] - stamps[0];