arch: xtensa: Optimize cache management for pinned threads

When building with CONFIG_SCHED_CPU_MASK_PIN_ONLY we can assume that a
thread will always be executed in a same CPU and consequently skip the
cache invalidation.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2022-05-02 14:39:07 -07:00 committed by Anas Nashif
parent 551038e748
commit f5a0d4cd26

View file

@ -84,6 +84,14 @@ static ALWAYS_INLINE void arch_cohere_stacks(struct k_thread *old_thread,
: "=r"(a0save));
}
/* The following option ensures that a living thread will never
* be executed in a different CPU so we can safely return without
* invalidate and/or flush threads cache.
*/
if (IS_ENABLED(CONFIG_SCHED_CPU_MASK_PIN_ONLY)) {
return;
}
/* The "live" area (the region between the switch handle,
* which is the stack pointer, and the top of the stack
* memory) of the inbound stack needs to be invalidated if we