Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp567666pxb; Thu, 12 Nov 2020 10:28:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJweUOBlM6lABMOCCKZ8ulfv8fK2p0U76e85pn+18b8ugx8pYoNXelhsZe1hxn95nwUsGP5I X-Received: by 2002:a17:906:519e:: with SMTP id y30mr613925ejk.186.1605205697051; Thu, 12 Nov 2020 10:28:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605205697; cv=none; d=google.com; s=arc-20160816; b=jrPupWPYgdFLYRl3vEbWBhatIl7nCZjyKdm8FG8nieAsMlqCcesleCr+37VmU8EPav r6oli5B21/bva9WQHaEqab2f0sycP5t4SYAJ5Tg0h84iYQ3HDrxTppiCeeN1zwQG6JIG pvCjn3TwmCUlwbLUOEeb0H8bvOHtpHAjvXPKM1rP4ZGWRYelmrr+WBjExzUcs1j7CUp7 kC83n3Pc1LsLFuieKhzkTXRHHXh4vRrkNax1ATnr3hDqsk5Dg00CfdUi7I3GzrMoHl6S vjxjBXbQaNkZu8nQPxxdg0lYQz85IFpJ0Bm0bHHt4uLeUZ0ytCa2qNKL7WIqeIArgilC EHlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=5VXz75HAoSXoOKICc0SrITqvB7nzYmWUx6y300hUDcQ=; b=pF87DWFHUc55Tz88OjiViARlIhU6jczIBhxo2MBowE7dTxLj0GFeAD+eAL48HEHuZD joCMd3Uvhh3jN5apV2YtJ2ypgpRmJ67r+fsjcFhNsvV+UKpviAkFtXNLS6GuF1Mvw2oV LI/HWUpDtEtoQkYBzC35AUNUa77ulKSWfb8ACCd5QoomDRko5ULTjup8RkJh0b2GA5nl ps8MMEsaZTC0lXtAWSauacZZFHZw/k/dVam6dFqBX6Tr6Pp9/X6RCjFPpGsBhmjpqdeT FGK+BTfji+ls3iDTlQG2DkO0X5O2i1ApO3DdDdU8oN4vjvcX+2pUbitUBum5toYZOhd/ Smvw== 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 cw3si4772053edb.149.2020.11.12.10.27.52; Thu, 12 Nov 2020 10:28:17 -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 S1726477AbgKLS0W (ORCPT + 99 others); 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) -- 2.26.2