From patchwork Fri May 25 13:12:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 136868 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3575256lji; Fri, 25 May 2018 06:14:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoo7Syeb0fenUZ+Rtr0wcqwXWrekHHbla1+1WLoQv4BzR3nrvBC2zE4l4bVVmJMKaHhaJe4 X-Received: by 2002:a65:4bca:: with SMTP id p10-v6mr2022612pgr.114.1527254069755; Fri, 25 May 2018 06:14:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527254069; cv=none; d=google.com; s=arc-20160816; b=z4011lmTeQTW1rVUe9x+0uTb7ZClAuHkOEg3IOlsqjvS2sPdZi7rYWM23/tYb+h/eR Vr54JbCWu/LegyXQsk1A0WL6wBVBGFMPFZPqihEIif5FesWslKT/MK9T8B6Ag4PmPRUb 7eEYgXqR2ursk3g84k2wKJEG2CFvoMKdRtHHzUE4BMag8ehjPXERldvQDS1PCNvz8k81 4nMqILNO3QxD8RlhT0Fx1dUVpoqyLvoSiI1BoiIwDAjCPJLs5KcLpggsKg7dekQJJ8bS Ot/BjEkRJxPD/ZtPIxc1RAmcE5fZrPmJo9pT4bZH0p9ydWu/VF6WWGYyYbm50uGQWp4a IztA== 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:dkim-signature:arc-authentication-results; bh=HRWh2tpoy3DrXYcep0C0qBFSjSwqlWGhIY8YTPoAWHM=; b=lSCQzhyhyMECJv6PmRT+ZC61QWzKkc2OPPOYCENbbcbDLE5+bJlz+movCx/NQ7PZxa ofRLRK+V5B0fvag94Xaj+1PbbW2C9S11PySnZEf4ZXlaAEUUL5tESugMuvK5qlj5TEoS FGq++HNIEzKkgoaWYB40kTtgrKN7Co9W2aRvEETG6lQ4MrtFYl/1UvK8QjA5njx0FIC5 rQDQk1/Y6A+lUBuHcZrqjXO0462btVHXICpr7JLlIAYj9yJ+MgxC2sxA6UtQA8CV4wM5 9N1vDHgsqgD3wGlhtwZZz7p0Oj72CL1ETQGo3ypNWmuGQXDDG5uuv7Od6HeuMFP7/IXd cY3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e5mwVGfK; 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 24-v6si23684865pfr.242.2018.05.25.06.14.29; Fri, 25 May 2018 06:14:29 -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; dkim=pass header.i=@linaro.org header.s=google header.b=e5mwVGfK; 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 S936150AbeEYNO1 (ORCPT + 30 others); Fri, 25 May 2018 09:14:27 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:38705 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934595AbeEYNMq (ORCPT ); Fri, 25 May 2018 09:12:46 -0400 Received: by mail-wm0-f65.google.com with SMTP id m129-v6so14460460wmb.3 for ; Fri, 25 May 2018 06:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HRWh2tpoy3DrXYcep0C0qBFSjSwqlWGhIY8YTPoAWHM=; b=e5mwVGfKJ3CCMK5+lsN3glPQyDt0FRmGR38wdpNnbX6rz2wK2CHXLX4czXlmMkdVWx f12iZ80eJiZFM5Ic7fPRloVYQt9/bFs3+LEqA7iJnr/jL2zhDM2wG03JWB32KtrDIVpG 2dOUP0SBv0687uXZsAIbYqPSexAJfcmTqsevE= 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=HRWh2tpoy3DrXYcep0C0qBFSjSwqlWGhIY8YTPoAWHM=; b=Ypr+bHaUIRRnINgr+HxZT9d/M4W+WTjxfipwkEcyLtiwiGcGSmY+s6fhM6gBDUY44X gdrKno9HvdxpyIw6B2/R7dcRDIppV8PRX3A8gIS6otXHNWYZarv3GOhceICHjq0/q21H cAmjkg7xM0LAOhrmzTbIN9f/2vF85aUlOXTG2X6vQmwAiYMfTRo5G+0pDXlTkAlmzliY 5h5r1+dwhyrKBmtfKxZCpE/C7IsLDPn2vv/LES5Vfl0swv+54Obt8LZpi+T+OVNXpoEe Oz/ECkuOciiTCojkcdvseqxgBJ/N1YkSof1yEGIu7ZdCSeiRVaRHLINlqgKQ2QC4VCeB SPrg== X-Gm-Message-State: ALKqPwdTmrjgbVFGrIjRA1gkUDeM2xg/F7uUeAopn/M11Bo3JVdk7mA3 H3coFchInn4fjnyc91DxWrRqsAUiauo= X-Received: by 2002:a1c:340f:: with SMTP id b15-v6mr1574544wma.129.1527253964970; Fri, 25 May 2018 06:12:44 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:a860:64b4:335b:c763]) by smtp.gmail.com with ESMTPSA id 4-v6sm9690948wmg.8.2018.05.25.06.12.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 06:12:44 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, rjw@rjwysocki.net Cc: juri.lelli@redhat.com, dietmar.eggemann@arm.com, Morten.Rasmussen@arm.com, viresh.kumar@linaro.org, valentin.schneider@arm.com, quentin.perret@arm.com, Vincent Guittot Subject: [PATCH v5 05/10] cpufreq/schedutil: get max utilization Date: Fri, 25 May 2018 15:12:26 +0200 Message-Id: <1527253951-22709-6-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527253951-22709-1-git-send-email-vincent.guittot@linaro.org> References: <1527253951-22709-1-git-send-email-vincent.guittot@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that we have both the dl class bandwidth requirement and the dl class utilization, we can use the max of the 2 values when agregating the utilization of the CPU. Signed-off-by: Vincent Guittot --- kernel/sched/sched.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 4526ba6..0eb07a8 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2194,7 +2194,11 @@ static inline void cpufreq_update_util(struct rq *rq, unsigned int flags) {} #ifdef CONFIG_CPU_FREQ_GOV_SCHEDUTIL static inline unsigned long cpu_util_dl(struct rq *rq) { - return (rq->dl.running_bw * SCHED_CAPACITY_SCALE) >> BW_SHIFT; + unsigned long util = (rq->dl.running_bw * SCHED_CAPACITY_SCALE) >> BW_SHIFT; + + util = max_t(unsigned long, util, READ_ONCE(rq->avg_dl.util_avg)); + + return util; } static inline unsigned long cpu_util_cfs(struct rq *rq)