zephyr/include
Andy Ross e06ba702d5 kernel/sched: Address thread abort termination delay issue on SMP
It's possible for a thread to abort itself simultaneously with an
external abort from another thread.  In fact in our test suite this is
a common thing, as ztest will abort its own spawend threads at the end
of a test, as they tend to be exiting on their own.

When that happens, the thread marks itself DEAD and does all its
scheduler bookeeping, but it is STILL RUNNING on its own stack until
it makes its way to its final swap.  The external context would see
that "dead" metadata and return from k_thread_abort(), allowing the
next test to reuse and spawn the same thread struct while the old
context was still running.  Obviously that's bad.

Unfortunately, this is impossible to address completely without
modifying every SMP architecture to add a API-visible hook to every
swap that signals completion.  In practice the best we can do is add a
delay.  But note the optimization: almost always, the scheduler IPI
catches the running thread and kills it from interrupt context
(i.e. on a different stack).  When that happens, we know that the
interrupted thread will never be resumed (because it's dead) and can
elide the delay.  We only pay the cost when we actually detect a race.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-01-21 14:47:52 -08:00
..
app_memory
arch x86: implement kernel page table isolation 2020-01-17 16:17:39 -05:00
audio
bluetooth Bluetooth: Mesh: Skip publish if update fails 2020-01-16 14:13:37 +02:00
canbus canbus: canopen: add LED indicator support 2020-01-20 17:17:23 +01:00
cmsis_rtos_v1
cmsis_rtos_v2
console
crypto crypto: api: New capability flag CAP_NO_IV_PREFIX 2020-01-16 18:34:20 +01:00
data
debug
dfu include: dfu: Add extern "C" in mcuboot.h 2020-01-15 12:18:59 -06:00
disk
display
drivers drivers: counter: add missing syscalls 2020-01-21 11:36:55 -05:00
dt-bindings
fs fs: remove NFFS subsystem 2020-01-21 15:32:47 +01:00
linker
logging
mgmt
net net: sockets: tls: Add missing symbols for a few options 2020-01-20 09:58:23 +02:00
posix
power
random
settings doc: cleanup after NFFS removal 2020-01-21 15:32:47 +01:00
shell
stats
storage
sys base: add error checking macros 2020-01-20 17:19:54 -05:00
toolchain
usb
zephyr
cache.h
device.h
devicetree.h dts: Rename generated_dts_board*.{h,conf} to devicetree*.{h,conf} 2020-01-17 17:57:59 +01:00
exc_handle.h
fatal.h
generated_dts_board.h dts: Add include/generated_dts_board.h for backwards compatibility 2020-01-17 17:57:59 +01:00
init.h
irq_nextlevel.h
irq_offload.h
irq.h
kernel_includes.h
kernel_structs.h kernel/sched: Address thread abort termination delay issue on SMP 2020-01-21 14:47:52 -08:00
kernel_version.h
kernel.h kernel: queue: runtime error handling 2020-01-20 17:19:54 -05:00
ptp_clock.h
sched_priq.h
shared_irq.h
spinlock.h
sw_isr_table.h
sys_clock.h
syscall_handler.h
syscall.h
timeout_q.h
toolchain.h
wait_q.h
zephyr.h