Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp714618rwb; Wed, 9 Nov 2022 07:51:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf5+r14gc5TfkqEQlJnVZu3dp9jSX0sSSOYweBmAh0k7D8mCWVn+0sP63Q4mBWWdysdVA6rB X-Received: by 2002:a17:906:1503:b0:7ae:9bac:49d6 with SMTP id b3-20020a170906150300b007ae9bac49d6mr1827294ejd.601.1668009093896; Wed, 09 Nov 2022 07:51:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668009093; cv=none; d=google.com; s=arc-20160816; b=vbMw6lY+RwpYRQShBsgxXYBTnbNOF/t9FInH2taqh5lddkeIX6ryPggArNMQwoH7g0 bNy5+CLYK35ygu8tlw97xlex85pIF1AxXtsSX0eo4+PWaQ3nWqL5DroQHrUhMQOVCMWM XQQPeIVWQW669WgKtiiPoT9byXoBDfkATqPxjlpgGU+RVh2XKDnLZevm9CHB6+wuPvrY b9Y/haENl9ZKYfMVBLwz2H6A3W5AZqCc5HDNwIuH3moZ8gsFGIaJ5cUkdvybMoHHskAg D2LNf4SGdpviwK0L/DsF7/dFqQuH0lOuFIi4cbtOQhKQ0PMPKHGb+nUVq/48cy9asNNO vV4w== 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=GD6aGAp2I2GvGNrhJpZQJXZWuYasPO40dUclFNGB3WQ=; b=1HNq3CNqPMqMuDBSrNKt6+Yuvth3I/6QFDUjfsQ12TW5DquiVip1MEVo3E21VnVTJS CwJlQtO8TgpKxGItqLcq9mXIw3vPvmHw8Eqh5ITNgHxgySh5dSF0CjrGV9KXraUfz243 cXQhH2Vz/v/ycTGTz46Sx0uWroPnig83ZHN55mZAol7od4qCysqzdv/kEkxdVCscXlIj c/sekIpshDZwq48HC2WSpzj/k6cPhchc5MVR0nN64XBCorfFVrq3yTNA6KMePdtnC5Xh 4fmm8D4AngHLOV+RYpypJSJr9rw3/FadI5k7vZikEp0zG7xrM6yGPck0UPOuvxaSHBi/ G3Dg== 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 gs17-20020a1709072d1100b0078da5f6ed9esi18826661ejc.779.2022.11.09.07.51.06; Wed, 09 Nov 2022 07:51:33 -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 S231975AbiKIPTA (ORCPT + 93 others); Wed, 9 Nov 2022 10:19:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231869AbiKIPS6 (ORCPT ); Wed, 9 Nov 2022 10:18:58 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0A81D26F3 for ; Wed, 9 Nov 2022 07:18:57 -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 EEC521FB; Wed, 9 Nov 2022 07:19:02 -0800 (PST) Received: from [10.57.3.244] (unknown [10.57.3.244]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 858873F73D; Wed, 9 Nov 2022 07:18:54 -0800 (PST) Message-ID: <8cb196d8-1a81-cfd9-6437-a1ba26a7c767@arm.com> Date: Wed, 9 Nov 2022 15:18:52 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [RFC PATCH 0/1] sched/pelt: Change PELT halflife at runtime Content-Language: en-US To: Peter Zijlstra Cc: Jian-Min Liu , Dietmar Eggemann , Ingo Molnar , Vincent Guittot , Morten Rasmussen , Vincent Donnefort , Quentin Perret , Patrick Bellasi , Abhijeet Dharmapurikar , Qais Yousef , linux-kernel@vger.kernel.org, Jonathan JMChen , Kajetan Puchalski References: <20220829055450.1703092-1-dietmar.eggemann@arm.com> <0f82011994be68502fd9833e499749866539c3df.camel@mediatek.com> From: Lukasz Luba In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed 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 Hi Peter, On 11/7/22 13:41, Peter Zijlstra wrote: > On Thu, Sep 29, 2022 at 03:41:47PM +0100, Kajetan Puchalski wrote: > >> Based on all the tests we've seen, jankbench or otherwise, the >> improvement can mainly be attributed to the faster ramp up of frequency >> caused by the shorter PELT window while using schedutil. > > Would something terrible like the below help some? > > If not, I suppose it could be modified to take the current state as > history. But basically it runs a faster pelt sum along side the regular > signal just for ramping up the frequency. [snip] > + > + 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; > + util = max_t(unsigned long, util, > + faster_est_approx(runtime * 2)); That's a really nice hack :) I wonder why we end up in such situation on Android. Maybe there is a different solution? Maybe shorter tick (then also align PELT Half-Life)? The problem is mostly in those high-FPS phones. You know, we now have phones with 144Hz displays and even games > 100FPS (which wasn't the case a few years ago when we invested a lot of effort into this PELT+EAS). We also have a lot faster CPUs (~2x in 3-4 years). IMO those games (and OS mechanisms assisting them) would have different needs probably (if they do this 'soft-real-time simulations' with such high granularity ~120/s -> every ~8ms). IMO one old setting might not fit well into this: 4ms tick (which is the Android use case), which then implies scheduler min granularity, which we also align with the y^32 PELT. Is this a correct chain of thinking? Would it make sense to ask Android phone vendors to experiment with 1ms tick (w/ aligned PELT HL)? With that change, there might be some power spikes issues, though. Regards, Lukasz