Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp2268291rwj; Mon, 19 Dec 2022 02:02:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf6UYb53voyPlgDdjPECs5kmqmCdihRiVo/ByjNGt/GYnoeKi/Ezj6yO/UGLBF6RIvbmlwV+ X-Received: by 2002:a17:906:b43:b0:7c1:3018:73b6 with SMTP id v3-20020a1709060b4300b007c1301873b6mr32455533ejg.61.1671444150641; Mon, 19 Dec 2022 02:02:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671444150; cv=none; d=google.com; s=arc-20160816; b=Rlc3OvlcuMZZ9R2+AmyTbFzwnDi2BR3oxO+MRnVY2hLoJE3/yaTMoy5WI1aW+YLzdM uEoYpXLHIfxIXs0bqGLxdOsRKzACtrKz2tR2NDIdeCri84+1gL+5r5bC69+TQk3l9biq AREOlBYfoDOLNatJP+65Q5xLlzGqNBuybzou1zxQbN1TNqVVzl4L2mAZ+2e28EK+1gC7 4GqBv3Z9wj15vSSNhxjcIesFJ+OsDrnnwGuiKYlE72lA80OPTsYpagyrMFb4elySUEqd +6UFaLzQ+qvciLBPoW2CPNxPI08oB22on/aN7TjaP3o3vDOca4iu2sNgnFsQZHzDL6kF /Z/Q== 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=ICJGJFuI4asWbEDu9zkJTNuUd/FqiX5W1HN19O69D+Q=; b=digQstx6wqI6hHW8bETqwUXjs/ps/wkjzAB/JVtMOx0X4TPWBhEi0iUWREaerVenzR J1yy3NcAxEN/vpnhFt95oppSQFx/NMGnQi1VIV55hhAnYA78+2RfgqVx4mcO7hDznOzI yDo1uHejc6gkMPpzfllEXZCfTW702fuo/zgQp4B4X+S4VcwuhBYRRPKd6ET3J4EwDVKn 0Th1BsamLYZU4iqivU+pAtMJtQLL2qJ+QJj+8hCRjR/KvIxyrTyigZG8lFsqoGWuBanq f3/esHghLWNZqsRqjbWMNgzSd7ZkPp15zkGcv2ysTKI2C0JDVIDtun3M3/8fGKPgj4Cz ZZsA== 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 c21-20020a170906529500b007c19ace9796si7173337ejm.940.2022.12.19.02.02.13; Mon, 19 Dec 2022 02:02:30 -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 S231777AbiLSJKO (ORCPT + 70 others); Mon, 19 Dec 2022 04:10:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231718AbiLSJJq (ORCPT ); Mon, 19 Dec 2022 04:09:46 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6B3EBBC86; Mon, 19 Dec 2022 01:09:40 -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 DA40CFEC; Mon, 19 Dec 2022 01:10:20 -0800 (PST) Received: from [10.57.10.192] (unknown [10.57.10.192]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 08F983F703; Mon, 19 Dec 2022 01:09:36 -0800 (PST) Message-ID: <7f755efd-baad-b5c5-0707-e4adde2d3671@arm.com> Date: Mon, 19 Dec 2022 09:09:35 +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: [PATCH v3] Documentation: sched: Document util clamp feature Content-Language: en-US To: Qais Yousef , Bagas Sanjaya Cc: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Linux ARM , Xuewen Yan , Wei Wang , Jonathan JMChen , Hank , Paul Bone , Russell King , Linus Walleij , Catalin Marinas References: <20221216235716.201923-1-qyousef@layalina.io> <20221217220133.p5wh7drpvkmkups2@airbuntu> From: Lukasz Luba In-Reply-To: <20221217220133.p5wh7drpvkmkups2@airbuntu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 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 12/17/22 22:01, Qais Yousef wrote: > On 12/17/22 16:53, Bagas Sanjaya wrote: >> On Fri, Dec 16, 2022 at 11:57:16PM +0000, Qais Yousef wrote: >>> +Another example is in Android where tasks are classified as background, >>> +foreground, top-app, etc. Util clamp can be used to constrain how much >>> +resources background tasks are consuming by capping the performance point they >>> +can run at. This constraint helps reserve resources for important tasks, like >>> +the ones belonging to the currently active app (top-app group). Beside this >>> +helps in limiting how much power they consume. This can be more obvious in >>> +heterogeneous systems (e.g. Arm big.LITTLE); the constraint will help bias the >>> +background tasks to stay on the little cores which will ensure that: >>> + >>> + 1. The big cores are free to run top-app tasks immediately. top-app >>> + tasks are the tasks the user is currently interacting with, hence >>> + the most important tasks in the system. >>> + 2. They don't run on a power hungry core and drain battery even if they >>> + are CPU intensive tasks. >>> + >>> +.. note:: >>> + **little cores**: >>> + CPUs with capacity < 1024 >>> + >>> + **big cores**: >>> + CPUs with capacity = 1024 >> >> Processing capacity (CPU frequency) in MHz? This is the first time I > > This is a scheduler abstraction value from 0-1024. Biggest CPU always has > a capacity of 1024. On SMP all cpus appear as 1024 CPUs. > >> hear Arm big.LITTLE architecture. CC'ing several Arm folks and >> linux-arm-kernel list for I'm unsure on this. > > This has my Arm SoB :-) > > This was added based on Lukasz comments. Both Lukasz and Dietmar were my > colleagues at Arm and are on CC. Arm big.LITTLE is probably the most popular heterogeneous system in the world (hundreds of millions of phones run that) :) Bagas you definitely has to catch up ;) [1] [2] > > I don't think it was necessary to expand the recipients list. But probably more > is better though all the scheduler people are covered. This has nothing to do > with Arm but it's the prime example of heterogeneous systems. > >> >>> + >>> +By making these uclamp performance requests, or rather hints, user space can >>> +ensure system resources are used optimally to deliver the best possible user >>> +experience. >>> + >>> +Another use case is to help with **overcoming the ramp up latency inherit in >>> +how scheduler utilization signal is calculated**. >> >> IMO the bold text isn't needed (why did you highlight the phrase above)? >> >>> +When task @p is running, **the scheduler should try its best to ensure it >>> +starts at 40% performance level**. If the task runs for a long enough time so >>> +that its actual utilization goes above 80%, the utilization, or performance >>> +level, will be capped. >> >> Same here. >> >>> +**Generally it is advised to perceive the input as performance level or point >>> +which will imply both task placement and frequency selection**. >> >> Same here too. > > All of these were added based on Lukasz review comments. He thought they're > important pieces and should be highlighted, I opted to do that by making them > bold text. Looks OK to me. This documentation will be read by application developers. They used to read different type of documentations. We want to help them to better understand the issues and possible solution's mechanisms. That's why IMO bold text is OK in this case. > > > Thanks! > > -- > Qais Yousef [1] https://developer.arm.com/documentation/den0024/a/big-LITTLE-Technology [2] https://developer.arm.com/documentation/den0024/a/Multi-core-processors/Multi-processing-systems/Heterogeneous-multi-processing