Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6669915pxb; Wed, 17 Feb 2021 10:11:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/xM/B/RrrgE8af2KInuqDSh7cytwQZKcjlOfQJUtAGSFUp1/UZneBklrKPUxoBp0TX4li X-Received: by 2002:a17:906:71db:: with SMTP id i27mr208036ejk.111.1613585485498; Wed, 17 Feb 2021 10:11:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613585485; cv=none; d=google.com; s=arc-20160816; b=sPACgN6H/s5Ti1Mt8tgUJhn2ABLPdH7sGS7+QuJUKOSRfakMLbOHp9jR/mPPsvjLZP /IMRE6Moo0clqmIvRnTXuLjA5ygcCyEvNc/X2qb103yuyaEJFtb9vg6FyvB/lmu3sBo0 kFJIndzzDSbbt3CXQgDDdyMbTwAauToVMaEqa99dhwd1/wNT6jfnFKfmGaGgd6/hZrQe 7mE2zcJ+NK2+THQT6IuIOLxXVuSQVGNkWsS8re8RffBEdO8zLupTXYpBsBPvECaDTm97 3i9hfSPbaSBfcCnZYDg3vGHrQmBltxs5ISN84AtCBXOBpdsmghgCZITwiKb7YC+59dk9 X2Lw== 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=NsxA0/UMZkWVAuhoOzLnhRZ4hWdYEg6eUXHOKWQmu2s=; b=ktUOmHqKDYkQY2TxwDBI9nRmP7lbtfY5bC8ejengubbyTE1oN45CNlSM715QYjvZd/ E6pxlfHthdtbBZz8dyvq0kuE9Vhs4+Di1Ct1AyOovPqyKnVIR2LIziAFmEPvjGNelwhk zObEc9v1WDnHpV6NZFLBB2o2kvhITxIm4IRs5iq47rHJ1vv2lN8f3tsVfaImU9moHdBc IUZ6D91DJfRqjuyB63vtxMw/o9IR8lWY+wz6/jBa60EmacW0w2L8R1mL+r0k2zZQDgPc OZ3BDhhGI0+MgqTNcivMwU5Ij4JTPAcn5wT+wgUZgNflKyCeca/s48/lpO1IWDSPyJdB +N1A== 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 da23si1682793edb.584.2021.02.17.10.11.00; Wed, 17 Feb 2021 10:11:25 -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 S233391AbhBQOTQ (ORCPT + 99 others); Wed, 17 Feb 2021 09:19:16 -0500 Received: from mail-oi1-f177.google.com ([209.85.167.177]:34513 "EHLO mail-oi1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232371AbhBQOTO (ORCPT ); Wed, 17 Feb 2021 09:19:14 -0500 Received: by mail-oi1-f177.google.com with SMTP id j5so2850100oie.1; Wed, 17 Feb 2021 06:18:58 -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=NsxA0/UMZkWVAuhoOzLnhRZ4hWdYEg6eUXHOKWQmu2s=; b=BSKjF3wLOs+y+UOiRwuFTRlg85iBdwD4JQqOPAcVfgaBkKEfkLK2KEFReaGDw3/kEG FIk1BUA/US7XfukeRDO67vWYBZdbBjWULAiMiQxgcmBNyjwU98/dNORpwKh0JpVU1934 6AuC46IzxyUwxE+IsaGDQNz/4VZsQ0MwQgkrqCmIGV0UMUndkb+pRd3R79nzSWK4y4tI bkBff2e7niKkuIjiOoKp0m/mhGmmU1vSHycKY/YjVcm9mdJxrmG6RVMXwbRuvuiZr3ok 37g7e84PcW4bvms4trfpY/YgpWCORL/efLM+2krV5MLSuajiTt/kPZfqka9n8JS+Xwyt zpjQ== X-Gm-Message-State: AOAM531+WEEoSbx8jnsCEftpfsI6IKkHaj29WXVZW6QXSd7sf5s6JCRq LMAuIrSKinSUf1Dn1ZoX0xZNLpoGwfQWhWSxHIfVgbWk X-Received: by 2002:a54:400b:: with SMTP id x11mr5818289oie.71.1613571513496; Wed, 17 Feb 2021 06:18:33 -0800 (PST) MIME-Version: 1.0 References: <1974978.nRy8TqEeLZ@kreacher> <1613558749.2373.55.camel@suse.cz> In-Reply-To: <1613558749.2373.55.camel@suse.cz> From: "Rafael J. Wysocki" Date: Wed, 17 Feb 2021 15:18:20 +0100 Message-ID: Subject: Re: [RFT][PATCH v1] cpufreq: ACPI: Set cpuinfo.max_freq directly if max boost is known To: Giovanni Gherdovich Cc: "Rafael J. Wysocki" , Linux PM , Michael Larabel , LKML , Linux ACPI , Peter Zijlstra , Srinivas Pandruvada , Viresh Kumar , Mel Gorman , Juri Lelli , Vincent Guittot Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 17, 2021 at 11:46 AM Giovanni Gherdovich wrote: > > On Mon, 2021-02-15 at 20:24 +0100, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > > > Commit 3c55e94c0ade ("cpufreq: ACPI: Extend frequency tables to cover > > boost frequencies") attempted to address a performance issue involving > > acpi-cpufreq, the schedutil governor and scale-invariance on x86 by > > extending the frequency tables created by acpi-cpufreq to cover the > > entire range of "turbo" (or "boost") frequencies, but that caused > > frequencies reported via /proc/cpuinfo and the scaling_cur_freq > > attribute in sysfs to change which may confuse users and monitoring > > tools. > > > > For this reason, revert the part of commit 3c55e94c0ade adding the > > extra entry to the frequency table and use the observation that > > in principle cpuinfo.max_freq need not be equal to the maximum > > frequency listed in the frequency table for the given policy. > > > > Namely, modify cpufreq_frequency_table_cpuinfo() to allow cpufreq > > drivers to set their own cpuinfo.max_freq above that frequency and > > change acpi-cpufreq to set cpuinfo.max_freq to the maximum boost > > frequency found via CPPC. > > > > This should be sufficient to let all of the cpufreq subsystem know > > the real maximum frequency of the CPU without changing frequency > > reporting. > > > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=211305 > > Fixes: 3c55e94c0ade ("cpufreq: ACPI: Extend frequency tables to cover boost frequencies") > > Reported-by: Matt McDonald > > Signed-off-by: Rafael J. Wysocki > > --- > > > > Michael, Giovanni, > > > > The fix for the EPYC performance regression that was merged into 5.11 introduced > > an undesirable side-effect by distorting the CPU frequency reporting via > > /proc/cpuinfo and scaling_cur_freq (see the BZ link above for details). > > > > The patch below is reported to address this problem and it should still allow > > schedutil to achieve desirable performance, because it simply sets > > cpuinfo.max_freq without extending the frequency table of the CPU. > > > > Please test this one and let me know if it adversely affects performance. > > > > Thanks! > > Hello Rafael, > > more extended testing confirms the initial feeling; performance with this > patch is mostly identical to vanilla v5.11. Thank you! > Tbench shows an improvement. Interesting. > Thanks for the fix! YW > Tested-by: Giovanni Gherdovich > > Results follow. The machine has two sockets with an AMD EPYC 7742 each. > The governor is always schedutil. > > > Ratios of time, lower is better: > v5.11 v5.11 > vanilla patch > - - - - - - - - - - - - - - - - - - - - - - - - - - - - > NASA Parallel Benchmarks w/ MPI 1.00 0.96 > NASA Parallel Benchmarks w/ OpenMP 1.00 ~ > dbench on XFS 1.00 ~ > Linux kernel compilation 1.00 ~ > git unit test suite 1.00 ~ > > > Ratio of throughput, higher is better: > v5.11 v5.11 > vanilla patch > - - - - - - - - - - - - - - - - - - - - - - - - - - - - > tbench on localhost 1.00 1.09 > > > Tilde (~): no change wrt baseline. Thanks again! It would be good to hear from Michael too, but this is already sufficient for me to queue up the patch for 5.12-rc. Cheers!