Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3466244imm; Fri, 25 May 2018 06:16:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqTV7xnfbAQLd7lN4oTu6w/+BuR/x8dGotaYhJ62KZbN5ObzJAVNQkVe+sPyRKoGZylmqJ/ X-Received: by 2002:a17:902:b489:: with SMTP id y9-v6mr2610984plr.385.1527254195493; Fri, 25 May 2018 06:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527254195; cv=none; d=google.com; s=arc-20160816; b=xqL1WzZTmNRdhNEOO8bh3pwGIbqfUWVRYurvJnldn/cn7XyBjRrxLUI9TcPdxAcWVt KtTZttXhsGoNc7KQwBidtpmGXibjuWz/F/8F0X2M5a6VntDdgzACDaozZb15mcoYEnDw oKJxR/Be3h2iTSJVIcWvwXq/ucp02/o7PEYycGyhD5rmC334jnLLCFReCLc6pMaWXGjd D/59R6MF3GcUn5jiLbL1GMydDSxluNd3TW8EfiPrmraQnY01jsAWDR1lDMjM1AJtjwqE 9O2tyXJ9GRHMWDAnDDq6eFnEjl1mYdE3spJJF8q5TqnTmaySYPVrR+HcHi3gjnCaM/79 YMKA== 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 1-v6si23270442plo.20.2018.05.25.06.16.11; Fri, 25 May 2018 06:16:35 -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 S935983AbeEYNO1 (ORCPT + 99 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(-) 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) -- 2.7.4