From patchwork Thu Nov 12 18:26:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giovanni Gherdovich X-Patchwork-Id: 11901017 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86C2AC55ABD for ; Thu, 12 Nov 2020 18:26:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B9802223C for ; Thu, 12 Nov 2020 18:26:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726433AbgKLS0W (ORCPT ); Thu, 12 Nov 2020 13:26:22 -0500 Received: from mx2.suse.de ([195.135.220.15]:58878 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726194AbgKLS0V (ORCPT ); Thu, 12 Nov 2020 13:26:21 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5FB75AB95; Thu, 12 Nov 2020 18:26:20 +0000 (UTC) From: Giovanni Gherdovich To: Borislav Petkov , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Len Brown , "Rafael J . Wysocki" Cc: Jon Grimm , Nathan Fontenot , Yazen Ghannam , Thomas Lendacky , Mel Gorman , Pu Wen , Viresh Kumar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Doug Smythies , x86@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Giovanni Gherdovich Subject: [PATCH v4 0/3] Add support for frequency invariance to AMD EPYC Zen2 Date: Thu, 12 Nov 2020 19:26:11 +0100 Message-Id: <20201112182614.10700-1-ggherdovich@suse.cz> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org v3 at https://lore.kernel.org/lkml/20201110200519.18180-1-ggherdovich@suse.cz/ Changes wrt v3: - Correct the #ifdef guard for cppc_get_perf_caps() from CONFIG_ACPI to CONFIG_ACPI_CPPC_LIB (reported by "kernel test robot ") - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cover Letter from v3: v2 at https://lore.kernel.org/lkml/20201110183054.15883-1-ggherdovich@suse.cz/ Changes wrt v2: - "code golf" on the function function init_freq_invariance_cppc(). Make better use of the "secondary" argument to init_freq_invariance(), which was introduced at b56e7d45e807 ("x86, sched: Don't enable static key when starting secondary CPUs") to deal with CPU hotplug. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cover Letter from v2: v1 at https://lore.kernel.org/lkml/20201110083936.31994-1-ggherdovich@suse.cz/ Changes wrt v1: - made initialization safe under CPU hotplug. The function init_freq_invariance_cppc now lets only the first caller into init_freq_invariance(). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cover Letter from v1: This series adds support for frequency invariant accounting on AMD EPYC Zen2 (aka "Rome"). The first patch by Nathan lays out the foundation by querying ACPI infrastructure for the max boost frequency of the system. Specifically, this value is available via the CPPC machinery; the previous EPYC generation, namely Zen aka "Naples", doesn't implement that and frequency invariance won't be supported. The second patch sets the estimate for freq_max to be the midpoint between max_boost and max_P, as that works slightly better in practice. A side effect of this series is to provide, with the invariant schedutil governor, a suitable baseline to evaluate a (still work-in-progress) CPPC-based cpufreq driver for the AMD platform (see https://lore.kernel.org/lkml/cover.1562781484.git.Janakarajan.Natarajan@amd.com if/when it will resubmitted. Giovanni Gherdovich (2): x86, sched: Use midpoint of max_boost and max_P for frequency invariance on AMD EPYC x86: Print ratio freq_max/freq_base used in frequency invariance calculations Nathan Fontenot (1): x86, sched: Calculate frequency invariance for AMD systems arch/x86/include/asm/topology.h | 8 ++++ arch/x86/kernel/smpboot.c | 79 ++++++++++++++++++++++++++++++--- drivers/acpi/cppc_acpi.c | 3 ++ 3 files changed, 85 insertions(+), 5 deletions(-)