Received: by 10.223.176.5 with SMTP id f5csp204467wra; Thu, 8 Feb 2018 19:52:55 -0800 (PST) X-Google-Smtp-Source: AH8x225nXrls3gdPP0hapQ3qXc8JjZaX/2qiv38t5wRvZRY30A80cETpau4VPVxO1GBWNmM64bSO X-Received: by 2002:a17:902:8c89:: with SMTP id t9-v6mr1204420plo.2.1518148375398; Thu, 08 Feb 2018 19:52:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518148375; cv=none; d=google.com; s=arc-20160816; b=wnv+sbuzE3vzqeqRfjA4/Bij0HFoXJMK7hY67z5iYXHAGu7H9Dz6dEO/wpLrN25csv L/Z/W8U2npAau0r2m3yB2q5v0J2XKL422vK2c8z3/Yux0X/9ClvlWzGXI4G1oYdzxuJO 4QVxl5Z2JFkntTMrLI4L0GNKlrOPsuId9Z1CUkp6WfhlSzq5Sho3dY1bt09fr9+B+T0I DfvTjIwraPDqQAjFmOyNfndG2HtbU4/koE2ykyo8pDJHcTv7h6S9pVw4PpIKQ7ahXL8+ q7W5DxMRyAGV4NQM1k2mEK6sU7S8T1EdR1ThYMEnKWQnZjkbXtUzP1Vq/8XqcHAOKnxX pc3A== 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=dJXTinanM9nyOlJ0eLXnIPhIbXvRH0xPX0+md33eLQ4=; b=FQrb2CYHfVKsoJRErSGZZQXZm80YCY6M3qnyFIEsDQ1IJWzX7lWD+UDbI8K132Ft5P PneHRIXOibBMc4vHXxaXGq78KHCTh8WQRe1VBLC5ydnCTz706Cytw8LE1lkMN/cTku7i fm2Ej9WkfganKN8BBNIL10d8Ql/r+0gr/TDQZdCtm2htcYDeZBIHPAdNVp/V+8waH0Fd yG4YWaART8nm/rC20tyRWxZzJhjqGQqdPVJglfX/E9EywwS3cqMW/KKrDLQDZUEJEjyc m3OQPaeBc8zTOFyK0UBRaUvuKTS3L42M2IOyYy+Fn7PlzOD/Qy2i3eX1VUP8QCQh+47N 69Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ybv0Puwi; 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 n1-v6si951107pld.589.2018.02.08.19.52.41; Thu, 08 Feb 2018 19:52:55 -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=Ybv0Puwi; 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 S1752574AbeBIDvv (ORCPT + 99 others); Thu, 8 Feb 2018 22:51:51 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:35550 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752201AbeBIDvs (ORCPT ); Thu, 8 Feb 2018 22:51:48 -0500 Received: by mail-pl0-f68.google.com with SMTP id j19so904322pll.2 for ; Thu, 08 Feb 2018 19:51:48 -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=dJXTinanM9nyOlJ0eLXnIPhIbXvRH0xPX0+md33eLQ4=; b=Ybv0PuwiBmXpk/P4ZcAD2Q635EZP5oF+N+s6ahdXTe8spiyDVSiyLwx4qkvQZTirr0 xJn/WIF1agDc3sKGswjQ01Olf8whvfH0CLoQOsjpaQkhs1i/TLpmO3vLY76fQdRcDyjQ Dn0IWyvW0H8uJDfGAVZrYKr+A/qpxLHlCpPyc= 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=dJXTinanM9nyOlJ0eLXnIPhIbXvRH0xPX0+md33eLQ4=; b=UK2+YGzBaxek8loHrzKvUefGiaLQrpkKkY54l78xtuMt05H6OU5mnzxvVYJ4HOy7yy Tv0fRDFepb12iTS5CONcIjGZV1jZSYuBwM3n2QGxtxvBAwBjUjnrTV92Zki7LqwRrPMy GN6O6y3nzKy/b7XUPQCRmy92e9uSprW4rJPvTt2F6uLn937owC2zlGurF5xMKka3GvxD GaPZEb0S+ZZo+Pts/IQtYEZ59PLDKKd+vSFBtYpNBzHxV3/cy8o8kdZK06O6KjKW5+7n CvZzzFFrHwaPgBPWPWZ9dt1jWI01GwxhsrRgPe+lnfj7evRAoGMlXkxtwCmxNaIdeKD/ QKTA== X-Gm-Message-State: APf1xPBsRMgFY6uuRXSmca1rrWvs/Gsizc/DhiibHwuR0gPL7uvDS8L9 MG9qfFGyyntuhaANYD9e4GnOTg== X-Received: by 2002:a17:902:fa2:: with SMTP id 31-v6mr1266965plz.346.1518148308324; Thu, 08 Feb 2018 19:51:48 -0800 (PST) Received: from localhost ([122.172.61.199]) by smtp.gmail.com with ESMTPSA id t16sm1470319pgb.85.2018.02.08.19.51.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 19:51:47 -0800 (PST) Date: Fri, 9 Feb 2018 09:21:43 +0530 From: Viresh Kumar To: Claudio Scordino Cc: Peter Zijlstra , Ingo Molnar , "Rafael J . Wysocki" , Patrick Bellasi , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Vincent Guittot , Todd Kjos , Joel Fernandes , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpufreq: schedutil: rate limits for SCHED_DEADLINE Message-ID: <20180209035143.GX28462@vireshk-i7> References: <1518109302-8239-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: <1518109302-8239-1-git-send-email-claudio@evidence.eu.com> 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 08-02-18, 18:01, 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 have shown reductions of about 10% of deadline > misses for tasks with low RT periods. > > The patch applies on top of the one recently proposed by Peter to drop the > SCHED_CPUFREQ_* flags. > > Signed-off-by: Claudio Scordino > CC: Rafael J . Wysocki > 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 > --- > kernel/sched/cpufreq_schedutil.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) So the previous commit was surely incorrect as it relied on comparing frequencies instead of dl-util, and freq requirements could have even changed due to CFS. > diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c > index b0bd77d..d8dcba2 100644 > --- a/kernel/sched/cpufreq_schedutil.c > +++ b/kernel/sched/cpufreq_schedutil.c > @@ -74,7 +74,10 @@ static DEFINE_PER_CPU(struct sugov_cpu, sugov_cpu); > > /************************ Governor internals ***********************/ > > -static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time) > +static bool sugov_should_update_freq(struct sugov_policy *sg_policy, > + u64 time, > + struct sugov_cpu *sg_cpu_old, > + struct sugov_cpu *sg_cpu_new) > { > s64 delta_ns; > > @@ -111,6 +114,10 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time) > return true; > } > > + /* Ignore rate limit when DL increased utilization. */ > + if (sg_cpu_new->util_dl > sg_cpu_old->util_dl) > + return true; > + Changing the frequency has a penalty, specially in the ARM world (and that's where you are testing your stuff). I am worried that we will have (corner) cases where we will waste a lot of time changing the frequencies. For example (I may be wrong here), what if 10 small DL tasks are queued one after the other? The util will keep on changing and so will the frequency ? There may be more similar cases ? Is it possible to (somehow) check here if the DL tasks will miss deadline if we continue to run at current frequency? And only ignore rate-limit if that is the case ? > delta_ns = time - sg_policy->last_freq_update_time; > return delta_ns >= sg_policy->freq_update_delay_ns; > } > @@ -271,6 +278,7 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, > unsigned int flags) > { > struct sugov_cpu *sg_cpu = container_of(hook, struct sugov_cpu, update_util); > + struct sugov_cpu sg_cpu_old = *sg_cpu; Not really a big deal, but this structure is 80 bytes on ARM64, why copy everything when what we need is just 8 bytes ? -- viresh