Received: by 10.223.185.116 with SMTP id b49csp2259198wrg; Sun, 4 Mar 2018 22:51:53 -0800 (PST) X-Google-Smtp-Source: AG47ELuUwiTD0NhxCxFeipF4i2roLog1WOlA6R+SsXB6daVQxi+pV/2qLQOYKHzumkbRdIlTLV49 X-Received: by 10.167.129.24 with SMTP id b24mr14277335pfi.183.1520232712967; Sun, 04 Mar 2018 22:51:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520232712; cv=none; d=google.com; s=arc-20160816; b=jip5uW1rCMdk1MuyyJ/suLjOZYCeIifzZ/wvoxylOxG9CgtTjpJTstZ73BtUjPRWYZ drQFMALwHrI5ZokyVmSexBChBbyU1IWcOEanZC05kSyz05qwexwWHVfgsTGL9hfnFEgP pIOtEORyH6PqW9vGD1AHN4Dg2mb/AafLRsjiGeXVxltfoKQpFCxOY5g6KLRcJb6pXLsO M79CZqJxKcMbpIy1p8zK5GWQZPemMHv/zXQ5iS/N9nFwaFly19ULetHTV4kvmwYLns8F X5priLr3Q9SO4o9Rui43QerD2AXw7vXokd6P8Z1N1xsu8HcvGvMcuCRF8yGgqrllt+ZR 79Qg== 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=lx/3rHTQVw3NeLXIpPjNsHf+2XHZLPlWPj8KqeU63UA=; b=RhprZJLnrEiBIKZJpm67vt4VgoNl/AuzU5r1HGHUWdR/AlWo+3C3Un7vzefQ7CDhRK FEtFNeSjfNf/KGCyoyefQgIec0YKelPAUg/9ZkNdqpqtjvv+PLKOrZbxtQ/5fwA9Za9y ySS9fQxe7vTbfCbh7O1yp8mxjAqsUtuLYAMlaU5pt2qErEZLcJftGGGzC14cRGmzuUTT Jfm/ZXjcqzfVureWL0wDD50swJkcbq15e6CXCOXhA2tS9i4cKYZr4SfN0Mu75DiyG9pN HH/JA/iZ08aKcprMkTgF74lLOYXvebmZ4uhc4oVW1rCc9d/9AEod528qpfBHWVN5BvIm xN8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J5DZN5jJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si7936821pgf.93.2018.03.04.22.51.38; Sun, 04 Mar 2018 22:51:52 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b=J5DZN5jJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932871AbeCEGNz (ORCPT + 99 others); Mon, 5 Mar 2018 01:13:55 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:38871 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932522AbeCEGNw (ORCPT ); Mon, 5 Mar 2018 01:13:52 -0500 Received: by mail-pl0-f67.google.com with SMTP id m22-v6so5604072pls.5 for ; Sun, 04 Mar 2018 22:13:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lx/3rHTQVw3NeLXIpPjNsHf+2XHZLPlWPj8KqeU63UA=; b=J5DZN5jJ6ltLvccW5N6/FAuhPFE7Kc2Vntn0WVG+PDRnRoKRUIcY/LOZ7DtcpNiEBC ncaONhRQX6QqOPfjtENgmxmygqhBw+MWMvm+gd//GiXMUaE7C/pGfpkcBcw2QYOefZfX 3mqpVFgeKSugOTdID8UFqZNOD1qIANrI2hZb0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lx/3rHTQVw3NeLXIpPjNsHf+2XHZLPlWPj8KqeU63UA=; b=jhRB1k8a9Wili7ylK/UAI6gUecwO8day6zPn2lvPI3EmzTK+qMrg2SphuXo2OphBTG 7zaSRhtPQRJCzyvSIxON73sy+P6Ky1OBWg5u/nTuIhJ2V6NRceids0uaHuiVgHrFKAcr Phh6+P2NhpBe6tRwWjvHNqT/XPEOdJc/UQriwv5geLgM0tQ9hp9TjuxoJr9tJR30bD1Z 81u4yW7qPbKtJsBZLg/YwFqwcP08AdY5AsJVik7jL7LtB5hJ8ILDkKkC6/YFff+xxTGq iw9uJhGQV6Bfw7XOzRrJA972OExCdc6vhx5go6HbjB9NQAu8+dbsOXsJalJifyBfjmR3 PPEw== X-Gm-Message-State: APf1xPAQ5/WEquQFsOKTmq6HAbSyi7uNSTzqpwMhSE8ksVYz+rDMURou /Ud6UCd6lk/BPPAk/CHzafP/gg== X-Received: by 2002:a17:902:22e:: with SMTP id 43-v6mr12207768plc.384.1520230432038; Sun, 04 Mar 2018 22:13:52 -0800 (PST) Received: from localhost ([223.226.75.205]) by smtp.gmail.com with ESMTPSA id t63sm25364286pfj.44.2018.03.04.22.13.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Mar 2018 22:13:51 -0800 (PST) Date: Mon, 5 Mar 2018 11:43:49 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Claudio Scordino , Peter Zijlstra , "Rafael J . Wysocki" , Ingo Molnar , Patrick Bellasi , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Vincent Guittot , Todd Kjos , Joel Fernandes , Linux PM , Linux Kernel Mailing List Subject: Re: [PATCH v2] cpufreq: schedutil: rate limits for SCHED_DEADLINE Message-ID: <20180305061349.GF23018@vireshk-i7> References: <1519815970-5686-1-git-send-email-claudio@evidence.eu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28-02-18, 12:22, Rafael J. Wysocki wrote: > On Wed, Feb 28, 2018 at 12:06 PM, Claudio Scordino > wrote: > > When the SCHED_DEADLINE scheduling class increases the CPU utilization, > > we should not wait for the rate limit, otherwise we may miss some > > deadline. > > > > Tests using rt-app on Exynos5422 with up to 10 SCHED_DEADLINE tasks have > > shown reductions of even 10% of deadline misses with a negligible > > increase of energy consumption (measured through Baylibre Cape). > > > > Signed-off-by: Claudio Scordino > > CC: Ingo Molnar > > CC: Patrick Bellasi > > CC: Dietmar Eggemann > > CC: Morten Rasmussen > > CC: Juri Lelli > > CC: Viresh Kumar > > CC: Vincent Guittot > > CC: Todd Kjos > > CC: Joel Fernandes > > CC: linux-pm@vger.kernel.org > > CC: linux-kernel@vger.kernel.org > > --- > > Changes from v1: > > - Logic moved from sugov_should_update_freq() to > > sugov_update_single()/_shared() to not duplicate data structures > > - Rate limit not ignored in case of "fast switch" > > I'm not sure about this last bit. > > IMO you can set sg_policy->need_freq_update even in the "fast switch" > case to start with and special case it in the future if that turns out > to be problematic. That is, unless you have data indicating that it > already is problematic, of course. :-) > > > --- > > kernel/sched/cpufreq_schedutil.c | 16 ++++++++++++++++ > > 1 file changed, 16 insertions(+) > > > > diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c > > index 7936f54..ca6ce72 100644 > > --- a/kernel/sched/cpufreq_schedutil.c > > +++ b/kernel/sched/cpufreq_schedutil.c > > @@ -273,6 +273,14 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, > > sugov_set_iowait_boost(sg_cpu, time); > > sg_cpu->last_update = time; > > > > + /* > > + * Make sugov_should_update_freq() ignore the rate limit when DL > > + * has increased the utilization. > > + */ > > + if ((cpu_util_dl(cpu_rq(sg_cpu->cpu)) > sg_cpu->util_dl) && > > + !(sg_policy->policy->fast_switch_enabled)) > > + sg_policy->need_freq_update = true; > > + And a new routine for this block would be good as well. -- viresh