]> err.no Git - linux-2.6/blobdiff - kernel/sched.c
ehea: fix interface to DLPAR tools
[linux-2.6] / kernel / sched.c
index d96030db8ff7b21e4cc592b7dafeef1af8a98cd4..96e9b82246d2b24ec17aec763d0943a2d05d5f86 100644 (file)
@@ -3043,6 +3043,7 @@ static inline void rebalance_domains(int cpu, enum cpu_idle_type idle)
        struct sched_domain *sd;
        /* Earliest time when we have to do rebalance again */
        unsigned long next_balance = jiffies + 60*HZ;
+       int update_next_balance = 0;
 
        for_each_domain(cpu, sd) {
                if (!(sd->flags & SD_LOAD_BALANCE))
@@ -3079,8 +3080,10 @@ static inline void rebalance_domains(int cpu, enum cpu_idle_type idle)
                if (sd->flags & SD_SERIALIZE)
                        spin_unlock(&balancing);
 out:
-               if (time_after(next_balance, sd->last_balance + interval))
+               if (time_after(next_balance, sd->last_balance + interval)) {
                        next_balance = sd->last_balance + interval;
+                       update_next_balance = 1;
+               }
 
                /*
                 * Stop the load balance at this level. There is another
@@ -3090,7 +3093,14 @@ out:
                if (!balance)
                        break;
        }
-       rq->next_balance = next_balance;
+
+       /*
+        * next_balance will be updated only when there is a need.
+        * When the cpu is attached to null domain for ex, it will not be
+        * updated.
+        */
+       if (likely(update_next_balance))
+               rq->next_balance = next_balance;
 }
 
 /*
@@ -4913,7 +4923,7 @@ static inline void sched_init_granularity(void)
        if (sysctl_sched_granularity > gran_limit)
                sysctl_sched_granularity = gran_limit;
 
-       sysctl_sched_runtime_limit = sysctl_sched_granularity * 4;
+       sysctl_sched_runtime_limit = sysctl_sched_granularity * 8;
        sysctl_sched_wakeup_granularity = sysctl_sched_granularity / 2;
 }