Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp5062490pjb; Mon, 27 Jul 2020 11:57:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDWuPy6d1XxniyntYxRxr6ANki98Zlk73vhlPgFlyHNR+1nu5PSrNq7a9LqNoWreaKxXlS X-Received: by 2002:a17:906:3bd5:: with SMTP id v21mr17806127ejf.329.1595876277964; Mon, 27 Jul 2020 11:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595876277; cv=none; d=google.com; s=arc-20160816; b=uZB3NBwPCgbOT1F06AoR9JvbVI5BVPZ+kf909J/jvvvdtxJKibqn+FwMVpEyy17Vqe KXkK2mbACy2L1fp/pXjJ1oPRwSyOP5oz4hPP9eLKZhLb6oBKWX3WdUdSBbuyGZwHSQlV lwVrUnNzwbJcK5GV9d0bThZeuZG80tVoj6Yi14xhb5q13avtCDe/pDAHBLVWyYHrVLKE 6dxCwcckQEHA7S7iiZ7KetZSALGe99hxHi7RjcC9rEse9jBSu2nUdHr/RsF1EiUs0SHk SBvtCByhjHezh9w0n12w/9+lVJHlNpTqKAcMd3pWBtatkl1fZjr8v9+oYEZui0EqFn6y U02g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=A+HpA6fX2S/w+AUC5hMtWi2U+QhROjhakZg+pF9+ev8=; b=mVTV39ZVccA5IdUEDYWaNEZJoZn8Io7bCNjPHEsMqvVVhDdpqSvftfJ4+4bL2WFI10 lhPAWr2725QCacasFShu0ww+V59A5VHijh367XF6+p4Jn74loGUI3UJ3YyjHDHdqVJxo zuDpqOa+vJPjYEhsWjcnMxJFOIeeQbj92GgI2O1Vp98Z8B7k5hufHqfWZwpe3NMkW3xU tUDh6Oh4mEoa+zMEdkTHLP/HCNuhG5B/KpwZ7gmuBG8LeRdZM1r66b3MhGjYxb63q9WC PvygLutt/PA7nQ+0nlH6zFRHTRR6Vn//tfpwq6PQbPJeXISzNIzKRTK+uRQCV6hzENmD diWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z65si6047037ede.610.2020.07.27.11.57.35; Mon, 27 Jul 2020 11:57:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730501AbgG0RXi (ORCPT + 99 others); Mon, 27 Jul 2020 13:23:38 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:59756 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbgG0RXg (ORCPT ); Mon, 27 Jul 2020 13:23:36 -0400 Received: from 89-64-87-33.dynamic.chello.pl (89.64.87.33) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.415) id 52252b58e7e4f51e; Mon, 27 Jul 2020 19:23:33 +0200 From: "Rafael J. Wysocki" To: Francisco Jerez Cc: Srinivas Pandruvada , "Rafael J. Wysocki" , Linux PM , Linux Documentation , LKML , Peter Zijlstra , Giovanni Gherdovich , Doug Smythies Subject: Re: [PATCH] cpufreq: intel_pstate: Implement passive mode with HWP enabled Date: Mon, 27 Jul 2020 19:23:32 +0200 Message-ID: <1712943.Luj0Z5seXe@kreacher> In-Reply-To: <87h7u0h34t.fsf@riseup.net> References: <3955470.QvD6XneCf3@kreacher> <87h7u0h34t.fsf@riseup.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, July 22, 2020 1:14:42 AM CEST Francisco Jerez wrote: > > --==-=-= > Content-Type: multipart/mixed; boundary="=-=-=" > > --=-=-= > Content-Type: text/plain; charset=utf-8 > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > Srinivas Pandruvada writes: > > > On Mon, 2020-07-20 at 16:20 -0700, Francisco Jerez wrote: > >> "Rafael J. Wysocki" writes: > >>=20 > >> > On Fri, Jul 17, 2020 at 2:21 AM Francisco Jerez < > >> > currojerez@riseup.net> wrote: > >> > > "Rafael J. Wysocki" writes: > >> > >=20 > > {...] > > > >> > Overall, so far, I'm seeing a claim that the CPU subsystem can be > >> > made > >> > use less energy and do as much work as before (which is what > >> > improving > >> > the energy-efficiency means in general) if the maximum frequency of > >> > CPUs is limited in a clever way. > >> >=20 > >> > I'm failing to see what that clever way is, though. > >> Hopefully the clarifications above help some. > > > > To simplify: > > > > Suppose I called a function numpy.multiply() to multiply two big arrays > > and thread is a pegged to a CPU. Let's say it is causing CPU to > > finish the job in 10ms and it is using a P-State of 0x20. But the same > > job could have been done in 10ms even if it was using P-state of 0x16. > > So we are not energy efficient. To really know where is the bottle neck > > there are numbers of perf counters, may be cache was the issue, we > > could rather raise the uncore frequency a little. A simple APRF,MPERF > > counters are not enough.=20 > > Yes, that's right, APERF and MPERF aren't sufficient to identify every > kind of possible bottleneck, some visibility of the utilization of other > subsystems is necessary in addition -- Like e.g the instrumentation > introduced in my series to detect a GPU bottleneck. A bottleneck > condition in an IO device can be communicated to CPUFREQ It generally is not sufficient to communicate it to cpufreq. It needs to be communicated to the CPU scheduler. > by adjusting a > PM QoS latency request (link [2] in my previous reply) that effectively > gives the governor permission to rearrange CPU work arbitrarily within > the specified time frame (which should be of the order of the natural > latency of the IO device -- e.g. at least the rendering time of a frame > for a GPU) in order to minimize energy usage. OK, we need to talk more about this. > > or we characterize the workload at different P-states and set limits. > > I think this is not you want to say for energy efficiency with your > > changes.=20 > > > > The way you are trying to improve "performance" is by caller (device > > driver) to say how important my job at hand. Here device driver suppose > > offload this calculations to some GPU and can wait up to 10 ms, you > > want to tell CPU to be slow. But the p-state driver at a movement > > observes that there is a chance of overshoot of latency, it will > > immediately ask for higher P-state. So you want P-state limits based on > > the latency requirements of the caller. Since caller has more knowledge > > of latency requirement, this allows other devices sharing the power > > budget to get more or less power, and improve overall energy efficiency > > as the combined performance of system is improved. > > Is this correct? > > Yes, pretty much. OK