{
        unsigned long next_balance = jiffies + HZ;
        int this_cpu = this_rq->cpu;
+       int continue_balancing = 1;
        u64 t0, t1, curr_cost = 0;
        struct sched_domain *sd;
        int pulled_task = 0;
                return 0;
 
        /*
-        * We must set idle_stamp _before_ calling idle_balance(), such that we
-        * measure the duration of idle_balance() as idle time.
+        * We must set idle_stamp _before_ calling sched_balance_rq()
+        * for CPU_NEWLY_IDLE, such that we measure the this duration
+        * as idle time.
         */
        this_rq->idle_stamp = rq_clock(this_rq);
 
 
        rcu_read_lock();
        for_each_domain(this_cpu, sd) {
-               int continue_balancing = 1;
                u64 domain_cost;
 
                update_next_balance(sd, &next_balance);
                 * Stop searching for tasks to pull if there are
                 * now runnable tasks on this rq.
                 */
-               if (pulled_task || this_rq->nr_running > 0 ||
-                   this_rq->ttwu_pending)
+               if (pulled_task || !continue_balancing)
                        break;
        }
        rcu_read_unlock();