kernel/sched: Reset time slice on swap in SMP
In uniprocessor mode, the kernel knows when a context switch "is coming" because of the cache optimization and can use that to do things like update time slice state. But on SMP the scheduler state may be updated on the other CPU at any time, so we don't know that a switch is going to happen until the last minute. Expose reset_time_slice() as a public function and call it when needed out of z_swap(). Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
d442927667
commit
cb3964f04f
3 changed files with 18 additions and 9 deletions
|
@ -57,6 +57,7 @@ struct k_thread *z_find_first_thread_to_unpend(_wait_q_t *wait_q,
|
|||
struct k_thread *from);
|
||||
void idle(void *a, void *b, void *c);
|
||||
void z_time_slice(int ticks);
|
||||
void z_reset_time_slice(void);
|
||||
void z_sched_abort(struct k_thread *thread);
|
||||
void z_sched_ipi(void);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue