Re: [PATCH 2/2] sched: Rewrite per entity runnable load average tracking
From: Yuyang Du
Date: Tue Jul 08 2014 - 00:08:30 EST
Thanks, Peter.
On Mon, Jul 07, 2014 at 12:46:46PM +0200, Peter Zijlstra wrote:
>
> That tg->load_avg cacheline is already red hot glowing, and you've just
> increased the amount of updates to it.. That's not going to be pleasant.
>
Logically, this rewrite updates tg->load_avg as soon as it is changed. But
technically, this is not necessary, as it is only needed to be updated when
it is used before update_cfs_shares() and update_cfs_rq_h_load().
Yes, I can optimize it.
> So here you add the task to the cfs_rq avg when its got migrate in,
> however:
>
> > @@ -4552,17 +4326,9 @@ migrate_task_rq_fair(struct task_struct *p, int next_cpu)
> > struct sched_entity *se = &p->se;
> > struct cfs_rq *cfs_rq = cfs_rq_of(se);
> >
> > + /* Update task on old CPU, then ready to go (entity must be off the queue) */
> > + __update_load_avg(cfs_rq_clock_task(cfs_rq), &se->avg, 0);
> > + se->avg.last_update_time = 0;
> >
> > /* We have migrated, no longer consider this task hot */
> > se->exec_start = 0;
>
> there you don't remove it first..
>
Yes, I missed it. I wonder what I was thinking. Migration is the only reason
to track task load average...
Yuyang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/