On Thu, Jan 26, 2017 at 10:05:17AM -0500, Thara Gopinath wrote:
[...]
/* Adjust by relative CPU capacity of the group */ @@ -7829,7 +7872,7 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd struct sched_group *sg = env->sd->groups; struct sg_lb_stats tmp_sgs; int load_idx, prefer_sibling = 0;
- bool overload = false, overutilized = false;
bool overload = false, overutilized = false, misfit_task = false;
if (child && child->flags & SD_PREFER_SIBLING) prefer_sibling = 1;
@@ -7851,7 +7894,8 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd }
update_sg_lb_stats(env, sg, load_idx, local_group, sgs,
&overload, &overutilized);
&overload, &overutilized,
&misfit_task);
if (local_group) goto next_group;
@@ -7882,6 +7926,7 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd /* Now, start updating sd_lb_stats */ sds->total_load += sgs->group_load; sds->total_capacity += sgs->group_capacity;
sds->total_util += sgs->group_util;
sg = sg->next; } while (sg != env->sd->groups);
@@ -7895,14 +7940,27 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd /* update overload indicator if we are at root domain */ if (env->dst_rq->rd->overload != overload) env->dst_rq->rd->overload = overload;
/* Update over-utilization (tipping point, U >= 0) indicator */
if (env->dst_rq->rd->overutilized != overutilized)
env->dst_rq->rd->overutilized = overutilized;
- } else {
if (!env->dst_rq->rd->overutilized && overutilized)
env->dst_rq->rd->overutilized = true;
So can we use one patch to remove 'rd->overutilized'?
Yes. When I send out the next version i will include another patch removing rd->overutilized.
}
- if (overutilized)
set_sd_overutilized(env->sd);
- else
clear_sd_overutilized(env->sd);
If only one CPU is overutilized, here is it possible to set 'overutilized' flag for 'shared' sched domain in second level, finally introduce lb between two clusters?
I do not understand your question here ?
E.g, 'env->sd' refers to the schedule domain for Cluster0 (CPUA & CPUB) and cluster1 (CPUC & CPUD); if CPUA is overutilized then upper code will set 'env->sd' flag, so at the end the lb will happen between cluster0 and cluster1. I think for this case it's better to set the overutilized flag only for schedule domain with CPUA and CPUB so lb is to happen within cluster0.
Not sure if this is same idea with you, for more specific I suggest code like below:
if (env->sd->parent) { if (overutilized) set_sd_overutilized(env->sd); else clear_sd_overutilized(env->sd); }
Thanks, Leo Yan