Skip to content
Commit 6543e069 authored by James Harris's avatar James Harris Committed by Anas Nashif
Browse files

kernel: sched: avoid unnecessary lock in z_impl_k_yield



`z_impl_k_yield` unlocked sched_spinlock, only to lock it again
immediately, do a little bit more work, then unlock it again.
This causes performance issues on SMP, where `sched_spinlock`
is often fairly highly contended and cores often end up spinning
for quite a while waiting to retake the lock in `z_swap_unlocked`.

Instead directly pass the spinlock key to `z_swap` and avoid the
extra lock+unlock.

Signed-off-by: default avatarJames Harris <james.harris@intel.com>
parent 702f89d8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment