public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PELT initial task load and wake_up_new_task()
@ 2015-12-12  2:01 Steve Muckle
  2015-12-13 19:13 ` Yuyang Du
  0 siblings, 1 reply; 12+ messages in thread
From: Steve Muckle @ 2015-12-12  2:01 UTC (permalink / raw)
  To: yuyang.du@intel.com, Peter Zijlstra, Ingo Molnar,
	Morten Rasmussen, Dietmar Eggemann, Patrick Bellasi, Juri Lelli,
	Vincent Guittot
  Cc: linux-kernel@vger.kernel.org

In init_entity_runnable_average() the last_update_time is initialized to
zero. The task is given max load and utilization as a pessimistic
initial estimate.

But if in wake_up_new_task() the task is placed on a CPU other than
where it was created, __update_load_avg() will be called via
set_task_cpu() -> migrate_task_rq_fair() -> remove_entity_load_avg().

Since last_update_time is zero the delta will be huge and the task's
load will be entirely decayed away before it is enqueued at the
destination CPU.

If last_update_time is initialized to cfs_rq_clock_task() the load will
not go away, but it will also then be subtracted from the original CPU
in remove_entity_load_avg() if the task is placed on a different CPU,
which is bad since it was never added there before.

Thinking about this more it seemed questionable to treat the assignment
of a task to a new CPU in wake_up_new_task() as a migration given that
the task has never executed previously. Would it make sense to call
__set_task_cpu() there instead of set_task_cpu()?

thanks,
Steve

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-01-06 18:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-12  2:01 PELT initial task load and wake_up_new_task() Steve Muckle
2015-12-13 19:13 ` Yuyang Du
2015-12-15  0:41   ` Steve Muckle
2015-12-15  2:24     ` Yuyang Du
2015-12-15 18:45       ` Steve Muckle
2015-12-15 23:55         ` Yuyang Du
2015-12-16  7:58           ` [PATCH] sched: Fix new task's load avg removed from source CPU in kbuild test robot
2015-12-17  2:50           ` PELT initial task load and wake_up_new_task() Steve Muckle
2015-12-16 23:34             ` Yuyang Du
2015-12-17  9:43               ` Peter Zijlstra
2015-12-17  2:16                 ` Yuyang Du
2016-01-06 18:49               ` [tip:sched/core] sched/fair: Fix new task' s load avg removed from source CPU in wake_up_new_task() tip-bot for Yuyang Du

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox