Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752844AbbFVSSP (ORCPT ); Mon, 22 Jun 2015 14:18:15 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([207.82.80.143]:23010 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751667AbbFVSSG convert rfc822-to-8bit (ORCPT ); Mon, 22 Jun 2015 14:18:06 -0400 Message-ID: <5588515D.1020505@arm.com> Date: Mon, 22 Jun 2015 19:18:05 +0100 From: Dietmar Eggemann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Yuyang Du CC: "mingo@kernel.org" , "peterz@infradead.org" , "linux-kernel@vger.kernel.org" , "pjt@google.com" , "bsegall@google.com" , Morten Rasmussen , "vincent.guittot@linaro.org" , "len.brown@intel.com" , "rafael.j.wysocki@intel.com" , "fengguang.wu@intel.com" , "boqun.feng@gmail.com" , "srikar@linux.vnet.ibm.com" Subject: Re: [PATCH v8 1/4] sched: Remove rq's runnable avg References: <1434396367-27979-1-git-send-email-yuyang.du@intel.com> <1434396367-27979-2-git-send-email-yuyang.du@intel.com> <55845F0C.8050504@arm.com> <20150621222601.GB3933@intel.com> In-Reply-To: <20150621222601.GB3933@intel.com> X-OriginalArrivalTime: 22 Jun 2015 18:18:02.0201 (UTC) FILETIME=[C6A09490:01D0AD17] X-MC-Unique: TVd0iuB2QRyNhZpPvbpoNg-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1859 Lines: 49 On 21/06/15 23:26, Yuyang Du wrote: > Hi Dietmar, > > On Fri, Jun 19, 2015 at 07:27:24PM +0100, Dietmar Eggemann wrote: >> Hi Yuyang, >> >> On 15/06/15 20:26, Yuyang Du wrote: >>> The current rq->avg is not used at all since its merge into kernel, >>> and the code is in the scheduler's hot path, so remove it. >> >> are you sure that this is the case? I was always under the impression >> that w/ CONFIG_FAIR_GROUP_SCHED=y rq->avg (runnable_avg_sum, avg_period) >> is used to calculate contrib in __update_tg_runnable_avg() for the root >> group (cfs_rq->tg->css.id = 1). >> >> On tg's w/ cfs_rq->tg->css.id > 1, se->avg (runnable_avg_sum, >> avg_period) is used instead but we simply don't have a tg related se for >> the root group. IMHO, that's why we have this rq::avg. > > Yes, I agree. But the root group's avg is not useful anyway. If it is, > we sure should keep it. You're right. Both consumers of tg->load_avg and tg->runnable_avg (__update_group_entity_contrib() and calc_tg_weight()) are never called w/ cfs_rq->tg->css.id < 2 . I did some tests w/ task groups on my ARM platform. The system survives an appropriate BUG_ON in both functions just fine. Maybe you can put a little bit more information why rq::avg isn't needed even in the CONFIG_FAIR_GROUP_SCHED=y case into the patch header? I assume getting rid of extra code in the current per-entity load-tracking code is a good thing. And this patch is probably less complicated to understand than your second one :-) > >> I understand that w/ the second patch in your series you don't need >> rq::avg any more. > > And the rq->avg can be replaced by the root cfs_rq's util_avg, too. Given the fact that it is not used this wouldn't be necessary. [...] -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/