sched: process scheduler before wd_timer handler

wd_timer handler will change current task, so need process
scheduler before wd timer handler, Ensure that the current
task is not updated before the RR process

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
This commit is contained in:
zhangyuan29 2024-09-12 21:29:39 +08:00 committed by Alin Jerpelea
parent 24c931c220
commit 38ddf7d59f
1 changed files with 7 additions and 10 deletions

View File

@ -347,26 +347,23 @@ static clock_t nxsched_timer_process(clock_t ticks, clock_t elapsed,
nxsched_process_cpuload_ticks(elapsed); nxsched_process_cpuload_ticks(elapsed);
#endif #endif
/* Process watchdogs */
tmp = wd_timer(ticks, noswitches);
if (tmp > 0)
{
rettime = tmp;
}
/* Check for operations specific to scheduling policy of the currently /* Check for operations specific to scheduling policy of the currently
* active task. * active task.
*/ */
tmp = nxsched_process_scheduler(ticks, elapsed, noswitches); tmp = nxsched_process_scheduler(ticks, elapsed, noswitches);
if (tmp > 0)
{
rettime = tmp;
}
#if CONFIG_RR_INTERVAL > 0 || defined(CONFIG_SCHED_SPORADIC) /* Process watchdogs */
tmp = wd_timer(ticks, noswitches);
if (tmp > 0 && (rettime == 0 || tmp < rettime)) if (tmp > 0 && (rettime == 0 || tmp < rettime))
{ {
rettime = tmp; rettime = tmp;
} }
#endif
return rettime; return rettime;
} }