From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755062AbcIAU6z (ORCPT ); Thu, 1 Sep 2016 16:58:55 -0400 Received: from foss.arm.com ([217.140.101.70]:38494 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754333AbcIAU6w (ORCPT ); Thu, 1 Sep 2016 16:58:52 -0400 Subject: Re: [PATCH v1 00/10] Optimize sched avgs computation and implement flat util hierarchy To: Yuyang Du References: <1470788095-2125-1-git-send-email-yuyang.du@intel.com> <20160810002352.GB3273@intel.com> <20160822232637.GC3273@intel.com> <20160823141341.GP10153@twins.programming.kicks-ass.net> <474c486c-84b3-14b0-6861-336a129f7ed8@arm.com> <20160829013731.GH3273@intel.com> Cc: Vincent Guittot , Peter Zijlstra , Ingo Molnar , linux-kernel , Benjamin Segall , Paul Turner , Morten Rasmussen , Matt Fleming , Mike Galbraith From: Dietmar Eggemann Message-ID: <6d592dc0-bb7b-8211-d5c7-d805264743d4@arm.com> Date: Thu, 1 Sep 2016 19:32:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160829013731.GH3273@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/08/16 02:37, Yuyang Du wrote: > On Tue, Aug 23, 2016 at 04:39:51PM +0100, Dietmar Eggemann wrote: >> On 23/08/16 15:45, Vincent Guittot wrote: >>> On 23 August 2016 at 16:13, Peter Zijlstra wrote: >>>> On Tue, Aug 23, 2016 at 03:28:19PM +0200, Vincent Guittot wrote: >>>>> I still wonder if using a flat util hierarchy is the right solution to >>>>> solve this problem with utilization and task group. I have noticed >>>>> exact same issues with load that generates weird task placement >>>>> decision and i think that we should probably try to solve both wrong >>>>> behavior with same mechanism. but this is not possible with flat >>>>> hierarchy for load >>>>> >>>>> Let me take an example. >>>>> TA is a always running task on CPU1 in group /root/level1/ >>>>> TB wakes up on CPU0 and moves TA into group /root/level2/ >>>>> Even if TA stays on CPU1, runnable_load_avg of CPU1 root cfs rq will become 0. >>>> >>>> Because while we migrate the load_avg on /root/level2, we do not >>>> propagate the load_avg up the hierarchy? >>> >>> yes. At now, the load of a cfs_rq and the load of its sched_entity >>> that represents it at parent level are disconnected >> >> I guess you say 'disconnected' because cfs_rq and se (w/ cfs_rq eq. >> se->my_q) are now independent pelt signals where as before the rewrite >> they were 'connected' for load via __update_tg_runnable_avg(), >> __update_group_entity_contrib() in __update_entity_load_avg_contrib() >> and for utilization via 'se->avg.utilization_avg_contrib = >> group_cfs_rq(se)->utilization_load_avg' in >> __update_entity_utilization_avg_contrib(). > > I don't understand what exactly "disconnected" means, but with respect to > group_entity's load_avg, nothing is changed essentially: > True but this is the update_cfs_shares() side of things. > group_entity_load_avg = my_cfs_rq_load_avg / tg_load_avg * tg_shares > 'Connected' for me in the old implementation stands for the fact that for every call to update_entity_load_avg(se, 1) (with !entity_is_task(se)), the group cfs_rq (se->my_q) contribution towards the se is updated in __update_entity_[load|utilization]_avg_contrib and the returning delta is added to the appropriate cfs_rq (se->cfs_rq) values immediately. Doing this in for_each_sched_entity(se) gives this nice propagation effect in direction root cfs_rq. In the new implementation se, se->my_q and se->cfs_rq have independent PELT signals, hence the 'disconnected'.