Revert "Revert "sched,fair: Alternative sched_slice()""

This reverts commit 3d24408745.

Bring back the commit in 5.10.36 that broke the kabi.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iafa9c51e4cb9e42f4149c4e9889b822288a96ad2
This commit is contained in:
Greg Kroah-Hartman 2021-05-13 14:25:33 +02:00 committed by Todd Kjos
commit 4cef9277ba
2 changed files with 14 additions and 1 deletions

View file

@ -706,7 +706,13 @@ static u64 __sched_period(unsigned long nr_running)
*/
static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
u64 slice = __sched_period(cfs_rq->nr_running + !se->on_rq);
unsigned int nr_running = cfs_rq->nr_running;
u64 slice;
if (sched_feat(ALT_PERIOD))
nr_running = rq_of(cfs_rq)->cfs.h_nr_running;
slice = __sched_period(nr_running + !se->on_rq);
for_each_sched_entity(se) {
struct load_weight *load;
@ -723,6 +729,10 @@ static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)
}
slice = __calc_delta(slice, se->load.weight, load);
}
if (sched_feat(BASE_SLICE))
slice = max(slice, (u64)sysctl_sched_min_granularity);
return slice;
}

View file

@ -90,3 +90,6 @@ SCHED_FEAT(WA_BIAS, true)
*/
SCHED_FEAT(UTIL_EST, true)
SCHED_FEAT(UTIL_EST_FASTUP, true)
SCHED_FEAT(ALT_PERIOD, true)
SCHED_FEAT(BASE_SLICE, true)