Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2931623pxb; Mon, 25 Jan 2021 02:28:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7YmXioBNOvbZK7+HeDRhdxwE71aYkxLT/0JfD/ZLdnRusxLc7yAOspQGyn56yc3vjy09d X-Received: by 2002:a50:eacd:: with SMTP id u13mr1847437edp.382.1611570484157; Mon, 25 Jan 2021 02:28:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611570484; cv=none; d=google.com; s=arc-20160816; b=qgtFrDdU4E0Jx78rQkKMangvG3xehmQwH4ZeZzTL6E4A8KFWvVyGN5PNFgLiKUf2Fm RQ6KHFY21NjHTqyGyWzlYs5HZRsZiUHh/KnPM9q7oRDTTJL4D3d+pC6vvF+RxHlKqaTk 70B0js0Gk9QqAaXfA0hR1oFTKfxdKkTEjjS4hYGqGhyCVUPhcx6Dp1IsRlcIsg1kaY+k n4UuzgpKsiMaQXh6lfROpc/+scCEsNOnB9KhdH49qc08lCQQx2sC3rxlz/amawxU3uKZ ZqVk6lvT3BKNesg5Wgb2Czo1dlr8pIuvcXSg/jVth7/tHLbZoOQGU/jfUu9ipST9ooyQ lrYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ypMbUlgrFbzcYuyucmNzuPumJ/xgx4bvW34r5XmbX2k=; b=QDedRO62jebjY6NSGt7jLgzJZatV7E6DxQP0sxN7nafKYxBUKmT1+sbCjj71jKr25P yB6YBxZMzhmwSo3uLOrw/A5CVBOnE4imx+uzJptDBmtZgsKeshZJoAQDp5oTjLtv9Frd qcQQOB2PNn7I3g5NwynDkXSqm1a+pa/uFWrapshNO26DlM9DdGyeg3Re6poQefcb87w3 K9BOLxYWEMnFiAvG9Rr0q/nG/0/gJdvFiqG8DXaDOTqFSkao+TqEZ4WeZdzyWVO4s6CO dXm8R7L4vn20tFRG+SKL1fq1h35It9ZERPn1hLquKUByqZKwTbMhY281ZO88nZiqr4PM IMdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b="q+Ey7/6e"; 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 lr24si3641157ejb.92.2021.01.25.02.27.40; Mon, 25 Jan 2021 02:28:04 -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; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b="q+Ey7/6e"; 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 S1727390AbhAYKVx (ORCPT + 99 others); Mon, 25 Jan 2021 05:21:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727398AbhAYKQJ (ORCPT ); Mon, 25 Jan 2021 05:16:09 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E62AC06178A; Mon, 25 Jan 2021 02:04:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ypMbUlgrFbzcYuyucmNzuPumJ/xgx4bvW34r5XmbX2k=; b=q+Ey7/6eqsYlxEb26Jlt9VFQu+ lkJNNN+ouMyaQPwzLeanUfS9aIhBlgUpehQjGLYi+paXzMifRwePCvK3tpdrmNf5kQsYyPtY8+QX5 uBRAEDSP31JRdBJQ7mv1nLE4jBZHBBsrmL5WFOzOitm3TlkHZU/sMJcu+S3uPSd+uJH4g4lbLipkH wWN5fwjMRALwccVtTwgmEdaVggHULpi0GubaHrezgIgZKeE/GK182Qa+xTFCEnRKEi5ZfJr8ePpbV XkWct4vsBx6iUjhHb5Isw4drz3XUruAMrjUaAjkM0aH+yyjhOPgnRM2F23QFu8zzsyh4bhZjgxCuL LVTypm2g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1l3yjD-000500-Lp; Mon, 25 Jan 2021 10:04:11 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 63A2F300DB4; Mon, 25 Jan 2021 11:04:08 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4FBF928B66D18; Mon, 25 Jan 2021 11:04:08 +0100 (CET) Date: Mon, 25 Jan 2021 11:04:08 +0100 From: Peter Zijlstra To: Giovanni Gherdovich Cc: 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 , x86@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH v2 1/1] x86,sched: On AMD EPYC set freq_max = max_boost in schedutil invariant formula Message-ID: References: <20210122204038.3238-1-ggherdovich@suse.cz> <20210122204038.3238-2-ggherdovich@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210122204038.3238-2-ggherdovich@suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Rafael; should ACPI change that behaviour rather than adding yet another magic variable?