Well if this fails to terminate, then we have a major bug.
Perhaps we can add something like this:
{
int count = NR_CPUS * 2;
while (push_rt_tasks(this_rq) && count--)
;
BUG_ON(!count);
}
Since we should do it really at most CPU times, and I added a CPU * 2 just
to be safe that we don't have a unrealistic point of moving tasks onto
other CPUS and have them finish before we finish this loop.
But really, I don't think we need to worry too much about that while loop
going too long. It terminates when there's no more RT tasks to migrate
off to other CPUs that have lower priority tasks.
Hmm, the thing we need to be careful with here is that we need to change
the prio of the CPU, otherwise we can a task to a CPU even though a higher
one was already queued.
/me plays to fix that!
-- Steve
-