Re: [PATCH] sched: sync with the cfs_rq when changing sched class

From: Yuyang Du
Date: Thu Aug 13 2015 - 02:32:32 EST


On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.park@xxxxxxx wrote:
>
> currently, a task load is synced with its cfs_rq, only when it
> leaves from fair class. we also need to sync it with cfs_rq when
> it returns back to fair class, too.

Syncing it at the time it is switched to fair is not necessary, because
since last_update_time if it has ever been updated, the load has become
random, IOW, useless. So we simply leave it unattended, and let itself
merge in the system.

>
> #ifdef CONFIG_SMP
> /* synchronize task with its prev cfs_rq */
> - if (!queued)
> - __update_load_avg(cfs_rq->avg.last_update_time, cpu_of(rq_of(cfs_rq)),
> - &se->avg, se->on_rq * scale_load_down(se->load.weight),
> - cfs_rq->curr == se, NULL);
> -
> - /* remove our load when we leave */
> - cfs_rq->avg.load_avg = max_t(long, cfs_rq->avg.load_avg - se->avg.load_avg, 0);
> - cfs_rq->avg.load_sum = max_t(s64, cfs_rq->avg.load_sum - se->avg.load_sum, 0);
> - cfs_rq->avg.util_avg = max_t(long, cfs_rq->avg.util_avg - se->avg.util_avg, 0);
> - cfs_rq->avg.util_sum = max_t(s32, cfs_rq->avg.util_sum - se->avg.util_sum, 0);
> + detach_entity_load_avg(cfs_rq, se);
> #endif

You changed the logic.
--
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/