From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752068AbcFNOqN (ORCPT ); Tue, 14 Jun 2016 10:46:13 -0400 Received: from merlin.infradead.org ([205.233.59.134]:36413 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751826AbcFNOqJ (ORCPT ); Tue, 14 Jun 2016 10:46:09 -0400 Date: Tue, 14 Jun 2016 16:45:53 +0200 From: Peter Zijlstra To: Yuyang Du Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, bsegall@google.com, pjt@google.com, morten.rasmussen@arm.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, matt@codeblueprint.co.uk Subject: Re: [PATCH v5 4/5] sched/fair: Skip detach sched avgs for new task when changing task groups Message-ID: <20160614144553.GA7381@worktop> References: <1465427754-28897-1-git-send-email-yuyang.du@intel.com> <1465427754-28897-5-git-send-email-yuyang.du@intel.com> <20160614143649.GC3704@worktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160614143649.GC3704@worktop> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 14, 2016 at 04:36:49PM +0200, Peter Zijlstra wrote: > On Thu, Jun 09, 2016 at 07:15:53AM +0800, Yuyang Du wrote: > > Newly forked task has not been enqueued, so should not be removed from > > cfs_rq in task_move_group_fair(). To do so, we identify newly forked > > tasks by their sched_avg's last_update_time in detach_entity_load_avg(). > > > static void detach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) > > { > > + /* Newly forked tasks are not attached yet. */ > > + if (!se->avg.last_update_time) > > + return; > > Urgh, so this results in two different heuristics to detect 'new' tasks > and gives two different meanings to !last_update_time. > > How about you use the existing heuristic as per vruntime_normalized() > and do: > > if (!se->sum_exec_runtime) > return; Hurm,. I see we already have this confusion as per remove_entity_load_avg(). Could we fix it there too?