Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp544245rwb; Thu, 10 Nov 2022 04:31:46 -0800 (PST) X-Google-Smtp-Source: AMsMyM7eP9IDUCPNE3m510RN9ndnY9E1x5YDlpD1up0DHnqm4/VLPcvS7gWBL6PUWDuuKY2TyPrQ X-Received: by 2002:a17:902:9308:b0:182:b2ba:755 with SMTP id bc8-20020a170902930800b00182b2ba0755mr65417072plb.107.1668083506549; Thu, 10 Nov 2022 04:31:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668083506; cv=none; d=google.com; s=arc-20160816; b=hk2+qcx6fi58DKxBEqcAyePfHX+FXkRFb8Odsd3hvxRCckBM43GMe2UbjLg1rT+/ax vKTPVs8EzzLxvU0jQx2Df7T8jxGLyXJhJJ65MVnUqWpkBcpr0LogobM2f2IkSmWcVEU3 kgkAbduNXnMnXzyP5K2bty5YLU/GFu0/I+tOJhPc6J8uST3bd7eu6GwdnbTailm+XbpR UYkrgvqG/47bkQkK3wEuRBilshbWqvsUDHY+zCqdOJXRyQFbcjcI4g5CwHSUtevQkvhT HrQp+FzVZmDZH/qEpzS3q2dSkAxskXGx7X2XujDZ9TBg65bXck2GYWuPRsufMoUCfKbh qfeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=RcBr4uQyBC2HN1exdcAhxaUTMQDYMZbAXEzCtEpXWlo=; b=eJ+KSY7Tgx3j70Qm+xgdzW8SRgBP02ERNS9LqNAzU1mlF9jJZmUa666BMTnXFGExlj 2cdh+uhnTvvkeXxkul3V9Ygs1S5VzHEdpCRAsYAIBPt6JLyKU87GMwqIkwzaz1YGOKgK X+NgLiZ51yF6EPFU0qLOJn5EuyV6GKyROk0mlOcCF//DuLtdY6AFEpGFUCKJYMzQIibe vrazyWraaraLvF+mH9ReiGXOkZGcCN8HeIrh5eyd/0CIpW7reo0COiyw9HumoDwTKIHv RslWjsSx3jmaRBujJJbtbykx1NdItMXX3lfJXY920pfzpZJXxTh640UdgKb4h59l7VuU gVTw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j6-20020a170903028600b00186abd10814si18375538plr.250.2022.11.10.04.31.33; Thu, 10 Nov 2022 04:31:46 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230413AbiKJLQm (ORCPT + 92 others); Thu, 10 Nov 2022 06:16:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230355AbiKJLQc (ORCPT ); Thu, 10 Nov 2022 06:16:32 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4A4297018A for ; Thu, 10 Nov 2022 03:16:30 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 39EBF1FB; Thu, 10 Nov 2022 03:16:36 -0800 (PST) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 11AEE3F534; Thu, 10 Nov 2022 03:16:27 -0800 (PST) Message-ID: Date: Thu, 10 Nov 2022 12:16:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [RFC PATCH 0/1] sched/pelt: Change PELT halflife at runtime Content-Language: en-US To: Peter Zijlstra , Kajetan Puchalski Cc: 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 References: <20220829055450.1703092-1-dietmar.eggemann@arm.com> <0f82011994be68502fd9833e499749866539c3df.camel@mediatek.com> From: Dietmar Eggemann In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 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. > + util = max_t(unsigned long, util, > + faster_est_approx(runtime * 2)); > + } > + rcu_read_unlock(); > + } > util = max_t(unsigned long, util, > READ_ONCE(cfs_rq->avg.util_est.enqueued)); > } [...]