Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp656620rwb; Thu, 10 Nov 2022 05:58:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf6lnKBNAJLR+p3zFBRGwbFJ5WZNVpTl7xfOtFu66N/jisgPsaRshgand9y2Vj9ot6klFG5b X-Received: by 2002:a50:fc95:0:b0:466:63a3:386b with SMTP id f21-20020a50fc95000000b0046663a3386bmr17644860edq.241.1668088727095; Thu, 10 Nov 2022 05:58:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668088727; cv=none; d=google.com; s=arc-20160816; b=xGsQllPhRVJyFSLyjUH/jHvp9x/U5adjEKzQ7/h73B5+aTLX9wMTl0HX6/M6ETQw4/ Hq043RRnSERmUyXwY94Bm14QEsnZtvok5tvqhxsa5RmjE3kNT6b43GejyWppHvwg81uj vZSS66yjLGMRvrlWQl1qA0LZLE2e2wNOhS9LD2q6cU6UAHSRo4SPnI1XzeCh2iNT44yX +5b8vwbtVxltgutvDE5i2zfQ28E8zQrDsVRuCh429xoi7pQ2DKkoIBc9nvyOaSo4kYJG GsiPpXAidqH7TXSZjNCVmbUU+C9xIJakHMTUFQt9iIaFZG2dPrcsB2VxBDzanTKt3AoA s4Wg== 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=VLuXSJpMZo2D9GhJlx0I8MAytanQxzyqkRXjeWV7LHA=; b=PFBHJIjwtFLz9yrKBuEfdnnQjaw8WmnOtvCq8jBsRMjGf+n2lp0z3cHkTX5CJSogHX 3JKIB0djk6tQYd7gks/0peVcPfu1m2CEgzJcFpt1hY/dqDRvH7nY+MpqfTPnKIxYClDh +iOfXSN5ERXhiHBCklT0jXn5+ziJNAAQnnqmKpqEay5GJx9aiCnLw2etDD5zpDagzZEJ OGr5l4X5ewGNCJMLgsyfmdmzJ0Zh45HUuHyXkQFk0Rl2GM1kXUX1ccpYtzDt1ITV7Mx1 Fbrgpioy9/9P9F3X1dnpMBmrgb06+3vSVDhNa3E2NLuFt3nZd/nkq7zcxoVw7WjVeDcX LUKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=kwgX1pY4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z4-20020a05640235c400b004615855c483si21673245edc.98.2022.11.10.05.58.23; Thu, 10 Nov 2022 05:58:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=kwgX1pY4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230110AbiKJNFY (ORCPT + 92 others); Thu, 10 Nov 2022 08:05:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbiKJNFW (ORCPT ); Thu, 10 Nov 2022 08:05:22 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 444041A225 for ; Thu, 10 Nov 2022 05:05:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=VLuXSJpMZo2D9GhJlx0I8MAytanQxzyqkRXjeWV7LHA=; b=kwgX1pY4dyUUEbr85ef9jhDpqK S86xR0T8hPYf2U+cRDWd7UwcKPF+HKQ50KIGClc5vkPY/py5LQocIAu0H4LQ7xy5wxD3QfRq1xA3U cCJvLzxz8SBUTfoBS3+TGxbxQU7cEmNtC8RAxHwM2Fq2bPE0GbCFXpm9XuKhLB4PLoVTwAtFN5cyX CYrAs2N6imssbp5JmWPAY3x5Nm5b9rkcZfY07ps8+yT8XcVrSOZAVew9ok3qoQEutPJ8t/uIF6Cq2 C3NG7vqejlgZ4IRYmnasbhp9S2a7mlY1+56BGCav73XbvjoSASLnk3rSh42lJoNKm3bDtm6U6oio4 A7cESytw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ot7Ez-00C4yO-63; Thu, 10 Nov 2022 13:05:09 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 80A41300348; Thu, 10 Nov 2022 14:05:02 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3EDFC2B31AD65; Thu, 10 Nov 2022 14:05:02 +0100 (CET) Date: Thu, 10 Nov 2022 14:05:02 +0100 From: Peter Zijlstra To: Dietmar Eggemann Cc: Kajetan Puchalski , Jian-Min Liu , Ingo Molnar , Vincent Guittot , Morten Rasmussen , Vincent Donnefort , Quentin Perret , Patrick Bellasi , Abhijeet Dharmapurikar , Qais Yousef , linux-kernel@vger.kernel.org, Jonathan JMChen Subject: Re: [RFC PATCH 0/1] sched/pelt: Change PELT halflife at runtime Message-ID: References: <20220829055450.1703092-1-dietmar.eggemann@arm.com> <0f82011994be68502fd9833e499749866539c3df.camel@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 10, 2022 at 12:16:26PM +0100, Dietmar Eggemann wrote: > On 07/11/2022 14:41, Peter Zijlstra wrote: > > On Thu, Sep 29, 2022 at 03:41:47PM +0100, Kajetan Puchalski wrote: > > [...] > > > @@ -2956,13 +2958,26 @@ static inline unsigned long cpu_util_dl(struct rq *rq) > > */ > > static inline unsigned long cpu_util_cfs(int cpu) > > { > > + struct rq *rq = cpu_rq(cpu); > > struct cfs_rq *cfs_rq; > > unsigned long util; > > > > - cfs_rq = &cpu_rq(cpu)->cfs; > > + cfs_rq = &rq->cfs; > > util = READ_ONCE(cfs_rq->avg.util_avg); > > > > if (sched_feat(UTIL_EST)) { > > + if (sched_feat(UTIL_EST_FASTER)) { > > + struct task_struct *curr; > > + > > + rcu_read_lock(); > > + curr = rcu_dereference(rq->curr); > > + if (likely(curr->sched_class == &fair_sched_class)) { > > + u64 runtime = curr->se.sum_exec_runtime - curr->se.exec_start; > > Don't we and up with gigantic runtime numbers here? > > oot@juno:~# cat /proc/1676/task/1676/schedstat > 36946300 1150620 11 > root@juno:~# cat /proc/1676/task/1676/sched > rt-app (1676, #threads: 2) > ------------------------------------------------------------------- > se.exec_start : 77766.964240 <- ! > se.vruntime : 563.587883 > e.sum_exec_runtime : 36.946300 <- ! > se.nr_migrations : 0 > ... > > I expect cpu_util_cfs() to be ~1024 almost all the time now. Duh, obviously I meant to measure the runtime of the current activation and messed up. We don't appear to have the right information to compute this atm :/