Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2269447imm; Mon, 28 May 2018 05:07:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK5wwfWZhlBV9oXO8RNXfm8NBLDKwXrHE0YUSTPNCJR5P77DGFpcV+YjU0u5M6asu7ow9GX X-Received: by 2002:a62:3f4f:: with SMTP id m76-v6mr914671pfa.109.1527509256100; Mon, 28 May 2018 05:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527509256; cv=none; d=google.com; s=arc-20160816; b=Cq7HAQV2ixTWJNLtwIFsybheRvzs6fhpz+FwJYa43y8lB+sJp97o7T9hiVNvlUgo2D lsecq/i+2XwLFCfG5RrzmQWXRWqM20BZWUTehbV/xlUARy/G9rop+dPOZt0tMnaUvBGB qdwXQcFRAbQQ+9UHLpnkJbq0V9YX+YP2dVf5PZOou5XtKuJTymQ+jsTyw21pdqjs7kxS 36GRS9EvI6YGsbLbNQcw+HzEp5tpDOE2QU+NCjJSAyzWlNL/lR21aubixw1mzqBk19t+ dOy3NmJsfBAlLvBQwa5YMpgv6awWZZDBQ4+sPpjiE77o3n/Azt2KukhJTTDEND7v3Nxn o8/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=fMB2ydb+UdKv+ak+oY2SIYgIIkHQTRSmCLL685nMuZ4=; b=h5KZAWvCHfbdSaHwQrc0n9qSdLWVVxhPKhSDkExSyzKjdDP4mwYHW6lm1O+YUmmXhh 6/l1dEmUFFW79Lxpw5w/EK5Bt/ddQ5nNcn69IIhV1AxVq5Q830FxBXzRCcS81CLzgg3C 4snudc5tzIDmqZFU8ZrIKeiWjHqMBPuI9sgUiwoMlSX27v2iJNwtft6X4mVuZx+UTqt/ inAY8Fu+i1C7RZfvZjxtMvbblwg+XmJl9abjsu7SWiJk3qvpC/0ZqDXJL4MWJVgjV/ek BgGfwghot0js65zTLUIUc9jJ+o0xonRff4lCywXeCgdv/TWX03j03vzCg1g+lPu+wMHz XInQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZU/O+K8u; 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 t9-v6si11737027pgf.359.2018.05.28.05.07.21; Mon, 28 May 2018 05:07:36 -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=ZU/O+K8u; 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 S938617AbeE1MGa (ORCPT + 99 others); Mon, 28 May 2018 08:06:30 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:36656 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938528AbeE1MGX (ORCPT ); Mon, 28 May 2018 08:06:23 -0400 Received: by mail-io0-f196.google.com with SMTP id d73-v6so13804399iog.3 for ; Mon, 28 May 2018 05:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fMB2ydb+UdKv+ak+oY2SIYgIIkHQTRSmCLL685nMuZ4=; b=ZU/O+K8uLNlpK87A7rrIVSAQCdmGDV3StyS8l4iMvm5WGin78rzhpmKyEAD2fJGPsk 02J/quS7blRR1gH9EvorzE7p102Oy2AW7m77UICJRMhG1TxPsZwr0cLfdv1utQYubVie P1+xhjPUKQPXAfugbDAHTmrHaKIrpFe6gsjFY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fMB2ydb+UdKv+ak+oY2SIYgIIkHQTRSmCLL685nMuZ4=; b=GMVew437q9cMiPJ141QvO9vgWOXhzeKiQgUCnMCQPYDF8Q+d3vMq7fGxUE0EpqDI0q Wc4e2ayCbVC/MQOKyPA4V4bUyYpT7N6BkAPPKtD1EcjGogYwrHKRmamAGTeFtZF+Z8bp ovYBC7pj2eg+8Oap6x6ZGM7eMkvVHwwd7LrU4b32twESIYGYjGL/JqFyLr69hF0vz3Yc 4Q6W1pimRBbFuRAfCgMeiXWWgz/vuoeqWzU7mjKbLX7/mnymJq2JlmPiejLVR/dwpNsO P1BU457X0iQCLBJEfGQUhfvNliGhnXuNBOU4c+DqZ5gUNYb4A9cjiaSmDsiShey7xlML 5pRw== X-Gm-Message-State: ALKqPweIN2hLUyGIg0XErs5RXMGyMC/Uyn6PNrNnkGiobogyxTOlQ32E HrcsFbvyybRIIt1+huRfNVuqgQzORTQZJjHJzXC4wQ== X-Received: by 2002:a6b:c88c:: with SMTP id y134-v6mr579219iof.295.1527509182718; Mon, 28 May 2018 05:06:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:4cc:0:0:0:0:0 with HTTP; Mon, 28 May 2018 05:06:02 -0700 (PDT) In-Reply-To: <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> <20180528104127.GB1293@localhost.localdomain> From: Vincent Guittot Date: Mon, 28 May 2018 14:06:02 +0200 Message-ID: Subject: Re: [PATCH v5 08/10] cpufreq/schedutil: take into account interrupt To: Juri Lelli Cc: Peter Zijlstra , Ingo Molnar , linux-kernel , "Rafael J. Wysocki" , Dietmar Eggemann , Morten Rasmussen , viresh kumar , Valentin Schneider , Quentin Perret Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Juri, On 28 May 2018 at 12:41, Juri Lelli wrote: > 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? :) mmh ... aren't they equal ? util = [(max_cap - util_irq) * util_rq] / max_cap + util_irq util = [(max_cap/max_cap - util_irq/max_cap) * util_rq] + util_irq util = [(1 - util_irq/max_cap) * util_rq] + util_irq util = util_irq + [(1 - util_irq/max_cap) * util_rq] > > [...] > >> 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