[Devel] [PATCH RHEL COMMIT] sched: Split task_h_load()
Konstantin Khorenko
khorenko at virtuozzo.com
Fri Sep 24 14:49:31 MSK 2021
The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after ark-5.14
------>
commit 5fe1062a273ea46739c0b7f84dd97e056789ce00
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Fri Sep 24 14:49:31 2021 +0300
sched: Split task_h_load()
Refactoring needed for CONFIG_CFS_CPULIMIT.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
https://jira.sw.ru/browse/PSBM-133986
(cherry picked from commit f511f958d4294fe50e1b42661a5bd7012b61f82a)
Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn at virtuozzo.com>
---
kernel/sched/fair.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index fb32b3480e19..fb30663db2fe 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -8193,12 +8193,12 @@ static void update_cfs_rq_h_load(struct cfs_rq *cfs_rq)
}
}
-static unsigned long task_h_load(struct task_struct *p)
+static unsigned long entity_h_load(struct sched_entity *se)
{
- struct cfs_rq *cfs_rq = task_cfs_rq(p);
+ struct cfs_rq *cfs_rq = cfs_rq_of(se);
update_cfs_rq_h_load(cfs_rq);
- return div64_ul(p->se.avg.load_avg * cfs_rq->h_load,
+ return div64_ul(se->avg.load_avg * cfs_rq->h_load,
cfs_rq_load_avg(cfs_rq) + 1);
}
#else
@@ -8214,12 +8214,17 @@ static bool __update_blocked_fair(struct rq *rq, bool *done)
return decayed;
}
-static unsigned long task_h_load(struct task_struct *p)
+static unsigned long entity_h_load(struct sched_entity *se)
{
- return p->se.avg.load_avg;
+ return se->avg.load_avg;
}
#endif
+static unsigned long task_h_load(struct task_struct *p)
+{
+ return entity_h_load(&p->se);
+}
+
static void update_blocked_averages(int cpu)
{
bool decayed = false, done = true;
More information about the Devel
mailing list