|
@@ -501,6 +501,18 @@ static void __update_cpu_load(struct rq *this_rq, unsigned long this_load,
|
|
|
sched_avg_update(this_rq);
|
|
|
}
|
|
|
|
|
|
+#ifdef CONFIG_SMP
|
|
|
+unsigned long get_rq_runnable_load(struct rq *rq)
|
|
|
+{
|
|
|
+ return rq->cfs.runnable_load_avg;
|
|
|
+}
|
|
|
+#else
|
|
|
+unsigned long get_rq_runnable_load(struct rq *rq)
|
|
|
+{
|
|
|
+ return rq->load.weight;
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
#ifdef CONFIG_NO_HZ_COMMON
|
|
|
/*
|
|
|
* There is no sane way to deal with nohz on smp when using jiffies because the
|
|
@@ -522,7 +534,7 @@ static void __update_cpu_load(struct rq *this_rq, unsigned long this_load,
|
|
|
void update_idle_cpu_load(struct rq *this_rq)
|
|
|
{
|
|
|
unsigned long curr_jiffies = ACCESS_ONCE(jiffies);
|
|
|
- unsigned long load = this_rq->load.weight;
|
|
|
+ unsigned long load = get_rq_runnable_load(this_rq);
|
|
|
unsigned long pending_updates;
|
|
|
|
|
|
/*
|
|
@@ -568,11 +580,12 @@ void update_cpu_load_nohz(void)
|
|
|
*/
|
|
|
void update_cpu_load_active(struct rq *this_rq)
|
|
|
{
|
|
|
+ unsigned long load = get_rq_runnable_load(this_rq);
|
|
|
/*
|
|
|
* See the mess around update_idle_cpu_load() / update_cpu_load_nohz().
|
|
|
*/
|
|
|
this_rq->last_load_update_tick = jiffies;
|
|
|
- __update_cpu_load(this_rq, this_rq->load.weight, 1);
|
|
|
+ __update_cpu_load(this_rq, load, 1);
|
|
|
|
|
|
calc_load_account_active(this_rq);
|
|
|
}
|