No, it's better indeed to delay push_rt_tasks() until
post_rt_schedule() when 'current' (that's a task to be preempted) is
also available for potential migration.
Not considering "current" (as it's running) in task_wake_up_rt() is
a key of the problem which I illustrated in my first message.
I mean, we set rq->rt.pushed = 1 and that kind of means "nothing to be
push off here any more" but "current" was out of our consideration.
humm... a quick idea (should think more on it):
(1) select_task_rq_rt() + task_wake_up_rt() should consider only 'p'
(a newly woken up task) for pushing off a cpu;
i.e. task_wake_up_rt() calls push_rt_task(..., p) and _never_ sets up
rq->rt.pushed;
the main point where 'pushed' is done :
(2) post_schedule_rt()
here we call push_rt_tasks() and set up rq->rt.pushed to 1.
heh, I can be missing something important... need to verify different
scenarios wrt this algo.
Agreed. And as I noticed above, ex-current is also available for
migration policies at this point + the most eligible task has just got
control (and it's the only task that shouldn't be considered for
migration).
--
Best regards,
Dmitry Adamushko
--