From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752035AbcFNOhA (ORCPT ); Tue, 14 Jun 2016 10:37:00 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:49499 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751239AbcFNOg7 (ORCPT ); Tue, 14 Jun 2016 10:36:59 -0400 Date: Tue, 14 Jun 2016 16:36:49 +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: <20160614143649.GC3704@worktop> References: <1465427754-28897-1-git-send-email-yuyang.du@intel.com> <1465427754-28897-5-git-send-email-yuyang.du@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1465427754-28897-5-git-send-email-yuyang.du@intel.com> 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 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;