#else
 
-#ifdef CONFIG_SMP
-static int root_task_group_empty(void)
-{
-       return 1;
-}
-#endif
-
 static inline void set_task_rq(struct task_struct *p, unsigned int cpu) { }
 static inline struct task_group *task_group(struct task_struct *p)
 {
 
  */
 static int select_task_rq_fair(struct task_struct *p, int sd_flag, int flags)
 {
-       struct sched_domain *tmp, *sd = NULL;
+       struct sched_domain *tmp, *shares = NULL, *sd = NULL;
        int cpu = smp_processor_id();
        int prev_cpu = task_cpu(p);
        int new_cpu = cpu;
                                break;
                }
 
-               switch (sd_flag) {
-               case SD_BALANCE_WAKE:
-                       if (!sched_feat(LB_WAKEUP_UPDATE))
-                               break;
-               case SD_BALANCE_FORK:
-               case SD_BALANCE_EXEC:
-                       if (root_task_group_empty())
-                               break;
-                       update_shares(tmp);
-               default:
-                       break;
-               }
-
                if (want_affine && (tmp->flags & SD_WAKE_AFFINE) &&
                    cpumask_test_cpu(prev_cpu, sched_domain_span(tmp))) {
 
+                       if (sched_feat(LB_SHARES_UPDATE)) {
+                               update_shares(tmp);
+                               shares = tmp;
+                       }
+
                        if (wake_affine(tmp, p, sync)) {
                                new_cpu = cpu;
                                goto out;
                sd = tmp;
        }
 
+       if (sd && sd != shares && sched_feat(LB_SHARES_UPDATE))
+               update_shares(sd);
+
        while (sd) {
                struct sched_group *group;
                int weight;
 
 SCHED_FEAT(HRTICK, 0)
 SCHED_FEAT(DOUBLE_TICK, 0)
 SCHED_FEAT(LB_BIAS, 1)
-SCHED_FEAT(LB_WAKEUP_UPDATE, 1)
+SCHED_FEAT(LB_SHARES_UPDATE, 1)
 SCHED_FEAT(ASYM_EFF_LOAD, 1)
 
 /*