Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1877976pxb; Fri, 5 Feb 2021 03:51:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLPA/Y/MlpjZY3K5pWxfZ/RjYPzOBQtuJzGL2SUMAEfK0PrH8H2yhjDH2hbmdGBCFP3Uin X-Received: by 2002:a17:906:296a:: with SMTP id x10mr3670588ejd.240.1612525914316; Fri, 05 Feb 2021 03:51:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612525914; cv=none; d=google.com; s=arc-20160816; b=HHc+3Z1/zbq5+ifDbSEoBd/ccYpAM4kiRsszRP+Mla13tqF8byowTLjyMXuVCQbvz8 Y2sSOe5HtXssOrcECVxh/0HDIENatPtYG43lEv2DuzUrb+RhMX5I1xRMIyfH2USCXBxW 04byx7vTXvZtuLWt6LJShLwkPv1+QBvY7t2BUkJhJ5ULpNcyLvz3We8Jz7uF1dgNc5Tj SHM6GoicY2WzMlVVxAoGgq/w7IXwFHzXAYCvbvdu9Ylnfonr0W+4KTIz8ma2xrlx9H17 V7PezZG2y4IWylYCtcz4HSyigrB5Xw0NaiJJNz6UltXW4XNGwIXS1EbHmwfpUgcPKeZg NuCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=3JK9EvzwCGVkhzGsBky37d3E67X7MSmxNhi8zC0kctg=; b=r7beRZ7MxnZfz9cFWOli7gwVBQ//03nnI34C9fL1EgPN/BtVVmWy3yIiK6DqotGnRN l9WnrZdSH/XZKL/K/xsRA324CI1BFOBABRj5noAHAJvaDSz8yqmYu8rmh3dafKAvgWzV Ll5uEfearO8YCDDfPq9LCwVBfCkSsclSBmpVj3HZhARepyhOreFXDwXmQgiYuABKbt25 wKOcsHb9oZM7R4dwdzHIAXCumi4zJu20mGQpKZ0iU0VzHzzuPwLphbZOopMxhPfqU85/ jGmryZSb8/80Rq7tIVw/TfrEbalEOPECN2XMwr0LBDOHwk4qpcAq6TF+BGXRPJBwx49l YibA== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si5420645ejm.670.2021.02.05.03.51.29; Fri, 05 Feb 2021 03:51:54 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231455AbhBELsc (ORCPT + 99 others); Fri, 5 Feb 2021 06:48:32 -0500 Received: from mail-ot1-f51.google.com ([209.85.210.51]:45047 "EHLO mail-ot1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231649AbhBELnv (ORCPT ); Fri, 5 Feb 2021 06:43:51 -0500 Received: by mail-ot1-f51.google.com with SMTP id e70so6547132ote.11; Fri, 05 Feb 2021 03:43:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3JK9EvzwCGVkhzGsBky37d3E67X7MSmxNhi8zC0kctg=; b=EqwA+bQVfbQ1Vjy2xv1BKIkq+4Um+UKqYgVjdqNRmxC3f5hrW7G75qUuJoJ8XEPYy+ Ft0k2jDfZgNshf+ITRWe2B/0z2fZQ2TDecLtb3Pg9yUf0pjq2T/5tsJYm2LqjXCAgcZA 1d5hgfOnmveGtnerdEMn3Fvr7ukQmoYA2WbgMDWjtgonMbszXnOehSLX+T+d0mLLmsNT 4lI0XEIl8t1zQYyWjBRpEMaTGzXWWkIjgNC5JVuZnoCPgj83vsHRBnzbPArO1+6/UnNA vl5kOmEjP7ex1zmpX7mYjne7glbh8TwVbPGGpBfb4L8tVtkn9mkgna4Q/hpBR2Mv3m5X jZmQ== X-Gm-Message-State: AOAM532Ovgp3lqoXWEeUoEG9/N4B5bBcM87iOJ/5PMKOTRhChgFYH/i0 8EHLz7dWOEyL9Ha7rCvXR1gkTW00ADKUX9m4/PTVKLfc X-Received: by 2002:a9d:6acf:: with SMTP id m15mr3080068otq.260.1612525389212; Fri, 05 Feb 2021 03:43:09 -0800 (PST) MIME-Version: 1.0 References: <20210203135321.12253-1-ggherdovich@suse.cz> <20210203135321.12253-2-ggherdovich@suse.cz> <5470319.60Xv9dOaFs@kreacher> <563fec57-6417-e875-1788-3773cbfb34be@phoronix.com> <5ea06dbe-255c-3d22-b9bd-6e627c5f94af@phoronix.com> In-Reply-To: <5ea06dbe-255c-3d22-b9bd-6e627c5f94af@phoronix.com> From: "Rafael J. Wysocki" Date: Fri, 5 Feb 2021 12:42:54 +0100 Message-ID: Subject: Re: [PATCH v3 1/1] x86,sched: On AMD EPYC set freq_max = max_boost in schedutil invariant formula To: Michael Larabel Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Giovanni Gherdovich , Borislav Petkov , Ingo Molnar , Peter Zijlstra , Viresh Kumar , Jon Grimm , Nathan Fontenot , Yazen Ghannam , Thomas Lendacky , Suthikulpanit Suravee , Mel Gorman , Pu Wen , Juri Lelli , Vincent Guittot , Dietmar Eggemann , "the arch/x86 maintainers" , Linux PM , Linux Kernel Mailing List , ACPI Devel Maling List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 5, 2021 at 12:04 AM Michael Larabel wrote: > > On 2/4/21 7:40 AM, Rafael J. Wysocki wrote: > > On Thu, Feb 4, 2021 at 12:36 AM Michael Larabel wrote: > >> On 2/3/21 12:25 PM, Rafael J. Wysocki wrote: > >>> On Wednesday, February 3, 2021 3:11:37 PM CET Rafael J. Wysocki wrote: > >>>> On Wed, Feb 3, 2021 at 2:53 PM Giovanni Gherdovich wrote: > >>>> [cut] > >>>> > >>>>> Fixes: 41ea667227ba ("x86, sched: Calculate frequency invariance for AMD systems") > >>>>> Fixes: 976df7e5730e ("x86, sched: Use midpoint of max_boost and max_P for frequency invariance on AMD EPYC") > >>>>> Reported-by: Michael Larabel > >>>>> Tested-by: Michael Larabel > >>>>> Signed-off-by: Giovanni Gherdovich > >>>>> --- > >>>>> drivers/cpufreq/acpi-cpufreq.c | 61 ++++++++++++++++++++++++++++++-- > >>>>> drivers/cpufreq/cpufreq.c | 3 ++ > >>>>> include/linux/cpufreq.h | 5 +++ > >>>>> kernel/sched/cpufreq_schedutil.c | 8 +++-- > >>>> I don't really think that it is necessary to modify schedutil to > >>>> address this issue. > >>> So below is a prototype of an alternative fix for the issue at hand. > >>> > >>> I can't really test it here, because there's no _CPC in the ACPI tables of my > >>> test machines, so testing it would be appreciated. However, AFAICS these > >>> machines are affected by the performance issue related to the scale-invariance > >>> when they are running acpi-cpufreq, so what we are doing here is not entirely > >>> sufficient. > >> > >> I have benchmarks running on several Ryzen and EPYC systems with this > >> patch. The full batch of tests won't be done until tomorrow, but in > >> looking at the data so far from an AMD EPYC 7F72 2P server over the past > >> few hours, this patch does provide fairly comparable numbers to > >> Giovanni's patch. There were a few outliers so far but waiting to see > >> with the complete set of results. At the very least it's clear enough > >> already this new patch is at least an improvement over the current 5.11 > >> upstream state with schedutil on AMD. > > Thanks for the feedback, much appreciated! > > > > Let me submit the patch properly, then. > > > Everything continues looking good in running this patch on a variety of > AMD Zen2/Zen3 systems. > > As Giovanni has been focusing on EPYC testing, I have been running > several Ryzen laptops/desktop for more exposure and there it's looking > very good. On a Ryzen 9 5900X[1] when looking at this latest patch > against current 5.11 Git and 5.10, the performance is recovered and in > some cases better off now than 5.10 with Schedutil. No anomalies there > and with other Zen 2/3 desktops and Zen 2 notebook the performance > relative to 5.10 is comparable or in some cases better while all > indications point to the 5.11 regression being addressed. Some of the > slower systems still finishing up but no unexpected results yet and > likely just redundant testing at this point. > > Tests on EPYC hardware has also been looking good. With some 44 tests on > an EPYC 7F72 2P setup[2] when taking the geometric mean of all the data > finding it rightly in line with the prior patch from Giovanni. EPYC 7702 > and EPYC 7F52 1P performance similarly showing no regression any longer > with the patched kernel. This patch also seemed to help CPUFreq ondemand > performance improve as well in some cases. > > Will advise if hitting anything unexpected with the remainder of the > testing but all is looking solid at this point and a definite > improvement over the current 5.11 Git state. > > Tested-by: Michael Larabel Thank you for all of the verification work, much appreciated! > [1] https://openbenchmarking.org/result/2102048-PTS-RYZEN95920 (5.10 > stable vs. 5.11 Git vs. patched.) > [2] https://openbenchmarking.org/result/2102048-HA-AMDEPYC7F37 > (Giovanni's earlier patch against this new patch, compared to unpatched > Linux 5.11 Git and then Linux 5.11 with CPUfreq performance governor.)