| From | Vincent Guittot <> | Date | Thu, 12 Feb 2015 02:07:31 +0100 | Subject | Re: [RFCv3 PATCH 01/48] sched: add utilization_avg_contrib |
| |
On 11 February 2015 at 09:50, Preeti U Murthy <preeti@linux.vnet.ibm.com> wrote: > On 02/05/2015 12:00 AM, Morten Rasmussen wrote: >> From: Vincent Guittot <vincent.guittot@linaro.org> >> >> Add new statistics which reflect the average time a task is running on the CPU >> and the sum of these running time of the tasks on a runqueue. The latter is >> named utilization_load_avg. >> >> This patch is based on the usage metric that was proposed in the 1st >> versions of the per-entity load tracking patchset by Paul Turner >> <pjt@google.com> but that has be removed afterwards. This version differs from >> the original one in the sense that it's not linked to task_group. >> >> The rq's utilization_load_avg will be used to check if a rq is overloaded or >> not instead of trying to compute how many tasks a group of CPUs can handle. >> >> Rename runnable_avg_period into avg_period as it is now used with both >> runnable_avg_sum and running_avg_sum >> >> Add some descriptions of the variables to explain their differences >> >> cc: Paul Turner <pjt@google.com> >> cc: Ben Segall <bsegall@google.com> >> >> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> >> Acked-by: Morten Rasmussen <morten.rasmussen@arm.com> >> --- >> include/linux/sched.h | 21 ++++++++++++--- >> kernel/sched/debug.c | 10 ++++--- >> kernel/sched/fair.c | 74 ++++++++++++++++++++++++++++++++++++++++----------- >> kernel/sched/sched.h | 8 +++++- >> 4 files changed, 89 insertions(+), 24 deletions(-) > >> +static inline void __update_task_entity_utilization(struct sched_entity *se) >> +{ >> + u32 contrib; >> + >> + /* avoid overflowing a 32-bit type w/ SCHED_LOAD_SCALE */ >> + contrib = se->avg.running_avg_sum * scale_load_down(SCHED_LOAD_SCALE); >> + contrib /= (se->avg.avg_period + 1); >> + se->avg.utilization_avg_contrib = scale_load(contrib); >> +} >> + >> +static long __update_entity_utilization_avg_contrib(struct sched_entity *se) >> +{ >> + long old_contrib = se->avg.utilization_avg_contrib; >> + >> + if (entity_is_task(se)) >> + __update_task_entity_utilization(se); >> + >> + return se->avg.utilization_avg_contrib - old_contrib; > > When the entity is not a task, shouldn't the utilization_avg_contrib be > updated like this : > > se->avg.utilization_avg_contrib = group_cfs_rq(se)->utilization_load_avg > ? and then the delta with old_contrib be passed ? > > Or is this being updated someplace that I have missed ?
Patch 02 handles the contribution of entities which are not tasks.
Regards, Vincent
> > Regards > Preeti U Murthy >
|