Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2086834imm; Thu, 2 Aug 2018 06:06:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeI8UxFs3PfZEI6XrUJh/9f7ITNZw1OjE3YZ99vxD/32zWfKNNoFiiewZ94N14ef/gplVe9 X-Received: by 2002:a63:ec43:: with SMTP id r3-v6mr2653838pgj.295.1533215194280; Thu, 02 Aug 2018 06:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533215194; cv=none; d=google.com; s=arc-20160816; b=gipWnunZqLfzwuRmpD0Qk8mhzVwh+KTEJxgDrPYLWEb1mDDYZe94a9/k32ejASMW58 SPooq0RF3njlVP7fA4B1FCdOsGgrEIZgUcf4T0ZGeyYRJ2dPhu5XXKIS7cfSZj2azliF ppGjzIwPwXLZqa8ra2GWI0fPqSg0ER8F7VgsOkQLzy57yL4gyNu0rhDTKWFLAhsqZ5vL k8BHumCiVPpykeOh0xs1LnKc3gmAPITtdc1u35Kg+M7LRA/DzeM7v5WeMsS6aB4wZ4lY WgpMr960mmp2VF19Mjkk/FL1U5yFtMXtDyK1RiklzrxmW7WFnnQvjhpCATlCATKU4xYi DW4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=U+K947hy6oUVYiZznd9pM4QXnfqcQmNfyZmly/o5LKI=; b=QPKaqg61NWV82GshwlcksZBsCiTPpw/J1xLyTnMti6jzycNBoYhkqsjERqc3CAe0E3 +nVuaP9dF9dc77Re5Y+tKenZopKiv23ZblvRCvJP/TE6PF6wo6nQN5FeGwaF9qs6yrVN OfTS/jNv1wOhb48diDh9NS+95hkVdvj0wHl0BxiE4l/oxkdU56cS4XIGrmmlCHxaT0lb g1eEM/aek364XAXZl4d16pfK+c5IJZ1ZT5yB5+afBZNPHDYrKkQce3Y2OCJK+Drs9OrU Zm6JEr0kVnb7W/9vw7zey/iQ1dIMRhL8sur6zpDL10EdMHPMqH8LO1F4HT+sEJG/WFoB ixTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=H2huOMIO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 75-v6si2090262pgh.110.2018.08.02.06.06.19; Thu, 02 Aug 2018 06:06:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=H2huOMIO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732506AbeHBOz5 (ORCPT + 99 others); Thu, 2 Aug 2018 10:55:57 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:44604 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732460AbeHBOz5 (ORCPT ); Thu, 2 Aug 2018 10:55:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=U+K947hy6oUVYiZznd9pM4QXnfqcQmNfyZmly/o5LKI=; b=H2huOMIOomyjSTcG8T/Sio+Us PiZrzy2ErI3r0mu8slZ+TpBtxEyxZ9kfJhNjYFobVWS0c8qJpLqhE4UD7iWkruqvRdZtUsmGkExQd N73kI9xnMxEwKlv4BdfYEWMAVme+f8m4qxU7keV4dz2JJM6+/hsD/7bsygsDSIRJKSt7v4Uq0JJuj MuYO7+wgWcT7vdySU8XX+ho8kJDesT5OijqwDNw9997U71qd/5CjbzcFYrp5QtuKUtRoH+RfUwsap f8uIZ9iEFTMs/9gn6WV8Ft3NFZsk+D40N3R+IXJY/3SSNftCYOihHYWmezQtkBmjRq7ppCegu8Jo3 RG3rD8vog==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1flDHX-0005Ym-FY; Thu, 02 Aug 2018 13:04:43 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8420920268261; Thu, 2 Aug 2018 15:04:40 +0200 (CEST) Date: Thu, 2 Aug 2018 15:04:40 +0200 From: Peter Zijlstra To: Quentin Perret Cc: "Rafael J. Wysocki" , Saravana Kannan , "Rafael J. Wysocki" , Linux Kernel Mailing List , Linux PM , Greg Kroah-Hartman , Ingo Molnar , Dietmar Eggemann , Morten Rasmussen , Chris Redpath , Patrick Bellasi , Valentin Schneider , Vincent Guittot , Thara Gopinath , Viresh Kumar , Todd Kjos , Joel Fernandes , Steve Muckle , adharmap@quicinc.com, skannan@quicinc.com, Pavan Kondeti , Juri Lelli , Eduardo Valentin , Srinivas Pandruvada , currojerez@riseup.net, Javi Merino , linux-pm-owner@vger.kernel.org Subject: Re: [PATCH v5 10/14] sched/cpufreq: Refactor the utilization aggregation method Message-ID: <20180802130440.GW2476@hirez.programming.kicks-ass.net> References: <20180724122521.22109-1-quentin.perret@arm.com> <20180724122521.22109-11-quentin.perret@arm.com> <331552975e858911db66bc78c2c8e720@codeaurora.org> <20180731075950.tfvxef6yuja3ad2k@queper01-lin> <75f415911ccdd02d6fd217ca1c7d8902@codeaurora.org> <20180801082353.egym4tsbr7ppql27@queper01-lin> <20180801092325.g2upcivcvdo62hub@queper01-ThinkPad-T460s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180801092325.g2upcivcvdo62hub@queper01-ThinkPad-T460s> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 01, 2018 at 10:23:27AM +0100, Quentin Perret wrote: > On Wednesday 01 Aug 2018 at 10:35:32 (+0200), Rafael J. Wysocki wrote: > > On Wed, Aug 1, 2018 at 10:23 AM, Quentin Perret wrote: > > > On Wednesday 01 Aug 2018 at 09:32:49 (+0200), Rafael J. Wysocki wrote: > > >> On Tue, Jul 31, 2018 at 9:31 PM, wrote: > > >> >> On Monday 30 Jul 2018 at 12:35:27 (-0700), skannan@codeaurora.org wrote: > > >> >>> If it's going to be a different aggregation from what's done for > > >> >>> frequency > > >> >>> guidance, I don't see the point of having this inside schedutil. Why not > > >> >>> keep it inside the scheduler files? > > >> >> > > >> >> This code basically results from a discussion we had with Peter on v4. > > >> >> Keeping everything centralized can make sense from a maintenance > > >> >> perspective, I think. That makes it easy to see the impact of any change > > >> >> to utilization signals for both EAS and schedutil. > > >> > > > >> > In that case, I'd argue it makes more sense to keep the code centralized in > > >> > the scheduler. The scheduler can let schedutil know about the utilization > > >> > after it aggregates them. There's no need for a cpufreq governor to know > > >> > that there are scheduling classes or how many there are. And the scheduler > > >> > can then choose to aggregate one way for task packing and another way for > > >> > frequency guidance. > > >> > > >> Also the aggregate utilization may be used by cpuidle governors in > > >> principle to decide how deep they can go with idle state selection. > > > > > > The only issue I see with this right now is that some of the things done > > > in this function are policy decisions which really belong to the governor, > > > I think. > > > > Well, the scheduler makes policy decisions too, in quite a few places. :-) > > That is true ... ;-) But not so much about frequency selection yet I guess Well, sugov is part of the scheduler :-) It being so allows for the co-ordinated decision making required for EAS. > > The really important consideration here is whether or not there may be > > multiple governors making different policy decisions in that respect. > > If not, then where exactly the single policy decision is made doesn't > > particularly matter IMO. > > I think some users of the aggregated utilization signal do want to make > slightly different decisions (I'm thinking about the RT-go-to-max thing > again which makes perfect sense in sugov, but could possibly hurt EAS). > > So the "hard" part of this work is to figure out what really is a > governor-specific policy decision, and what is common between all users. > I put "hard" between quotes because I only see the case of RT as truly > sugov-specific for now. > > If we also want a special case for DL, Peter's enum should work OK, and > enable to add more special cases for new users (cpuidle ?) if needed. > But maybe that is something for later ? Right, I don't mind moving the function. What I do oppose is having two very similar functions in different translation units -- because then they _will_ diverge and result in 'funny' things.