From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752352AbcFGDNC (ORCPT ); Mon, 6 Jun 2016 23:13:02 -0400 Received: from mga03.intel.com ([134.134.136.65]:49327 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751049AbcFGDM7 (ORCPT ); Mon, 6 Jun 2016 23:12:59 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,431,1459839600"; d="scan'208";a="970273644" Date: Tue, 7 Jun 2016 03:15:52 +0800 From: Yuyang Du To: Matt Fleming Cc: peterz@infradead.org, 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 Subject: Re: [PATCH v4 3/5] sched/fair: Skip detach sched avgs for new task when changing task groups Message-ID: <20160606191552.GE8105@intel.com> References: <1465172441-27727-1-git-send-email-yuyang.du@intel.com> <1465172441-27727-4-git-send-email-yuyang.du@intel.com> <20160606140338.GS2658@codeblueprint.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160606140338.GS2658@codeblueprint.co.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 06, 2016 at 03:03:38PM +0100, Matt Fleming wrote: > > #ifdef CONFIG_FAIR_GROUP_SCHED > > -static void task_move_group_fair(struct task_struct *p) > > +static void task_move_group_fair(struct task_struct *p, bool fork) > > { > > - detach_task_cfs_rq(p); > > + /* > > + * Newly forked task should not be removed from any cfs_rq > > + */ > > + if (!fork) > > + detach_task_cfs_rq(p); > > set_task_rq(p, task_cpu(p)); > > attach_task_cfs_rq(p); > > /* > > Wouldn't it be more symmetric to add, > > if (p->se.avg.last_update_time) > __update_load_avg(...) > > to detach_entity_load_avg() so that there's no need to pass the @fork > parameter all the way down the stack Up to this point, we can't. But we should be able to if we move the next patch (4/5) before this patch. I should have changed my mindset with that patch. Good advice though, thanks, Matt.