From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A036C433E6 for ; Tue, 26 Jan 2021 09:43:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3843722581 for ; Tue, 26 Jan 2021 09:43:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730896AbhAZJmX (ORCPT ); Tue, 26 Jan 2021 04:42:23 -0500 Received: from outbound-smtp13.blacknight.com ([46.22.139.230]:41645 "EHLO outbound-smtp13.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391466AbhAZJlF (ORCPT ); Tue, 26 Jan 2021 04:41:05 -0500 X-Greylist: delayed 485 seconds by postgrey-1.27 at vger.kernel.org; Tue, 26 Jan 2021 04:41:03 EST Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp13.blacknight.com (Postfix) with ESMTPS id 9A43D1C3CDB for ; Tue, 26 Jan 2021 09:31:42 +0000 (GMT) Received: (qmail 27702 invoked from network); 26 Jan 2021 09:31:42 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 26 Jan 2021 09:31:42 -0000 Date: Tue, 26 Jan 2021 09:31:40 +0000 From: Mel Gorman To: Giovanni Gherdovich Cc: Peter Zijlstra , Borislav Petkov , Ingo Molnar , "Rafael J . Wysocki" , Viresh Kumar , Jon Grimm , Nathan Fontenot , Yazen Ghannam , Thomas Lendacky , Suthikulpanit Suravee , 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: <20210126093140.GB3592@techsingularity.net> References: <20210122204038.3238-1-ggherdovich@suse.cz> <20210122204038.3238-2-ggherdovich@suse.cz> <1611652167.11983.65.camel@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1611652167.11983.65.camel@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Tue, Jan 26, 2021 at 10:09:27AM +0100, Giovanni Gherdovich wrote: > On Mon, 2021-01-25 at 11:06 +0100, Peter Zijlstra wrote: > > On Fri, Jan 22, 2021 at 09:40:38PM +0100, Giovanni Gherdovich wrote: > > > 1. PROBLEM DESCRIPTION (over-utilization and schedutil) > > > > > > The problem happens on CPU-bound workloads spanning a large number of cores. > > > In this case schedutil won't select the maximum P-State. Actually, it's > > > likely that it will select the minimum one. > > > > > > A CPU-bound workload puts the machine in a state generally called > > > "over-utilization": an increase in CPU speed doesn't result in an increase of > > > capacity. The fraction of time tasks spend on CPU becomes constant regardless > > > of clock frequency (the tasks eat whatever we throw at them), and the PELT > > > invariant util goes up and down with the frequency (i.e. it's not invariant > > > anymore). > > > v5.10 v5.11-rc4 > > > ~~~~~~~~~~~~~~~~~~~~~~~~ > > > CPU activity (mpstat) 80-90% 80-90% > > > schedutil requests (tracepoint) always P0 mostly P2 > > > CPU frequency (HW feedback) ~2.2 GHz ~1.5 GHz > > > PELT root rq util (tracepoint) ~825 ~450 > > > > > > mpstat shows that the workload is CPU-bound and usage doesn't change with > > > > So I'm having trouble with calling a 80%-90% workload CPU bound, because > > clearly there's a ton of idle time. > > Yes you're right. There is considerable idle time and calling it CPU-bound is > a bit of a stretch. > > Yet I don't think I'm completely off the mark. The busy time is the same with > the machine running at 1.5 GHz and at 2.2 GHz (it just takes longer to > finish). To me it seems like the CPU is the bottleneck, with some overhead on > top. > I think this is an important observation because while the load may not be fully CPU-bound, it's still at the point where race-to-idle by running at a higher frequency is relevant. During the busy time, the results (and Michael's testing) indicate that the higher frequency may still be justified. I agree that there is a "a 'problem' between schedutil and cpufreq, they don't use the same f_max at all times", fixing that mid -rc may not be appropriate because it's a big change in an rc window. So, should this patch be merged for 5.11 as a stopgap, fix up schedutil/cpufreq and then test both AMD and Intel chips reporting the correct max non-turbo and max-turbo frequencies? That would give time to give some testing in linux-next before merging to reduce the chance something else falls out. -- Mel Gorman SUSE Labs