sched/topology: Remove unused 'sd' parameter from arch_scale_cpu_capacity()
[linux-2.6-block.git] / kernel / sched / fair.c
index 7f8d477f90fec636bc16d1927b01ef731ffbf847..4f8754157763c1ae491ece1a6488c97928eca258 100644 (file)
@@ -764,7 +764,7 @@ void post_init_entity_util_avg(struct task_struct *p)
        struct sched_entity *se = &p->se;
        struct cfs_rq *cfs_rq = cfs_rq_of(se);
        struct sched_avg *sa = &se->avg;
-       long cpu_scale = arch_scale_cpu_capacity(NULL, cpu_of(rq_of(cfs_rq)));
+       long cpu_scale = arch_scale_cpu_capacity(cpu_of(rq_of(cfs_rq)));
        long cap = (long)(cpu_scale - cfs_rq->avg.util_avg) / 2;
 
        if (cap > 0) {
@@ -4729,6 +4729,11 @@ static void start_cfs_slack_bandwidth(struct cfs_bandwidth *cfs_b)
        if (runtime_refresh_within(cfs_b, min_left))
                return;
 
+       /* don't push forwards an existing deferred unthrottle */
+       if (cfs_b->slack_started)
+               return;
+       cfs_b->slack_started = true;
+
        hrtimer_start(&cfs_b->slack_timer,
                        ns_to_ktime(cfs_bandwidth_slack_period),
                        HRTIMER_MODE_REL);
@@ -4782,6 +4787,7 @@ static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b)
 
        /* confirm we're still not at a refresh boundary */
        raw_spin_lock_irqsave(&cfs_b->lock, flags);
+       cfs_b->slack_started = false;
        if (cfs_b->distribute_running) {
                raw_spin_unlock_irqrestore(&cfs_b->lock, flags);
                return;
@@ -4945,6 +4951,7 @@ void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b)
        hrtimer_init(&cfs_b->slack_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
        cfs_b->slack_timer.function = sched_cfs_slack_timer;
        cfs_b->distribute_running = 0;
+       cfs_b->slack_started = false;
 }
 
 static void init_cfs_rq_runtime(struct cfs_rq *cfs_rq)
@@ -7393,6 +7400,7 @@ static void attach_tasks(struct lb_env *env)
        rq_unlock(env->dst_rq, &rf);
 }
 
+#ifdef CONFIG_NO_HZ_COMMON
 static inline bool cfs_rq_has_blocked(struct cfs_rq *cfs_rq)
 {
        if (cfs_rq->avg.load_avg)
@@ -7420,6 +7428,19 @@ static inline bool others_have_blocked(struct rq *rq)
        return false;
 }
 
+static inline void update_blocked_load_status(struct rq *rq, bool has_blocked)
+{
+       rq->last_blocked_load_update_tick = jiffies;
+
+       if (!has_blocked)
+               rq->has_blocked_load = 0;
+}
+#else
+static inline bool cfs_rq_has_blocked(struct cfs_rq *cfs_rq) { return false; }
+static inline bool others_have_blocked(struct rq *rq) { return false; }
+static inline void update_blocked_load_status(struct rq *rq, bool has_blocked) {}
+#endif
+
 #ifdef CONFIG_FAIR_GROUP_SCHED
 
 static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq)
@@ -7485,11 +7506,7 @@ static void update_blocked_averages(int cpu)
        if (others_have_blocked(rq))
                done = false;
 
-#ifdef CONFIG_NO_HZ_COMMON
-       rq->last_blocked_load_update_tick = jiffies;
-       if (done)
-               rq->has_blocked_load = 0;
-#endif
+       update_blocked_load_status(rq, !done);
        rq_unlock_irqrestore(rq, &rf);
 }
 
@@ -7555,11 +7572,7 @@ static inline void update_blocked_averages(int cpu)
        update_rt_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &rt_sched_class);
        update_dl_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &dl_sched_class);
        update_irq_load_avg(rq, 0);
-#ifdef CONFIG_NO_HZ_COMMON
-       rq->last_blocked_load_update_tick = jiffies;
-       if (!cfs_rq_has_blocked(cfs_rq) && !others_have_blocked(rq))
-               rq->has_blocked_load = 0;
-#endif
+       update_blocked_load_status(rq, cfs_rq_has_blocked(cfs_rq) || others_have_blocked(rq));
        rq_unlock_irqrestore(rq, &rf);
 }
 
@@ -7633,7 +7646,7 @@ static inline void init_sd_lb_stats(struct sd_lb_stats *sds)
 static unsigned long scale_rt_capacity(struct sched_domain *sd, int cpu)
 {
        struct rq *rq = cpu_rq(cpu);
-       unsigned long max = arch_scale_cpu_capacity(sd, cpu);
+       unsigned long max = arch_scale_cpu_capacity(cpu);
        unsigned long used, free;
        unsigned long irq;
 
@@ -7658,7 +7671,7 @@ static void update_cpu_capacity(struct sched_domain *sd, int cpu)
        unsigned long capacity = scale_rt_capacity(sd, cpu);
        struct sched_group *sdg = sd->groups;
 
-       cpu_rq(cpu)->cpu_capacity_orig = arch_scale_cpu_capacity(sd, cpu);
+       cpu_rq(cpu)->cpu_capacity_orig = arch_scale_cpu_capacity(cpu);
 
        if (!capacity)
                capacity = 1;