Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp627395rwb; Thu, 10 Nov 2022 05:34:49 -0800 (PST) X-Google-Smtp-Source: AMsMyM5+R5EIbRjJmDB753oxxxIVk41XNjwo7LUPIfbmylLV291F0pIaBocW12yPj0eAaGkhqRRP X-Received: by 2002:a63:4146:0:b0:46f:d2d4:bac4 with SMTP id o67-20020a634146000000b0046fd2d4bac4mr2479706pga.178.1668087289467; Thu, 10 Nov 2022 05:34:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668087289; cv=none; d=google.com; s=arc-20160816; b=nhfvFPrqzGUh6fRSVDuH8PEBgUmksnZ/RyUlJe20u1u1rhR3zUIRpnPcBxWQyolYec cPCYDJgq2MVO3HYWaY5Iaq/hxUOouEQqW1CsAK8+k1ykEzS46YRC2QL9HhTeWB1pJWN3 DUxzve16bOezWrgRO/xdFKZDZsQFFvsimdH2tPyorK2epa3xXifXXSAtgPN3bRzVWUcu 1Emcyde3D6uJnjfhuU0UjEn6kv7UkaG4b2INHyzgY8F3redHwDDYnz94N3oOlo+Tgdjq zJ5xqIywomq2o3VmveJ4V+uH/M0NgdaOWbwngBnjolVGuYvSCDjee8qffpwiIDW7gAK7 UGIw== 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=TRubi9G2lBsUI33R2uhTRAQsKIxoXAIX1ikocWaZbRU=; b=rq7cNYlYOnOojKyFzGuos9NaoQeZiMei7Cmtupr9iUHyNp9v5TxSkq40q3gqOv9qKu 48Hqlg3lZDBEYeIXgEnSMuOd1DlWtXMHsHOQh/YG5hizURxMPEjtktPKKBezodvFV5pu h8w0ljaP6hQSlgbOQrQhohd7r7zc/ZdmVx6d0J8BYTKEX02rlgsOVtphaQInSfZFgOe6 i4XwJCtqwkJYIgGVE+70uRHntzVJwQnfQC/bMYLd48zdtX9Lr2wzw0q3nc53cflxN4Ed jBM3dpFxAp0EIk/LZohpZe2g6ReyyRqln6Yv44NVw6T0+rjE1iPpm7ghISSpk5xWMVtv Jh9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@layalina-io.20210112.gappssmtp.com header.s=20210112 header.b=xNVbNYHo; 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 oe15-20020a17090b394f00b00205b268cd58si4156878pjb.181.2022.11.10.05.34.35; Thu, 10 Nov 2022 05:34:49 -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=@layalina-io.20210112.gappssmtp.com header.s=20210112 header.b=xNVbNYHo; 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 S229837AbiKJNZ2 (ORCPT + 92 others); Thu, 10 Nov 2022 08:25:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230403AbiKJNZW (ORCPT ); Thu, 10 Nov 2022 08:25:22 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 117C15EFA3 for ; Thu, 10 Nov 2022 05:25:21 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id r203-20020a1c44d4000000b003cfa97c05cdso1669182wma.4 for ; Thu, 10 Nov 2022 05:25:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=TRubi9G2lBsUI33R2uhTRAQsKIxoXAIX1ikocWaZbRU=; b=xNVbNYHoO/lIhnGsF9DTTxB2whwoIA3dXO80I/gBfnfKpgcWcxWty4tth1trIm04Yo jBCS/METKaJeAV1EY+jX4DeJNvDcBfpDirYceqcwJ0pZ3rn98Ycrkaxltl6Hzu8HXU4r +shTNOrBz0HjK9C3mI5thgWtlfl69Mb/ylQPDR+GmI26wee4BCtoBpeC93A7Z4zgwm5t sF0hLClxMf/m7btc8ym4BCZJ2AKYCj0c3smlYq8YxuaHxn1a0C6mVjAXKfb/bA+GrL7U z90bL69P3UJW98q80eggEk9zKE1GvSb1XqLHbCf3wPlCA8gFtUcNFiSGAyVETVjje7uY 0teQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TRubi9G2lBsUI33R2uhTRAQsKIxoXAIX1ikocWaZbRU=; b=GuJk3omJnFkT7VN9DE+8/8N+p1gRZV2qKqiEzGBkyqu+QQk3ZEopWfAvsYHeVhf252 1VKIKUGcywK2IoOxAsiQPj1QLs2OO56I1JLDJ5gCEyENM2c1BaIX1NYne3zrtG1ObwP+ OSCeGolj3XrQYHh+O7hNUxAbJ36n1zWSFk/o85RcA2IqkZDjATWrox+qW0kr517RQidW HEl7TByShAhlfY2pYMCM9kxZHubk0VNcFk7mlI3uY7HDXA817rFFPLW04TFu7Z8XhawB /IBd1KjB3DN5j2OBBk4lppZSqZ2rX0fSQ/HQEhrSJGGWhR5vc0H626JbfH5XJ2S0pSA0 SiNw== X-Gm-Message-State: ACrzQf38tYZYbkTQHCeTEfhtJ0yZ2344wqT5aigyyvuE8hnfuKWaNC14 zN8E54yD1SWw4Y9D6/cjUQUOkg== X-Received: by 2002:a05:600c:16c6:b0:3cf:9a65:6860 with SMTP id l6-20020a05600c16c600b003cf9a656860mr21777738wmn.65.1668086719618; Thu, 10 Nov 2022 05:25:19 -0800 (PST) Received: from airbuntu ([104.132.45.111]) by smtp.gmail.com with ESMTPSA id d7-20020a05600c3ac700b003c65c9a36dfsm4754619wms.48.2022.11.10.05.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 05:25:19 -0800 (PST) Date: Thu, 10 Nov 2022 13:25:17 +0000 From: Qais Yousef To: Peter Zijlstra Cc: Kajetan Puchalski , 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 Subject: Re: [RFC PATCH 0/1] sched/pelt: Change PELT halflife at runtime Message-ID: <20221110132517.vh2uzqlvw3upuwqf@airbuntu> References: <20220829055450.1703092-1-dietmar.eggemann@arm.com> <0f82011994be68502fd9833e499749866539c3df.camel@mediatek.com> <20221108194843.i4qckcu7zwqstyis@airbuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 11/09/22 16:49, Peter Zijlstra wrote: > On Tue, Nov 08, 2022 at 07:48:43PM +0000, Qais Yousef wrote: > > On 11/07/22 14: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. > > > > A bit of a tangent, but this reminded me of this old patch: > > > > https://lore.kernel.org/lkml/1623855954-6970-1-git-send-email-yt.chang@mediatek.com/ > > > > I think we have a bit too many moving cogs that might be creating undesired > > compound effect. > > > > Should we consider removing margins in favour of improving util ramp up/down? > > (whether via util_est or pelt hf). > > Yeah, possibly. > > So one thing that was key to that hack I proposed is that it is > per-task. This means we can either set or detect the task activation > period and use that to select an appropriate PELT multiplier. Note that a big difference compared to PELT HF is that we bias towards going up faster in util_est, not being able to go down as quickly could impact power as our residency in higher frequencies will be higher. Testing only can show how big of a problem this is in practice. > > But please explain; once tasks are in a steady state (60HZ, 90HZ or god > forbit higher), the utilization should be the same between the various > PELT window sizes, provided the activation period isn't *much* larger > than the window. It is steady state for a short period of time, before something else happens that change the nature of the workload. For example, being standing still in an empty room then an explosion suddenly happens causing lots of activity to appear on the screen. We can have a steady state at 20%, but an action on the screen could suddenly change the demand to 100%. You can find a lot of videos on how to tweak cpu frequencies and governor to improve gaming performances on youtube by the way: https://www.youtube.com/results?search_query=android+gaming+cpu+boost And this ancient video from google about impact of frequency scaling on games: https://www.youtube.com/watch?v=AZ97b2nT-Vo this is truly ancient and the advice given then (over 8 years ago) is not a reflection on current state of affairs. The problem is not new; and I guess expectations just keeps going higher on what one can do on their phone in spite of all the past improvements :-) > > Are these things running a ton of single shot tasks or something daft > like that? I'm not sure how all game engines behave; but the few I've seen they don't tend to do that. I've seen apps like instagram using single shot tasks sometime in the (distant) past to retrieve images. Generally I'm not sure how the Java based APIs behave. There is an API for Job Scheduler that allows apps to schedule background and foreground work; that could end up reusing a pool of tasks or creating new ones. I'm not sure. Game engines tend to be written in NDKs; but simpler games might not be. Cheers -- Qais Yousef