Re: [PATCH 8/8] sched,fair: flatten hierarchical runqueues
From: Rik van Riel
Date: Tue Jun 25 2019 - 09:51:42 EST
On Tue, 2019-06-25 at 11:50 +0200, Dietmar Eggemann wrote:
> On 6/12/19 9:32 PM, Rik van Riel wrote:
>
> [...]
>
> > @@ -410,6 +412,11 @@ static inline struct sched_entity
> > *parent_entity(struct sched_entity *se)
> > return se->parent;
> > }
> >
> > +static inline bool task_se_in_cgroup(struct sched_entity *se)
> > +{
> > + return parent_entity(se);
> > +}
>
> IMHO, s/in_cgroup/not_in_root_tg/ reads easier. "/", i.e. the root tg
> is
> still a cgroup, I guess. But you could use existing parent_entity(se)
> as
> well.
I agree my name is not the prettiest, but I am not
entirely convinced your idea is an improvement.
I'll hold out for better ideas by other reviewers :)
> > @@ -679,22 +710,16 @@ static inline u64 calc_delta_fair(u64 delta,
> > struct sched_entity *se)
> > static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity
> > *se)
> > {
> > u64 slice = sysctl_sched_latency;
> > + struct load_weight *load = &cfs_rq->load;
> > + struct load_weight lw;
> >
> > - for_each_sched_entity(se) {
> > - struct load_weight *load;
> > - struct load_weight lw;
> > + if (unlikely(!se->on_rq)) {
> > + lw = cfs_rq->load;
> >
> > - cfs_rq = cfs_rq_of(se);
> > - load = &cfs_rq->load;
> > -
> > - if (unlikely(!se->on_rq)) {
> > - lw = cfs_rq->load;
> > -
> > - update_load_add(&lw, se->load.weight);
> > - load = &lw;
> > - }
> > - slice = __calc_delta(slice, se->load.weight, load);
> > + update_load_add(&lw, task_se_h_load(se));
> > + load = &lw;
> > }
> > + slice = __calc_delta(slice, task_se_h_load(se), load);
>
> task_se_h_load(se) and se->load.weight are off my factor of >= 1024
> on
> 64bit.
Oh indeed they are!
I wonder if this is the root cause of that
performance regression I have been hunting for
the past few weeks :)
Let me go test some things...
> ...
> bash pid=3250: task_se_h_load(se)=1023 se->load.weight=1048576
> sysctl_sched_latency=18000000 slice=0 old_slice=17999995
> ...
>
> [...]
>
--
All Rights Reversed.
Attachment:
signature.asc
Description: This is a digitally signed message part