From patchwork Mon Dec 4 10:23:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juri Lelli X-Patchwork-Id: 120504 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4245782qgn; Mon, 4 Dec 2017 02:25:28 -0800 (PST) X-Google-Smtp-Source: AGs4zMapsvygQqyIyvVCLf0npM44GJKZ66Zc2NsuDstJMmGS81CEn1l6EJRVbdNjdfTiW3z69okR X-Received: by 10.84.252.134 with SMTP id y6mr1515455pll.204.1512383128181; Mon, 04 Dec 2017 02:25:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512383128; cv=none; d=google.com; s=arc-20160816; b=K+4qUA9ujZT1G9AWHpJSKh10iaDVWye12J+hbYkTINDtQC75zrSuWx2ER99PHTArzG gybvl2V3KmPUldSJ+mmhu89lg1jN0qGvLnbn1rhHtcLzz+pyV0DJbm3y1IIilIHGYtWv PR3pMooVam5KLrs5bVkEpP5nCwRaH+aL4f11EHsX6AMhRQw+RctDffzHK1B+51dV7jMk FsizyYYtG9qcYYushZH6b7oLrCHXf1pQjG5swPiT/PxxOAtrygHGr9xv/rMvG7x4Pdqo 9e9V9yY0BIZ17x9E78LE0zikshcdkwBc+0MVIX7Om4wXKA8aq0ZiGp4Ol/W2qjSViAtb Opvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=z2h7d020JJrC/3LuYQE0dDc0DybZlP1ck+Qhh2DWIXc=; b=vsrnyeST01I2MdGTZWGz0x8pY7pT6Cr3wlxfGUP4AkSV+leEiHglcfVZ3Q/Mf3wxY/ o7zxfmST09xko295UeXNTG9Dx5wpt5byOWQHUIIRVerGNopcHn9y0GXHvcFvuWkjUGjR rkDcElM05k+Jb5C3+a3tUoFo5b6H//I9/hKmPBClRCJvaR7UeMb0goyxbERdbTNwVZRE gF7wk0+O9s33qSnyPt6JnIf7cNBjF0FeS8mWfXiVOGMhgoHclIms3EdmbAVG6NKOD9lo xr+6rK4Ro24tBfQV/MI0ChLx8ki+BSLcDYFvlc0y2A/i2s8S1j4UiAAnL8aUK9adS8Uy fl9Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si9123343pgq.658.2017.12.04.02.25.27; Mon, 04 Dec 2017 02:25:28 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753702AbdLDKYb (ORCPT + 28 others); Mon, 4 Dec 2017 05:24:31 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:43469 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753631AbdLDKYZ (ORCPT ); Mon, 4 Dec 2017 05:24:25 -0500 Received: by mail-wr0-f193.google.com with SMTP id z34so16636996wrz.10 for ; Mon, 04 Dec 2017 02:24:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z2h7d020JJrC/3LuYQE0dDc0DybZlP1ck+Qhh2DWIXc=; b=pdy9sqZKgYw3ZwflVJMyaz1kKVW4LxjboNlwUj38DeruksgOhAQc4wW025SOPIDPxS Y38T+dMm9QxzXCDY5jEWCGqHQDwrH7PNHw62TyVlnLM63uCYWGHVfFL2DegqsiENfv7O qXrIBtyRigE549LndVx/CujGZtSdi0S5LvTv3i7qEjgsKfTG9BpwWONYx/pv34kgNYBK CsO/1uyOLIZhMBDf9oTjU/P3SipoSPr93NzBj6Sw1oW0YM7rVfdgsY5slFRcMTX32GqS Et7GpUsoQJipmHuN97Hdq5EmyCXVr/QGglchddpkvq00bi4DSP5buiLwvhzLoSIQyz+T dekw== X-Gm-Message-State: AJaThX6A+ibDsbwwasMmuqumBj/yZi1Sbm7lHQsZe2xcetpNu0Kw1WOg F5u1smQYu4+k+jdawmcx9w3X+A== X-Received: by 10.223.175.49 with SMTP id z46mr12559022wrc.12.1512383063945; Mon, 04 Dec 2017 02:24:23 -0800 (PST) Received: from localhost.localdomain.com ([151.68.92.1]) by smtp.gmail.com with ESMTPSA id y2sm13542473wra.18.2017.12.04.02.24.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Dec 2017 02:24:23 -0800 (PST) From: Juri Lelli To: peterz@infradead.org, mingo@redhat.com, rjw@rjwysocki.net, viresh.kumar@linaro.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, tglx@linutronix.de, vincent.guittot@linaro.org, rostedt@goodmis.org, luca.abeni@santannapisa.it, claudio@evidence.eu.com, tommaso.cucinotta@santannapisa.it, bristot@redhat.com, mathieu.poirier@linaro.org, tkjos@android.com, joelaf@google.com, morten.rasmussen@arm.com, dietmar.eggemann@arm.com, patrick.bellasi@arm.com, alessio.balsini@arm.com, juri.lelli@redhat.com, Juri Lelli , Ingo Molnar , "Rafael J . Wysocki" Subject: [RFC PATCH v2 5/8] sched/cpufreq_schedutil: always consider all CPUs when deciding next freq Date: Mon, 4 Dec 2017 11:23:22 +0100 Message-Id: <20171204102325.5110-6-juri.lelli@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171204102325.5110-1-juri.lelli@redhat.com> References: <20171204102325.5110-1-juri.lelli@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Juri Lelli No assumption can be made upon the rate at which frequency updates get triggered, as there are scheduling policies (like SCHED_DEADLINE) which don't trigger them so frequently. Remove such assumption from the code, by always considering SCHED_DEADLINE utilization signal as not stale. Signed-off-by: Juri Lelli Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Rafael J. Wysocki Cc: Viresh Kumar Cc: Luca Abeni Cc: Claudio Scordino Acked-by: Viresh Kumar --- kernel/sched/cpufreq_schedutil.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) -- 2.14.3 diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index a3072f24dc16..b7a576c8dcaa 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -318,17 +318,21 @@ static unsigned int sugov_next_freq_shared(struct sugov_cpu *sg_cpu, u64 time) s64 delta_ns; /* - * If the CPU utilization was last updated before the previous - * frequency update and the time elapsed between the last update - * of the CPU utilization and the last frequency update is long - * enough, don't take the CPU into account as it probably is - * idle now (and clear iowait_boost for it). + * If the CFS CPU utilization was last updated before the + * previous frequency update and the time elapsed between the + * last update of the CPU utilization and the last frequency + * update is long enough, reset iowait_boost and util_cfs, as + * they are now probably stale. However, still consider the + * CPU contribution if it has some DEADLINE utilization + * (util_dl). */ delta_ns = time - j_sg_cpu->last_update; if (delta_ns > TICK_NSEC) { j_sg_cpu->iowait_boost = 0; j_sg_cpu->iowait_boost_pending = false; - continue; + j_sg_cpu->util_cfs = 0; + if (j_sg_cpu->util_dl == 0) + continue; } if (j_sg_cpu->flags & SCHED_CPUFREQ_RT) return policy->cpuinfo.max_freq;