xen/sched: try harder to find a runnable unit in rt_schedule()

Instead of directly falling back to the idle unit in case the top
unit from the run queue happened to be not runnable, consult the run
queue again.

Suggested-by: Dario Faggioli <dfaggioli@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
This commit is contained in:
Juergen Gross authored and Jan Beulich committed 2022-12-02 10:29:19 +01:00
1 parent a2f5203141
commit 0f1dec89d3
1 file changed
+11 -6
+11 -6
View File
@@ -1101,15 +1101,20 @@ rt_schedule(const struct scheduler *ops, struct sched_unit *currunit,
}
else
{
snext = runq_pick(ops, cpumask_of(sched_cpu), cur_cpu);
if ( snext == NULL )
snext = rt_unit(sched_idle_unit(sched_cpu));
else if ( !unit_runnable_state(snext->unit) )
while ( true )
{
snext = runq_pick(ops, cpumask_of(sched_cpu), cur_cpu);
if ( snext == NULL )
{
snext = rt_unit(sched_idle_unit(sched_cpu));
break;
}
if ( unit_runnable_state(snext->unit) )
break;
q_remove(snext);
replq_remove(ops, snext);
snext = rt_unit(sched_idle_unit(sched_cpu));
}
/* if scurr has higher priority and budget, still pick scurr */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.