Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2370802imm; Mon, 28 May 2018 06:55:22 -0700 (PDT) X-Google-Smtp-Source: AB8JxZokvVp1gKF7CUIXYrTzGnSKEfcTqOs7LE5BFnuyLCVwmeQie9VdmoH8+9BnvHdaJmB3nZtP X-Received: by 2002:a17:902:1aa:: with SMTP id b39-v6mr13824574plb.120.1527515722457; Mon, 28 May 2018 06:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527515722; cv=none; d=google.com; s=arc-20160816; b=SVZmXbiKH55vB0PrFUVypIJ5XqF/88y4vu9hlJkMv1OV8o5TOFU/PEY3WrHVCJFbY9 Q6SFaCoV/5zJ2vgkQviA9SPpwNJpQSeGYsA/fESngX+W/WIjp6Ehd61qXnY2B5akpynl jov6Rk6MdwpqzbhGT/LtS56m+nzwJC0QxN7GEiGntPZfBYlPlpNfGD4eKbakgmGbayw8 cwUSOAcdJo2T2eFFZkca91R5WqPXXhy7DPZeAA6M8Fuaola7M9pl+6PekMrh8ZZp+Pt2 4CoTHZ4/iZCnCIhsc+vtl6h7+lmiP2eIeyORY0HAQDv8Y4R1KJADPRbd3MthwN8hRJbX RIvA== 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:arc-authentication-results; bh=2MZK/8JYl6TM98mu+ovANf2mvcxkOuHCTxnDVyqAVrM=; b=bRYEVzFa/GcZ6lLXzmGEFU3Zdkf2ncjhPbKbTROCEsz6xId3FMXwG6kMf93SNLx9lF m5HNW4UrSb1le8oPKQ0qYpdHrGtbUlyN0dLu1kuAhcdEAfFE47WQvHmwDXqO4GzbPTxJ IKFl3g+K9ARLdJEOEf59g2TpPvoU+jMXFT9LP8i3m1q8HNCP41yJssH5Upw8+zuKMzNi W/qEiqKG+tZ0ogxqN9oNbs8wxrJpkx1cdkh8KupDkU/ACH4xWNbZNq3qsFHWmZvR9lRF eQwDF3QBf+rcXCFTlncTpg7kq62C1CnfyLDvsaZAqx6q7qmdiCbKtKMIEfhxcrwZ7DPB bZrQ== 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 f89-v6si3228451pff.208.2018.05.28.06.55.07; Mon, 28 May 2018 06:55:22 -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; 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 S939266AbeE1NyK (ORCPT + 99 others); Mon, 28 May 2018 09:54:10 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37384 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162961AbeE1Klb (ORCPT ); Mon, 28 May 2018 06:41:31 -0400 Received: by mail-wm0-f66.google.com with SMTP id l1-v6so30898323wmb.2 for ; Mon, 28 May 2018 03:41:31 -0700 (PDT) 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=2MZK/8JYl6TM98mu+ovANf2mvcxkOuHCTxnDVyqAVrM=; b=AD8tJiLZR7J3YnTI8B0VZjFKKrpdYmD/hvivSett3f5DkZWqu5fCrcE0xcHOw65U5l FgQUCHxWrZrWtr4Xh7DaJg4klVzNIIzHFW4rpfi2zBfxC51USj4lLu6M4nXU4UNXZ1uj rA009i3/Lf8Y4XkNp+8ouwJiRHJ8JLTJbWZDDDBMpl4+jp7Ex1+L7FWP6/lt0cUJ1u8h xuVBQAtoiAvF/VbKCyo3v18am9az05noevX85VdAP0SRFB2iTAKj9KK+mtRKljoh0L0q dRXxXDVUlk6UEOxttouCbLKLDnXWfbGNKdVum7RYw9MLJv06x/RQ86PTRXFY27x4v2u7 D2Tg== X-Gm-Message-State: ALKqPwfpwALtcWwdKB5Ry+ITr8BRxMWhNj30wKF1OITmbvnB+yLnKy14 Z4NzJ+oexR1Z8YwOIWTJfd/mhTA8+so= X-Received: by 2002:a1c:e182:: with SMTP id y124-v6mr9147407wmg.57.1527504090394; Mon, 28 May 2018 03:41:30 -0700 (PDT) Received: from localhost.localdomain ([151.15.207.242]) by smtp.gmail.com with ESMTPSA id m134-v6sm13472288wmg.13.2018.05.28.03.41.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 May 2018 03:41:29 -0700 (PDT) Date: Mon, 28 May 2018 12:41:27 +0200 From: Juri Lelli To: Vincent Guittot Cc: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, rjw@rjwysocki.net, dietmar.eggemann@arm.com, Morten.Rasmussen@arm.com, viresh.kumar@linaro.org, valentin.schneider@arm.com, quentin.perret@arm.com Subject: Re: [PATCH v5 08/10] cpufreq/schedutil: take into account interrupt Message-ID: <20180528104127.GB1293@localhost.localdomain> References: <1527253951-22709-1-git-send-email-vincent.guittot@linaro.org> <1527253951-22709-9-git-send-email-vincent.guittot@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1527253951-22709-9-git-send-email-vincent.guittot@linaro.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vincent, On 25/05/18 15:12, Vincent Guittot wrote: > The time spent under interrupt can be significant but it is not reflected > in the utilization of CPU when deciding to choose an OPP. Now that we have > access to this metric, schedutil can take it into account when selecting > the OPP for a CPU. > The CPU utilization is : > irq util_avg + (1 - irq util_avg / max capacity ) * /Sum rq util_avg IIUC the code below you actually propose that util = [(max_cap - util_irq) * util_rq] / max_cap + util_irq where util_rq = /Sum rq util_avg util_irq = irq util_avg So, which one is what you have in mind? Or am I wrong? :) [...] > static unsigned long sugov_aggregate_util(struct sugov_cpu *sg_cpu) > @@ -190,9 +192,17 @@ static unsigned long sugov_aggregate_util(struct sugov_cpu *sg_cpu) > if (rq->rt.rt_nr_running) { > util = sg_cpu->max; > } else { > + /* Sum rq utilization*/ > util = sg_cpu->util_dl; > util += sg_cpu->util_cfs; > util += sg_cpu->util_rt; > + > + /* Weight rq's utilization to the normal context */ > + util *= (sg_cpu->max - sg_cpu->util_irq); > + util /= sg_cpu->max; > + > + /* Add interrupt utilization */ > + util += sg_cpu->util_irq; Thanks, - Juri