From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753170AbcEaMkH (ORCPT ); Tue, 31 May 2016 08:40:07 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:33665 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751929AbcEaMkF (ORCPT ); Tue, 31 May 2016 08:40:05 -0400 Date: Tue, 31 May 2016 14:39:58 +0200 From: Peter Zijlstra To: Vincent Guittot Cc: Yuyang Du , Ingo Molnar , linux-kernel , Benjamin Segall , Paul Turner , Morten Rasmussen , Dietmar Eggemann Subject: Re: [PATCH v2 2/3] sched/fair: Skip detach and attach new group task Message-ID: <20160531123958.GL3193@twins.programming.kicks-ass.net> References: <1464647577-23057-1-git-send-email-yuyang.du@intel.com> <1464647577-23057-3-git-send-email-yuyang.du@intel.com> <20160531120352.GK3193@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 31, 2016 at 02:33:45PM +0200, Vincent Guittot wrote: > The sched_avg of a task is not used anymore in copy_process with > yuyang's patchset. To be fully correct, we still have a > p->se.avg.last_update_time = 0 in cpu_cgroup_fork but this is just the > side effect of factoring cpu_group_fork and cpu_group_move in > sched_move_task and it will be overwritten by > init_entity_runnable_average before being used. Yeah, but why? Why does init_entity_runnable_average() live in wake_up_new_task()? That doesn't seem to make sense. Also note that vruntime_normalized() (ab)uses !se->sum_exec_runtime to detect the new task state. > Now, cpu_cgroup_fork() only sets task group and cfs_rq of the forked task > > copy_process > sched_fork > ... > cgroup_post_fork > ss->fork() := cpu_cgroup_fork() which only set task group and > cfs_rq of the sched_entity of the task > > wake_up_new_task > init_entity_runnable_average > activate_task > enqueue_task > attach_task