zephyr/kernel/include
Andy Ross eace1df539 kernel/sched: Fix SMP scheduling
Recent changes post-scheduler-rewrite broke scheduling on SMP:

The "preempt_ok" feature added to isolate preemption points wasn't
honored in SMP mode.  Fix this by adding a "swap_ok" field to the CPU
record (not the thread) which is set at the same time out of
update_cache().

The "queued" flag wasn't being maintained correctly when swapping away
from _current (it was added back to the queue, but the flag wasn't
set).

Abstract out a "should_preempt()" predicate so SMP and uniprocessor
paths share the same logic, which is distressingly subtle.

There were two places where _Swap() was predicated on
_get_next_ready_thread() != _current.  That's no longer a benign
optimization in SMP, where the former function REMOVES the next thread
from the queue.  Just call _Swap() directly in SMP, which has a
unified C implementation that does this test already.  Don't change
other architectures in case it exposes bugs with _Swap() switching
back to the same thread (it should work, I just don't want to break
anything).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-05-31 14:02:03 -04:00
..
gen_offset.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
kernel_internal.h kernel: handle early entropy issues 2018-05-23 19:38:06 -07:00
kernel_offsets.h kernel: SMP-aware scheduler 2018-02-16 10:44:29 -05:00
kernel_structs.h kernel/sched: Fix SMP scheduling 2018-05-31 14:02:03 -04:00
ksched.h kernel: Earliest-deadline-first scheduling policy 2018-05-23 14:25:52 -04:00
kswap.h kernel/sched: Fix SMP scheduling 2018-05-31 14:02:03 -04:00
offsets_short.h kernel/arch: streamline thread user options 2017-01-24 13:34:50 +00:00
syscall_handler.h syscalls: remove policy from handler checks 2018-05-17 23:34:03 +03:00
timeout_q.h kernel: Clean up _unpend_thread() API 2018-04-24 03:57:20 +05:30
wait_q.h kernel: Fix trivial typo in CONFIG_WAIT_Q_FAST 2018-05-23 17:57:06 -04:00