Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3902785pxb; Tue, 26 Jan 2021 07:34:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTtr72+Shte0KH7tfpz1qpq9u/1TJm0yYyaA9ONuqp2DyBSR2zDvLb2zGPctaY/4942t+Q X-Received: by 2002:a17:907:1050:: with SMTP id oy16mr3704294ejb.424.1611675252847; Tue, 26 Jan 2021 07:34:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611675252; cv=none; d=google.com; s=arc-20160816; b=JrFR1Ot7TWD8pXlEvISLll19NaCvN0ecOU6JOAoiiv1HgQH5YdB9su7B6mEiC0mIXH xwFObwRKFwSSHTIiL/QV/rizgrT3AnWEbgi1Y8VIXrwbCTQ1XZ1uo/FzEZCRHcdBF9yy R05E66qgU4pzANTtIRpCRhuqmgK4KA+VhZxe1OPhYcCOuxAgzKD2KEGtr7qhU2GF5Y7k HNomjiAvTclMDUQMnkszTko4NHK1pUpEAUnCWjnEiSL8nq1rNrIBZ+U60v50HbbKrpNG BQ8PF6LUfkQSf0BX47v5GE/IvB99gawq2UPE69X3JZB/jtUCi9uckfgEUMCufWcvhT0z EmaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=doeavID+CVsZteh+vMgGhLdrVz3qhCJs1grCMuVfQuI=; b=N2aIG9W59adBZNI2AQxjHiAT1ekLeTit75ufl0PoXxMVmen8A7agQSRwnnplnzW4pT qhQE9NQEIvqr8qc/ANJla9Aju+b/V/13Yp5/bnjXDQ6Q99tXozwNymeBOiXL8jYXiqzQ pFt5N5HibLrL6Gt01W8QakUFcvZDvrLvheoTkfEZVAhq1ZCj5jpnoqSsjlffMrX/RqXP XmjZvU+a99S44gI0Dw/fAB2ZJagf9ia+vrviGm2XYW4tgwzHW52hBgXZwBnsXtfdS4iE 0cHkB8eJKOYO49Zt7D8JdhuEgrmvenkYWmOUwKPvenGistN3YlLYCE3m8E6PkI6OZWwH BDqg== 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 ec18si7243956ejb.166.2021.01.26.07.33.47; Tue, 26 Jan 2021 07:34:12 -0800 (PST) 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 S2406224AbhAZPaJ (ORCPT + 99 others); Tue, 26 Jan 2021 10:30:09 -0500 Received: from outbound-smtp32.blacknight.com ([81.17.249.64]:56364 "EHLO outbound-smtp32.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391257AbhAZJcv (ORCPT ); Tue, 26 Jan 2021 04:32:51 -0500 Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp32.blacknight.com (Postfix) with ESMTPS id A3C6BBEC6C for ; Tue, 26 Jan 2021 09:31:42 +0000 (GMT) Received: (qmail 27702 invoked from network); 26 Jan 2021 09:31:42 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 26 Jan 2021 09:31:42 -0000 Date: Tue, 26 Jan 2021 09:31:40 +0000 From: Mel Gorman To: Giovanni Gherdovich Cc: Peter Zijlstra , Borislav Petkov , Ingo Molnar , "Rafael J . Wysocki" , Viresh Kumar , Jon Grimm , Nathan Fontenot , Yazen Ghannam , Thomas Lendacky , Suthikulpanit Suravee , Pu Wen , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Michael Larabel , x86@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH v2 1/1] x86,sched: On AMD EPYC set freq_max = max_boost in schedutil invariant formula Message-ID: <20210126093140.GB3592@techsingularity.net> References: <20210122204038.3238-1-ggherdovich@suse.cz> <20210122204038.3238-2-ggherdovich@suse.cz> <1611652167.11983.65.camel@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1611652167.11983.65.camel@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 26, 2021 at 10:09:27AM +0100, Giovanni Gherdovich wrote: > On Mon, 2021-01-25 at 11:06 +0100, Peter Zijlstra wrote: > > On Fri, Jan 22, 2021 at 09:40:38PM +0100, Giovanni Gherdovich wrote: > > > 1. PROBLEM DESCRIPTION (over-utilization and schedutil) > > > > > > The problem happens on CPU-bound workloads spanning a large number of cores. > > > In this case schedutil won't select the maximum P-State. Actually, it's > > > likely that it will select the minimum one. > > > > > > A CPU-bound workload puts the machine in a state generally called > > > "over-utilization": an increase in CPU speed doesn't result in an increase of > > > capacity. The fraction of time tasks spend on CPU becomes constant regardless > > > of clock frequency (the tasks eat whatever we throw at them), and the PELT > > > invariant util goes up and down with the frequency (i.e. it's not invariant > > > anymore). > > > v5.10 v5.11-rc4 > > > ~~~~~~~~~~~~~~~~~~~~~~~~ > > > CPU activity (mpstat) 80-90% 80-90% > > > schedutil requests (tracepoint) always P0 mostly P2 > > > CPU frequency (HW feedback) ~2.2 GHz ~1.5 GHz > > > PELT root rq util (tracepoint) ~825 ~450 > > > > > > mpstat shows that the workload is CPU-bound and usage doesn't change with > > > > So I'm having trouble with calling a 80%-90% workload CPU bound, because > > clearly there's a ton of idle time. > > Yes you're right. There is considerable idle time and calling it CPU-bound is > a bit of a stretch. > > Yet I don't think I'm completely off the mark. The busy time is the same with > the machine running at 1.5 GHz and at 2.2 GHz (it just takes longer to > finish). To me it seems like the CPU is the bottleneck, with some overhead on > top. > I think this is an important observation because while the load may not be fully CPU-bound, it's still at the point where race-to-idle by running at a higher frequency is relevant. During the busy time, the results (and Michael's testing) indicate that the higher frequency may still be justified. I agree that there is a "a 'problem' between schedutil and cpufreq, they don't use the same f_max at all times", fixing that mid -rc may not be appropriate because it's a big change in an rc window. So, should this patch be merged for 5.11 as a stopgap, fix up schedutil/cpufreq and then test both AMD and Intel chips reporting the correct max non-turbo and max-turbo frequencies? That would give time to give some testing in linux-next before merging to reduce the chance something else falls out. -- Mel Gorman SUSE Labs