Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2403520imm; Tue, 4 Sep 2018 04:00:58 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdblv2dXaKko8v7T8KSJFcLHEngFQ77sfloZn8rlQZnWBt2ZnMNtCIZu5E/j2PteLJyiaJdS X-Received: by 2002:a17:902:7c07:: with SMTP id x7-v6mr31751622pll.113.1536058858019; Tue, 04 Sep 2018 04:00:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536058857; cv=none; d=google.com; s=arc-20160816; b=n2tdiCwsk0YIXOAdT11vyZo4KuOnvsHENEYX6Pc4Z3vBsaiHYIQbVdOTiSHVNT3V4e uoB8fhvNIHHXeMHJQ2RbIX2yPusauBx2TqeSuhimOv1BSCLXKfmtysrFu6JalIy3c9NT TieK5uuNNRZh6JU4ZypYQRy+Z5IBk3B3jt27AQ9W8wsx7/5tHImcj5yKPWHMcAcBLesl Mf/7P2KLJs5uSUS3F7SwTtmmEIU61u3Jra1U0aeGEbNYN8xVzqFADLM4Z0iFC8V6Vdab ECpwAyUQOqzt7jcWS7mIX7ciBfWujdszR2j8XFD2GoVhyjAlcGfvnVvRQre+lX4Nwk5B huEA== 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:arc-authentication-results; bh=QdhKeWNGch54HItMyIfAJEp26rr3a+qKfUWiMwo7ouA=; b=Tj9hMeUPop8IrwvBRApfy1P8f23L80dOARg4ffNYcw0/gCAk6EDjc/vkZqVu/G7fcs vrwiRzwZuRwBeG6yD9nSaD1p77IrzKamG0aNEc7UCnd6adPqMCeyUhjsNjBbOOHkE+qT gUmBaYc3G09yGK/6PzZZdieWitptNfF0Zultu9g/hMr74Qn828ZdZZaXgzkDq8bt41EY a86VECuJRZUkT8GL4CN+/0rmpjt0w1iYnP4FMMgJQYdp4kf3t4V8SMB1HSL4G2lT40Vf Kl2F/ugRw4o45VI9SBIIBiSdgpptFQeGDSG0rblCo80CMiRjCpdj9BLybX2f7D1W2HN/ uB+g== ARC-Authentication-Results: i=1; mx.google.com; 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 i9-v6si500760pgk.403.2018.09.04.04.00.42; Tue, 04 Sep 2018 04:00:57 -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; 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 S1727355AbeIDPXz (ORCPT + 99 others); Tue, 4 Sep 2018 11:23:55 -0400 Received: from foss.arm.com ([217.140.101.70]:40686 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727024AbeIDPXz (ORCPT ); Tue, 4 Sep 2018 11:23:55 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1A6197A9; Tue, 4 Sep 2018 03:59:17 -0700 (PDT) Received: from queper01-lin (queper01-lin.emea.arm.com [10.4.13.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 255B33F5BC; Tue, 4 Sep 2018 03:59:13 -0700 (PDT) Date: Tue, 4 Sep 2018 11:59:08 +0100 From: Quentin Perret To: peterz@infradead.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: gregkh@linuxfoundation.org, mingo@redhat.com, dietmar.eggemann@arm.com, morten.rasmussen@arm.com, chris.redpath@arm.com, patrick.bellasi@arm.com, valentin.schneider@arm.com, vincent.guittot@linaro.org, thara.gopinath@linaro.org, viresh.kumar@linaro.org, tkjos@google.com, joel@joelfernandes.org, smuckle@google.com, adharmap@codeaurora.org, skannan@codeaurora.org, pkondeti@codeaurora.org, juri.lelli@redhat.com, edubezval@gmail.com, srinivas.pandruvada@linux.intel.com, currojerez@riseup.net, javi.merino@kernel.org Subject: Re: [PATCH v6 13/14] sched/topology: Make Energy Aware Scheduling depend on schedutil Message-ID: <20180904105906.t5i7twyyt2omc45b@queper01-lin> References: <20180820094420.26590-1-quentin.perret@arm.com> <20180820094420.26590-14-quentin.perret@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180820094420.26590-14-quentin.perret@arm.com> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 20 Aug 2018 at 10:44:19 (+0100), Quentin Perret wrote: > Energy Aware Scheduling (EAS) is designed with the assumption that > frequencies of CPUs follow their utilization value. When using a CPUFreq > governor other than schedutil, the chances of this assumption being true > are small, if any. When schedutil is being used, EAS' predictions are at > least consistent with the frequency requests. Although those requests > have no guarantees to be honored by the hardware, they should at least > guide DVFS in the right direction and provide some hope in regards to the > EAS model being accurate. > > To make sure EAS is only used in a sane configuration, create a strong > dependency on schedutil being used. Since having sugov compiled-in does > not provide that guarantee, extend the existing CPUFreq policy notifier > with a new case on governor changes. That allows the scheduler to > register a callback on this notifier to rebuild the scheduling domains > when governors are changed, and enable/disable EAS accordingly. > > cc: Ingo Molnar > cc: Peter Zijlstra > Signed-off-by: Quentin Perret > > --- > This patch could probably be squashed into another one, but I kept it > separate to ease the review. Also, it's probably optional as not having > it will not 'break' things per se. > > I went for the smallest possible solution I could find, which has the > good side of being simple, but it's definitely not the only one. > > Another possibility would be to hook things in sugov_start() and > sugov_stop(), but that requires some more work. In this case, it > wouldn't be possible to just re-build the sched_domains() from there, > because when sugov_stop() is called, the 'governor' field of the policy > hasn't been updated yet, so the condition (if gov == schedutil) in > build_freq_domains() doesn't work. > > To workaround the issue we'll need to find a way to pass a cpumask to > the topology code to specifically say 'sugov has been stopped on these > CPUs'. That would mean more code to handle that, but that would also > mean we don't have to mess around with the CPUFreq notifiers ... > > Not sure what's best, so all feedback is more than welcome. Hi, Does anybody have concerns with this patch ? Is it a reasonable option to use the CPUFreq notifiers in this case ? If there is anything I can do to ease the review please let me know. Also, is there any hope that the 12 first patches could make it in 4.20 on their own ? Or is it already too late ? Thanks, Quentin