aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/sched_fair.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 7b8d664d6f22..865cb53a7ccf 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1073,6 +1073,25 @@ static inline int wake_idle(int cpu, struct task_struct *p)
1073 1073
1074static const struct sched_class fair_sched_class; 1074static const struct sched_class fair_sched_class;
1075 1075
1076#ifdef CONFIG_FAIR_GROUP_SCHED
1077static unsigned long task_h_load(struct task_struct *p)
1078{
1079 unsigned long h_load = p->se.load.weight;
1080 struct cfs_rq *cfs_rq = cfs_rq_of(&p->se);
1081
1082 update_h_load(task_cpu(p));
1083
1084 h_load = calc_delta_mine(h_load, cfs_rq->h_load, &cfs_rq->load);
1085
1086 return h_load;
1087}
1088#else
1089static unsigned long task_h_load(struct task_struct *p)
1090{
1091 return p->se.load.weight;
1092}
1093#endif
1094
1076static int 1095static int
1077wake_affine(struct rq *rq, struct sched_domain *this_sd, struct rq *this_rq, 1096wake_affine(struct rq *rq, struct sched_domain *this_sd, struct rq *this_rq,
1078 struct task_struct *p, int prev_cpu, int this_cpu, int sync, 1097 struct task_struct *p, int prev_cpu, int this_cpu, int sync,
@@ -1093,9 +1112,9 @@ wake_affine(struct rq *rq, struct sched_domain *this_sd, struct rq *this_rq,
1093 * of the current CPU: 1112 * of the current CPU:
1094 */ 1113 */
1095 if (sync) 1114 if (sync)
1096 tl -= current->se.load.weight; 1115 tl -= task_h_load(current);
1097 1116
1098 balanced = 100*(tl + p->se.load.weight) <= imbalance*load; 1117 balanced = 100*(tl + task_h_load(p)) <= imbalance*load;
1099 1118
1100 /* 1119 /*
1101 * If the currently running task will sleep within 1120 * If the currently running task will sleep within