On Fri, 2016-04-01 at 15:42 -0400, Chris Metcalf wrote:
On arm64, when calling enqueue_task_fair() from migration_cpu_stop(),I don't get it.
we find the nr_running value updated by add_nr_running(), but the
cfs.nr_running value has not always yet been updated. Accordingly,
the sched_can_stop_tick() false returns true when we are migrating a
second task onto a core.
Looking at the enqueue_task_fair(), I see this:
for_each_sched_entity(se) {
cfs_rq = cfs_rq_of(se);
cfs_rq->h_nr_running++;
...
}
if (!se)
add_nr_running(rq, 1);
What is the difference between cfs_rq->h_nr_running,
and rq->cfs.nr_running?
Why do we have two?
Are we simply testing against the wrong one in
sched_can_stop_tick?
Correct this by using rq->nr_running instead of rq->cfs.nr_running.That would cause us to run the timer tick while running
This should always be more conservative, and reverts the test to the
form it had before commit 76d92ac305f2 ("sched: Migrate sched to use
new tick dependency mask model").
a single SCHED_RR real time task, with a single
SCHED_OTHER task sitting in the background (which will
not get run until the SCHED_RR task is done).