Messages in this thread | | | Date | Tue, 21 Jul 2015 18:18:46 +0800 | From | Boqun Feng <> | Subject | Re: [PATCH v10 6/7] sched: Provide runnable_load_avg back to cfs_rq |
| |
On Tue, Jul 21, 2015 at 08:44:01AM +0800, Yuyang Du wrote: > On Tue, Jul 21, 2015 at 09:08:07AM +0800, Boqun Feng wrote: > > Hi Yuyang, > > > > On Wed, Jul 15, 2015 at 08:04:41AM +0800, Yuyang Du wrote: > > > The cfs_rq's load_avg is composed of runnable_load_avg and blocked_load_avg. > > > Before this series, sometimes the runnable_load_avg is used, and sometimes > > > the load_avg is used. Completely replacing all uses of runnable_load_avg > > > with load_avg may be too big a leap, i.e., the blocked_load_avg is concerned > > > to result in overrated load. Therefore, we get runnable_load_avg back. > > > > > > The new cfs_rq's runnable_load_avg is improved to be updated with all of the > > > runnable sched_eneities at the same time, so the one sched_entity updated and > > > the others stale problem is solved. > > > > > > > How about tracking cfs_rq's blocked_load_avg instead of > > runnable_load_avg, because, AFAICS: > > > > cfs_rq->runnable_load_avg = se->avg.load_avg - cfs_rq->blocked_load_avg. > > No, cfs_rq->runnable_load_avg = cfs_rq->avg.load_avg - cfs_rq->blocked_load_avg, > without rounding errors and the like. >
Oh, sorry.. yeah, you're right here.
> > se is the corresponding sched_entity of cfs_rq. And when we need the > > runnable_load_avg, we just calculate by the expression above. > > > > This can be thought as a lazy way to update runnable_load_avg, and we > > don't need to modify __update_load_avg any more. > > Not lazy at all, but adding (as of now) useless blocked_load_avg and an > extra subtraction.
but we can remove runnable_load_avg tracking code in __update_load_avg, as you do in this patch, right?
> Or did you forget blocked_load_avg also needs to be updated/decayed as > time elapses?
I know we need to update or decay the blocked_load_avg, but we only need to update and decay when 1) entity dequeued/enqueued 2) entity migrated or 3) we need the runnable_load_avg value calcuated by blocked_load_avg, right?
These are more rare than __update_load_avg called, right?
Regards, Boqun
[unhandled content-type:application/pgp-signature] | |