Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1131285pxb; Thu, 4 Feb 2021 06:00:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuZJYsGU5+tlYPQgH/+sYSYcvxZesJtLisqEm7yL8kcZwW3o1Wc864xlC9+uKhYSXaqQwQ X-Received: by 2002:a05:6000:2:: with SMTP id h2mr9373852wrx.91.1612447252549; Thu, 04 Feb 2021 06:00:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612447252; cv=none; d=google.com; s=arc-20160816; b=rxgIm1Mn377LwFHiSC1yFvyAfGv5ZvVoc5AAnCQS/EQU+2IWxFiESHzmRVBi0VX2Rm 9jwZBpYSAFSkgiIAUhlqD9LvAS19t4PIeV6VIORL9jXWXKpDGWauzo7O7as5fr6nhuxq I5XLpcZnIVwm2ltIujk/9QcD5300ezOaQ+VOqsPUk7kEgT7u59rM1jR6cPRcTD7qSH5Y 5aMR0yCycaBSMg8YuGuOXBl3SWhIfKDEfKrlOPH6KY0FZuFDqGiMpcg2Qz4o6AkOX8Vn kUZVlalmBqhxblZYK8HNx37uTcl7nEgywzjzOcgB/fjAYr2JqP3eeRWaEtVTxEy2Qv6g Gbjg== 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=tUGFCfOln0MIB+Bx6JKAO7l6UiaLDkObbgjgMsbPunk=; b=dFX2RV2A075+dZB2qpPgo1WAFBsjspz9xpsh12MK4d2KTslHCrt88zFUs1qR4O/Cax cwFN84HVR7iRkM3q/GwXSuPX0hQIZPDClKDcl71jTtdoniPO8N9gNfkRrIDwHKkndFsl XwtOu+pV6xSIrnlhWRC6TPWBsGS0HgfWRnDB+g6ghX9wS/h+dW5ftqLIhuSuZWcX0W1m CcWB3KdBmZsXA/GpR6ib5T+MZSEesW8seAU4PnaYAEs0I2M+ERvJE40lBoECy6LchUrw C2myL6oFYeih3gk7f6y4X+Jh/evPHOQa0q2N+zccv5eqhhLtY+nsXR/Cpzq/NkW/zPoS G5sw== 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 dk7si1622519ejb.531.2021.02.04.06.00.20; Thu, 04 Feb 2021 06:00:52 -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 S236477AbhBDN6C (ORCPT + 99 others); Thu, 4 Feb 2021 08:58:02 -0500 Received: from mail-ot1-f54.google.com ([209.85.210.54]:39826 "EHLO mail-ot1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236495AbhBDN4O (ORCPT ); Thu, 4 Feb 2021 08:56:14 -0500 Received: by mail-ot1-f54.google.com with SMTP id d7so1179906otq.6; Thu, 04 Feb 2021 05:55:56 -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=tUGFCfOln0MIB+Bx6JKAO7l6UiaLDkObbgjgMsbPunk=; b=UXqk2fEQKf/Br3wMP3roNKmu687CxM5DHq9bYn39kOpvdrNJvvcNu0AzSql23ILuGb LGpiFT2Ux66XgQLmPXvledEkon8h0yf9HzcZ42CDGIcM4nSkzXH5sd5YlIIbcNw28GJY QFw3L1ZhAjYcHNjdt+GztoRFZaLOxlN5fk7OmBz7cnfDubTX0NrmMTSKkoGkgh+dKe/Y 7SGg6NkxFSsDxvPwf54X22Wc8fsqSVgzEOEE92nYx7PHr2GzcfB/rbCoPbeM7+zWOOL+ +N/o6VGdx47Ka8KvVX+1HzQTiHAwXcyP6PYz2+i6n7YW25hdSZvdJegJ3befxKRrqrZQ sJTQ== X-Gm-Message-State: AOAM531Lxi1gMI53NmWExiQJDF3ucDcsEADifH5o5sYN/v/z/o96he4d 1FtFQEA0s2gxDilCKuBt8IcV6oIhSCVgHIm51yc= X-Received: by 2002:a9d:7a4a:: with SMTP id z10mr5934499otm.206.1612446930595; Thu, 04 Feb 2021 05:55:30 -0800 (PST) MIME-Version: 1.0 References: <20210203135321.12253-1-ggherdovich@suse.cz> <20210203135321.12253-2-ggherdovich@suse.cz> <5470319.60Xv9dOaFs@kreacher> <1612446586.7566.20.camel@suse.cz> In-Reply-To: <1612446586.7566.20.camel@suse.cz> From: "Rafael J. Wysocki" Date: Thu, 4 Feb 2021 14:55:19 +0100 Message-ID: Subject: Re: [PATCH v3 1/1] x86,sched: On AMD EPYC set freq_max = max_boost in schedutil invariant formula To: Giovanni Gherdovich Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , 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 , Michael Larabel , "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 Thu, Feb 4, 2021 at 2:49 PM Giovanni Gherdovich wrote: > > On Wed, 2021-02-03 at 19:25 +0100, Rafael J. Wysocki wrote: > > [cut] > > > > 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. > > > > It looks like the scale-invariance code should ask the cpufreq driver about > > the maximum frequency and note that cpufreq drivers may be changed on the > > fly. > > > > What the patch below does is to add an extra entry to the frequency table for > > each CPU to represent the maximum "boost" frequency, so as to cause that > > frequency to be used as cpuinfo.max_freq. > > > > The reason why I think it is better to extend the frequency tables instead > > of simply increasing the frequency for the "P0" entry is because the latter > > may cause "turbo" frequency to be asked for less often. > > > > --- > > drivers/cpufreq/acpi-cpufreq.c | 107 ++++++++++++++++++++++++++++++++++++----- > > 1 file changed, 95 insertions(+), 12 deletions(-) > > Hello Rafael, > > thanks for looking at this. Your patch is indeed cleaner than the one I proposed. > > Preliminary testing is favorable; more tests are running. > > Results from your patch are in the fourth column below; the performance from > v5.10 looks restored. > > I'll follow up once the tests I queued are completed. Thank you! > TEST : Intel Open Image Denoise, www.openimagedenoise.org > INVOCATION : ./denoise -hdr memorial.pfm -out out.pfm -bench 200 -threads $NTHREADS > CPU : MODEL : 2x AMD EPYC 7742 > FREQUENCY TABLE : P2: 1.50 GHz > P1: 2.00 GHz > P0: 2.25 GHz > MAX BOOST : 3.40 GHz > > Results: threads, msecs (ratio). Lower is better. > > v5.10 v5.11-rc4 v5.11-rc4-ggherdov v5.11-rc6-rafael > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 1 1069.85 (1.00) 1071.84 (1.00) 1070.42 (1.00) 1069.12 (1.00) > 2 542.24 (1.00) 544.40 (1.00) 544.48 (1.00) 540.81 (1.00) > 4 278.00 (1.00) 278.44 (1.00) 277.72 (1.00) 277.79 (1.00) > 8 149.81 (1.00) 149.61 (1.00) 149.87 (1.00) 149.51 (1.00) > 16 79.01 (1.00) 79.31 (1.00) 78.94 (1.00) 79.02 (1.00) > 24 58.01 (1.00) 58.51 (1.01) 58.15 (1.00) 57.84 (1.00) > 32 46.58 (1.00) 48.30 (1.04) 46.66 (1.00) 46.70 (1.00) > 48 37.29 (1.00) 51.29 (1.38) 37.27 (1.00) 38.10 (1.02) > 64 34.01 (1.00) 49.59 (1.46) 33.71 (0.99) 34.51 (1.01) > 80 31.09 (1.00) 44.27 (1.42) 31.33 (1.01) 31.11 (1.00) > 96 28.56 (1.00) 40.82 (1.43) 28.47 (1.00) 28.65 (1.00) > 112 28.09 (1.00) 40.06 (1.43) 28.63 (1.02) 28.38 (1.01) > 120 28.73 (1.00) 39.78 (1.38) 28.14 (0.98) 28.16 (0.98) > 128 28.93 (1.00) 39.60 (1.37) 29.38 (1.02) 28.55 (0.99)