Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
Tests for spinlock. More...
Functions | |
ZTEST (spinlock, test_spinlock_basic) | |
Test basic spinlock. | |
ZTEST (spinlock, test_spinlock_bounce) | |
Test spinlock with bounce. | |
ZTEST (spinlock, test_spinlock_mutual_exclusion) | |
Test basic mutual exclusion using interrupt masking. | |
ZTEST (spinlock, test_trylock) | |
Test k_spin_trylock() | |
ZTEST (spinlock, test_spinlock_no_recursive) | |
Test spinlock cannot be recursive. | |
ZTEST (spinlock, test_spinlock_unlock_error) | |
Test unlocking incorrect spinlock. | |
ZTEST (spinlock, test_spinlock_release_error) | |
Test unlocking incorrect spinlock. | |
ZTEST (spinlock, test_spinlock_lock_time_limit) | |
Test unlocking spinlock held over the time limit. | |
ZTEST (spinlock, test_spinlock_fairness) | |
Test spinlock acquisition fairness. | |
Tests for spinlock.
ZTEST | ( | spinlock | , |
test_spinlock_basic | |||
) |
#include <tests/kernel/spinlock/src/main.c>
Test basic spinlock.
ZTEST | ( | spinlock | , |
test_spinlock_bounce | |||
) |
ZTEST | ( | spinlock | , |
test_spinlock_fairness | |||
) |
#include <tests/kernel/spinlock/src/spinlock_fairness.c>
Test spinlock acquisition fairness.
This test verifies a spinlock acquisition fairness in relation to the cores contending for the spinlock. Memory access latency may vary between the CPU cores, so that some CPUs reach the spinlock faster than the others and depending on spinlock implementation may get higher chance to win the contention for the spinlock than the other cores, making them to starve. This effect may become critical for some real-life platforms (e.g. NUMA) resulting in performance loss or even a live-lock, when a single CPU is continuously winning the contention. This test ensures that the probability to win the contention for a spinlock is evenly distributed between all of the contending cores.
ZTEST | ( | spinlock | , |
test_spinlock_lock_time_limit | |||
) |
#include <tests/kernel/spinlock/src/spinlock_error_case.c>
Test unlocking spinlock held over the time limit.
Validate unlocking spinlock held past the time limit will trigger assertion.
ZTEST | ( | spinlock | , |
test_spinlock_mutual_exclusion | |||
) |
#include <tests/kernel/spinlock/src/main.c>
Test basic mutual exclusion using interrupt masking.
ZTEST | ( | spinlock | , |
test_spinlock_no_recursive | |||
) |
#include <tests/kernel/spinlock/src/spinlock_error_case.c>
Test spinlock cannot be recursive.
Validate using spinlock recursive will trigger assertion.
ZTEST | ( | spinlock | , |
test_spinlock_release_error | |||
) |
#include <tests/kernel/spinlock/src/spinlock_error_case.c>
Test unlocking incorrect spinlock.
Validate unlocking incorrect spinlock will trigger assertion.
ZTEST | ( | spinlock | , |
test_spinlock_unlock_error | |||
) |
#include <tests/kernel/spinlock/src/spinlock_error_case.c>
Test unlocking incorrect spinlock.
Validate unlocking incorrect spinlock will trigger assertion.
ZTEST | ( | spinlock | , |
test_trylock | |||
) |