Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp721525pxb; Tue, 2 Feb 2021 16:41:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyi5sAe4s0LiysOgs/M3wOieZfyL0ck8QmCcRH/FKh05KzDbbDtz2irz9ZdsEeYMN1NlRX X-Received: by 2002:a17:906:cc56:: with SMTP id mm22mr573466ejb.181.1612312867039; Tue, 02 Feb 2021 16:41:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612312867; cv=none; d=google.com; s=arc-20160816; b=Hd0XTEOxobTCZUiI9YRYypnvwGYe//bn5P/auh9Fd0GCc5kaBfR4GQhFs2LlyjMeCP ooL+mX7xdBkL6EmEUXr0dx8HemQqE+36vjL68SQx3i6SgfRnT0vY93V8ZRaxa8+YgBdq zoLFwtjQGfIxZ4JgdWI3cYgMaohPCylye9IIwlF7Wqn8q1RaaR4cA/Gjx3PkqEwr+Qpk N6dmM/h20NC+O16LZoaMXklpIJNoxPKTtAwbIXemUOP/I1JCKZmEfTzTibRkEJGJpsxr sLs2hXcwSawrGT2M3NXAbxZi9h3tSwjlmaECUK3EVqXtvaXdytT28ZG7vUsFWuCey0ir 8ygA== 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=O/AvfXPMYMjAkT7JzfZH4VPl/sWjVELm+etlTJV5+nw=; b=g/NX3ypzKB4JBAKfVfPdrwCHDZxuD5pdZF+hU3zX39FkAPjT3agRJ+xnA6mq3CWFIA EMkkEQtQaIsRwcM2fyGN0q8wTlGu6qYxVXnWgJhzI6qdNbmie9NHlZrZhkv26fmV7U3C BPIkQfpNh9zDycuXpUnSpVD8FT88+oHlNzOfJe1dvkzILxpuT0fa+QKEa2+6Vr4nNB/F KyWNk7VkBwb5m8zwSdWTgcZ8HYDNm/GRjE0PkLGcqRP3WhiDgMDxqgWArny5aV0sV0Ih 5Wua4OQF/3zxuNvFACN4C46WKaQ3oljYgTYEPMZKgc/JYCuX10tWgylGrApSV6QF/fLt Vp6w== 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 z20si198082edb.95.2021.02.02.16.40.42; Tue, 02 Feb 2021 16:41:07 -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 S238589AbhBBSoQ (ORCPT + 99 others); Tue, 2 Feb 2021 13:44:16 -0500 Received: from mail-oi1-f170.google.com ([209.85.167.170]:39669 "EHLO mail-oi1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238806AbhBBSlS (ORCPT ); Tue, 2 Feb 2021 13:41:18 -0500 Received: by mail-oi1-f170.google.com with SMTP id w124so23848954oia.6; Tue, 02 Feb 2021 10:41:02 -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=O/AvfXPMYMjAkT7JzfZH4VPl/sWjVELm+etlTJV5+nw=; b=ZyYitEKU36bTmVn+ADZ+CwI0XEftSPiC3fr4dscoV6W2QdQVnvuBzIr2JH3K0SD4J5 afVURBKd5nwnYm08YaoGKn067t3xeczUsOp3xkBmpH59DEf3t+1ZL/FeJSUMYI2zO/0y oAyiDDqjISSM+xXd0tqpiOTca/x2e2aGxYBWHr463IRoETPRqzPisteNYTcrgp2m2AFR WUqvT3ZXJjZq1bH7r/P0kX4hjOseobIkP14fFqx+NXx/INUBoOc0WJj5M2UCTp54IVaD tWGli9nqIgTtoGB4rZVuVCN+FAKEyUGPr1r64lCgWA1UEpi9b+cmVvhRycD8dQchlXYc WOvw== X-Gm-Message-State: AOAM530MkFLOAbLiG6ibFdBQzVsMDOLat3brZggEveCDzSBTZh+4KQzD YSZMWceX00Wdf1DnDpTIW4+Dc6tddKu1L2R1Sco= X-Received: by 2002:aca:308a:: with SMTP id w132mr3555948oiw.69.1612291237566; Tue, 02 Feb 2021 10:40:37 -0800 (PST) MIME-Version: 1.0 References: <20210122204038.3238-1-ggherdovich@suse.cz> <20210122204038.3238-2-ggherdovich@suse.cz> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 2 Feb 2021 19:40:26 +0100 Message-ID: Subject: Re: [PATCH v2 1/1] x86,sched: On AMD EPYC set freq_max = max_boost in schedutil invariant formula To: Peter Zijlstra Cc: Giovanni Gherdovich , Borislav Petkov , Ingo Molnar , "Rafael J . Wysocki" , 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 Mon, Jan 25, 2021 at 11:11 AM Peter Zijlstra wrote: > > On Fri, Jan 22, 2021 at 09:40:38PM +0100, Giovanni Gherdovich wrote: > > This workload is constant in time, so instead of using the PELT sum we can > > pretend that scale invariance is obtained with > > > > util_inv = util_raw * freq_curr / freq_max1 [formula-1] > > > > where util_raw is the PELT util from v5.10 (which is to say, not invariant), > > and util_inv is the PELT util from v5.11-rc4. freq_max1 comes from > > commit 976df7e5730e ("x86, sched: Use midpoint of max_boost and max_P for > > frequency invariance on AMD EPYC") and is (P0+max_boost)/2 = (2.25+3.4)/2 = > > 2.825 GHz. Then we have the schedutil formula > > > > freq_next = 1.25 * freq_max2 * util_inv [formula-2] > > > > Here v5.11-rc4 uses freq_max2 = P0 = 2.25 GHz (and this patch changes it to > > 3.4 GHz). > > > > Since all cores are busy, there is no boost available. Let's be generous and say > > the tasks initially get P0, i.e. freq_curr = 2.25 GHz. Combining the formulas > > above and taking util_raw = 825/1024 = 0.8, freq_next is: > > > > freq_next = 1.25 * 2.25 * 0.8 * 2.25 / 2.825 = 1.79 GHz > > Right, so here's a 'problem' between schedutil and cpufreq, they don't > use the same f_max at all times. > > And this is also an inconsistency between acpi_cpufreq and intel_pstate > (passive). IIRC the intel_pstate cpufreq drivers uses 4C/1C/P0 resp, > while ACPI seems to stick to P0 f_max. The only place where 4C is used is the scale invariance code AFAICS. intel_pstate uses P0 as the f_max unless turbo is disabled. The difference between intel_pstate and acpi_cpufreq is that (a) the latter uses a frequency table and the former doesn't and (b) the latter uses the P0 entry of the frequency table to represent the entire turbo range, > Rafael; should ACPI change that behaviour rather than adding yet another > magic variable? I'm not sure. That may change the behavior from what is expected by some users.