Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1296387imm; Tue, 2 Oct 2018 06:08:49 -0700 (PDT) X-Google-Smtp-Source: ACcGV63f3hkxI4RMg9MNM4jE69kHpIEP3qjT+ZyI40yAc/kWA+iolf7Ur0Xp/jl7WWbjOvfrYKBw X-Received: by 2002:a17:902:2f43:: with SMTP id s61-v6mr16418721plb.176.1538485729597; Tue, 02 Oct 2018 06:08:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538485729; cv=none; d=google.com; s=arc-20160816; b=xSVwXiN9JYoaeL2g2I59idKG/MkFmx14+NA9c1GFK9oe9jbK4SU65ORgqD1HZAVvvZ Jh9JAdRmM340GjIaVtl3+IufSZpOidM8gFDbG7cQeEwd1JjvCKDCceTFZ3Vw5gGuvUED Lvu1RnNeXEFzUrtDj4Ep/JKhIIEj4AiVIlLQN+hfBZvHMnWy1G1E7CyK1fU0ZGMkJs81 uqT7w+YXUECh4DkyeGpEttajpX763DsWiYkFt+rydnp8ITOn+2VZb7TxWEyxc7N5IloB MVhwBzbwF9AerxgziJA9+RVY6ydd326XSrg1SC7qCrPRv0tWEF+77swOodFsV98R40XO WQqQ== 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; bh=QxNH3Fc9VZkc/A5t4s99Eh65TCQZ6XLNYHBuPEbEImY=; b=SiYqBtzGrQQWe8rDv0uSRw2Trktx4HLNlLlHLhr550aIP4Gvl+lbvaD9BuvQEZ0CE/ 4SH5GsF8z4mmS+QrwceRBQPOy4c2xpt5IxPznW1JiiUILmb1kxvjkJPSi6dQws/opMEQ kpN2smu8RtKWUAKsOEETnYNLNeRUYs9/VtlPEf4LbmPW4MuvXhghyoDP+NSjBJE0zbS+ 7sCtlfjhouh4rFHjmFU0dydMv8g7IaQM6B8doKT2QRprH+GGE2SVOcXivzYDYgSSjDWW FV88NGBmvn2pWZPrG5MLgso5Qn/ymUb5neh5klSL/1qA/njkt+Ftm6IHLzexh6lqQlzh VyuQ== 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 q16-v6si14465565pgb.18.2018.10.02.06.08.33; Tue, 02 Oct 2018 06:08:49 -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 S1727786AbeJBTvn (ORCPT + 99 others); Tue, 2 Oct 2018 15:51:43 -0400 Received: from foss.arm.com ([217.140.101.70]:36908 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727729AbeJBTvn (ORCPT ); Tue, 2 Oct 2018 15:51:43 -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 D8FFE7A9; Tue, 2 Oct 2018 06:08:26 -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 BBC1B3F5B7; Tue, 2 Oct 2018 06:08:22 -0700 (PDT) Date: Tue, 2 Oct 2018 14:08:21 +0100 From: Quentin Perret To: Peter Zijlstra Cc: rjw@rjwysocki.net, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, 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 v7 05/14] sched: Introduce a sched_feat for Energy Aware Scheduling Message-ID: <20181002130818.fciw7cmlwggymxrz@queper01-lin> References: <20180912091309.7551-1-quentin.perret@arm.com> <20180912091309.7551-6-quentin.perret@arm.com> <20181002123416.GA3439@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181002123416.GA3439@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 02 Oct 2018 at 14:34:16 (+0200), Peter Zijlstra wrote: > On Wed, Sep 12, 2018 at 10:13:00AM +0100, Quentin Perret wrote: > > In order to make sure Energy Aware Scheduling (EAS) doesn't hurt > > systems not using it, add a new sched_feat, called ENERGY_AWARE, > > guarding the access to EAS code paths. > > > > Signed-off-by: Quentin Perret > > --- > > kernel/sched/features.h | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/kernel/sched/features.h b/kernel/sched/features.h > > index 85ae8488039c..26ff6752e492 100644 > > --- a/kernel/sched/features.h > > +++ b/kernel/sched/features.h > > @@ -90,3 +90,10 @@ SCHED_FEAT(WA_BIAS, true) > > * UtilEstimation. Use estimated CPU utilization. > > */ > > SCHED_FEAT(UTIL_EST, true) > > + > > +/* > > + * Energy-Aware Scheduling. Whether or not tasks will be placed into an > > + * energy-aware fashion depends on this feature being enabled and on the > > + * root domain having an Energy Model attached. > > + */ > > +SCHED_FEAT(ENERGY_AWARE, false) > > So these are debug knobs.. I would expect there to be a regular > static_key that is controlled by the presence of EM data. Right, the issue I'm trying to solve with this is basically that _some_ users will want to have an EM for the thermal stuff, but they will want EAS disabled. Some people (not very many that's true, but still) use big.little and don't care much about energy ... So, there is a need for an EAS knob on the scheduler side. I don't mind it being something else than a sched_feat, but I couldn't see a better option. Another Kconfig (CONFIG_SCHED_ENERGY) ? A sysctl ? FWIW, the Android kernel has had an ENERGY_AWARE sched_feat since the very beginning of EAS. > Remember, if you compile with SCHED_DEBUG=n, this becomes a compile time > constant: false, and the compiler gets to do lots of DCE. Indeed, and what happens in the mobile market sometimes is that people play with those options as needed and then they put patches in their device kernels to change the defaults before compiling with !SCHED_DEBUG. I'd say it's not the worst kind of device-specific out-of-tree changes to Linux. That's debatable however Thanks, Quentin