Commit fe749158 authored by Xianting Tian's avatar Xianting Tian Committed by Peter Zijlstra

sched/fair: Remove the force parameter of update_tg_load_avg()

In the file fair.c, sometims update_tg_load_avg(cfs_rq, 0) is used,
sometimes update_tg_load_avg(cfs_rq, false) is used.
update_tg_load_avg() has the parameter force, but in current code,
it never set 1 or true to it, so remove the force parameter.
Signed-off-by: default avatarXianting Tian <tian.xianting@h3c.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200924014755.36253-1-tian.xianting@h3c.com
parent df3cb4ea
...@@ -831,7 +831,7 @@ void init_entity_runnable_average(struct sched_entity *se) ...@@ -831,7 +831,7 @@ void init_entity_runnable_average(struct sched_entity *se)
void post_init_entity_util_avg(struct task_struct *p) void post_init_entity_util_avg(struct task_struct *p)
{ {
} }
static void update_tg_load_avg(struct cfs_rq *cfs_rq, int force) static void update_tg_load_avg(struct cfs_rq *cfs_rq)
{ {
} }
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
...@@ -3293,7 +3293,6 @@ static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq, int flags) ...@@ -3293,7 +3293,6 @@ static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq, int flags)
/** /**
* update_tg_load_avg - update the tg's load avg * update_tg_load_avg - update the tg's load avg
* @cfs_rq: the cfs_rq whose avg changed * @cfs_rq: the cfs_rq whose avg changed
* @force: update regardless of how small the difference
* *
* This function 'ensures': tg->load_avg := \Sum tg->cfs_rq[]->avg.load. * This function 'ensures': tg->load_avg := \Sum tg->cfs_rq[]->avg.load.
* However, because tg->load_avg is a global value there are performance * However, because tg->load_avg is a global value there are performance
...@@ -3305,7 +3304,7 @@ static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq, int flags) ...@@ -3305,7 +3304,7 @@ static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq, int flags)
* *
* Updating tg's load_avg is necessary before update_cfs_share(). * Updating tg's load_avg is necessary before update_cfs_share().
*/ */
static inline void update_tg_load_avg(struct cfs_rq *cfs_rq, int force) static inline void update_tg_load_avg(struct cfs_rq *cfs_rq)
{ {
long delta = cfs_rq->avg.load_avg - cfs_rq->tg_load_avg_contrib; long delta = cfs_rq->avg.load_avg - cfs_rq->tg_load_avg_contrib;
...@@ -3315,7 +3314,7 @@ static inline void update_tg_load_avg(struct cfs_rq *cfs_rq, int force) ...@@ -3315,7 +3314,7 @@ static inline void update_tg_load_avg(struct cfs_rq *cfs_rq, int force)
if (cfs_rq->tg == &root_task_group) if (cfs_rq->tg == &root_task_group)
return; return;
if (force || abs(delta) > cfs_rq->tg_load_avg_contrib / 64) { if (abs(delta) > cfs_rq->tg_load_avg_contrib / 64) {
atomic_long_add(delta, &cfs_rq->tg->load_avg); atomic_long_add(delta, &cfs_rq->tg->load_avg);
cfs_rq->tg_load_avg_contrib = cfs_rq->avg.load_avg; cfs_rq->tg_load_avg_contrib = cfs_rq->avg.load_avg;
} }
...@@ -3617,7 +3616,7 @@ static inline bool skip_blocked_update(struct sched_entity *se) ...@@ -3617,7 +3616,7 @@ static inline bool skip_blocked_update(struct sched_entity *se)
#else /* CONFIG_FAIR_GROUP_SCHED */ #else /* CONFIG_FAIR_GROUP_SCHED */
static inline void update_tg_load_avg(struct cfs_rq *cfs_rq, int force) {} static inline void update_tg_load_avg(struct cfs_rq *cfs_rq) {}
static inline int propagate_entity_load_avg(struct sched_entity *se) static inline int propagate_entity_load_avg(struct sched_entity *se)
{ {
...@@ -3805,13 +3804,13 @@ static inline void update_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *s ...@@ -3805,13 +3804,13 @@ static inline void update_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *s
* IOW we're enqueueing a task on a new CPU. * IOW we're enqueueing a task on a new CPU.
*/ */
attach_entity_load_avg(cfs_rq, se); attach_entity_load_avg(cfs_rq, se);
update_tg_load_avg(cfs_rq, 0); update_tg_load_avg(cfs_rq);
} else if (decayed) { } else if (decayed) {
cfs_rq_util_change(cfs_rq, 0); cfs_rq_util_change(cfs_rq, 0);
if (flags & UPDATE_TG) if (flags & UPDATE_TG)
update_tg_load_avg(cfs_rq, 0); update_tg_load_avg(cfs_rq);
} }
} }
...@@ -7898,7 +7897,7 @@ static bool __update_blocked_fair(struct rq *rq, bool *done) ...@@ -7898,7 +7897,7 @@ static bool __update_blocked_fair(struct rq *rq, bool *done)
struct sched_entity *se; struct sched_entity *se;
if (update_cfs_rq_load_avg(cfs_rq_clock_pelt(cfs_rq), cfs_rq)) { if (update_cfs_rq_load_avg(cfs_rq_clock_pelt(cfs_rq), cfs_rq)) {
update_tg_load_avg(cfs_rq, 0); update_tg_load_avg(cfs_rq);
if (cfs_rq == &rq->cfs) if (cfs_rq == &rq->cfs)
decayed = true; decayed = true;
...@@ -10797,7 +10796,7 @@ static void detach_entity_cfs_rq(struct sched_entity *se) ...@@ -10797,7 +10796,7 @@ static void detach_entity_cfs_rq(struct sched_entity *se)
/* Catch up with the cfs_rq and remove our load when we leave */ /* Catch up with the cfs_rq and remove our load when we leave */
update_load_avg(cfs_rq, se, 0); update_load_avg(cfs_rq, se, 0);
detach_entity_load_avg(cfs_rq, se); detach_entity_load_avg(cfs_rq, se);
update_tg_load_avg(cfs_rq, false); update_tg_load_avg(cfs_rq);
propagate_entity_cfs_rq(se); propagate_entity_cfs_rq(se);
} }
...@@ -10816,7 +10815,7 @@ static void attach_entity_cfs_rq(struct sched_entity *se) ...@@ -10816,7 +10815,7 @@ static void attach_entity_cfs_rq(struct sched_entity *se)
/* Synchronize entity with its cfs_rq */ /* Synchronize entity with its cfs_rq */
update_load_avg(cfs_rq, se, sched_feat(ATTACH_AGE_LOAD) ? 0 : SKIP_AGE_LOAD); update_load_avg(cfs_rq, se, sched_feat(ATTACH_AGE_LOAD) ? 0 : SKIP_AGE_LOAD);
attach_entity_load_avg(cfs_rq, se); attach_entity_load_avg(cfs_rq, se);
update_tg_load_avg(cfs_rq, false); update_tg_load_avg(cfs_rq);
propagate_entity_cfs_rq(se); propagate_entity_cfs_rq(se);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment