Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4276550pxb; Tue, 10 Nov 2020 12:10:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7r5et4rcIeEWWCvxpDLVrjzhCbPoaK5ScE9j0VsUYe88X5gRr3E9+Q+S+pW9lDRBBLgQk X-Received: by 2002:a17:906:d7a3:: with SMTP id pk3mr21247907ejb.208.1605039037096; Tue, 10 Nov 2020 12:10:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605039037; cv=none; d=google.com; s=arc-20160816; b=Pi6RBMaKHrJWAc/1KeJ6o8UABwFNKP+qDttCnlPantpJAQA0so8a7ZaQRZr6I3DWCH Rm4WVoksn06TYl561LEkqCe5dfGcHyoNejqEFdejqbIFcNUJdQDznDqJUuMwprhpDOxR y7/vPeZ+U5sfmw/HtVpNR4Y6I2rkcSYHQIxFp0iH25dFtLkRvgb0SZnVJtsTZSXMyhG3 wfk0uf/4bWCDfk2JpEqE8YViBKNIXEX7bB8phe9odv689vL88XeJZ1LUR/q2lsk9DfHp JiWqoeC9i+N/l5PN3BsXwqLSFTTiACAPN66W1iX4g5b0jvNKdUGJVu5X4mP65cTP5M7p YcNQ== 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=n/mvIL+rel16v8HdSoxZbVIbUfnbJLXqQUuf+bkM354=; b=lKJn58QWW8eojP8bx1wzXicWEJ1nu87KBXrV6/ZLgDXfLtIyvFpttLlRvgjJ8uCxHg Oi1ws5AN/VjlY02Uc30Sy+lM/6qQplmsy/pmB1PflCCI6ZS8ov7ztPpcr0OB2nZh3XDS z2KT1bOKCMA9vGu5tCOyt084FnVCk2IlH/zrdgx42Zjw7JlBPcietWFKT0PZHXsLQusj skLXCthMGmJhsjw0pUkUbwNZrprwxSSbHVPdJszfKYl78SZNoQLyqBkYPiyxi1eGbBzK PVH7L0XOIw6kyND3COwSJ/brRxBBnToPLcdRuq7MYgiINQ2EC4UINprHLSv34yB+Aw8p /UBg== 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 y25si9924915ejc.325.2020.11.10.12.10.09; Tue, 10 Nov 2020 12:10:37 -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 S1731584AbgKJUFe (ORCPT + 99 others); Tue, 10 Nov 2020 15:05:34 -0500 Received: from mx2.suse.de ([195.135.220.15]:53080 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726462AbgKJUFd (ORCPT ); Tue, 10 Nov 2020 15:05:33 -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 5BAD6AB93; Tue, 10 Nov 2020 20:05:32 +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 v3 0/3] Add support for frequency invariance to AMD EPYC Zen2 Date: Tue, 10 Nov 2020 21:05:16 +0100 Message-Id: <20201110200519.18180-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 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