idle: fix tasks waiting when NANO_TIMEOUTS is enabled
Fix an issue where, if a task is pending on a nano timeout, the duration it wants to wait is not taken into account by the tickless idle code. This could cause a system to wait forever, or to the limit of the timer hardware (which is forever, for all intents and purposes). This fix is to add one field in the nanokernel data structure for one task to record the amount of ticks it will wait on a nano timeout. Only one task has to be able to record this information, since, these waits being looping busy waits, the task of highest priority is the only task that can be actively waiting with a nano timeout. If a task of lower priority was previously waiting, and a new task is now waiting, it means that the wait of the original task has been interrupted, which will cause said task to run the busy loop on the object again when it gets scheduled, and the number of ticks it wants to wait has to be recomputed and recorded again. Change-Id: Ibcf0f288fc42d96897642cfee00ab7359716703f Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
parent
42a97c8b1d
commit
2858cbf829
11 changed files with 26 additions and 5 deletions
|
@ -84,7 +84,10 @@ char __noinit _interrupt_stack[CONFIG_ISR_STACK_SIZE];
|
|||
|
||||
#ifdef CONFIG_NANO_TIMEOUTS
|
||||
#include <misc/dlist.h>
|
||||
#define initialize_nano_timeouts() sys_dlist_init(&_nanokernel.timeout_q)
|
||||
#define initialize_nano_timeouts() do { \
|
||||
sys_dlist_init(&_nanokernel.timeout_q); \
|
||||
_nanokernel.task_timeout = TICKS_UNLIMITED; \
|
||||
} while ((0))
|
||||
#else
|
||||
#define initialize_nano_timeouts() do { } while ((0))
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue