Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2110814pxu; Fri, 18 Dec 2020 05:55:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDTA2H1Uui6fvonjvl6EpQZgju36HbEjwJVEZx4G17qVPHBmX9I8S3ZKQW3XEG7JGPrkQJ X-Received: by 2002:a17:906:7146:: with SMTP id z6mr4019608ejj.379.1608299725892; Fri, 18 Dec 2020 05:55:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608299725; cv=none; d=google.com; s=arc-20160816; b=Ht0ns8Icjjwd8Sw8cJ8lQlzQ8trwY+MYDyKsOeFAzYdZl4lolNLbhytY4saO0aqhdK F3k4xRFYs5ta44a56Y+aufHZUNSX+FbreF7cFPtrMYKgvGfDu4jdJTjirg3mq9NyYVIy xrc7RCyZvLyCjrPfDv5vxEqfTUzYjeydDfF735aIvogdkPftJ/gws3ge87A9noZ+VHZZ fzcU3IRzv/pguLJcreItpxVgWXnLwazBNdFfCkOj4j1JA9X/h3mfkaukLr08yn4T1hRZ RsTnmDiDzwYjfQo6PnErTlOKnEsDzYzh1jLzOvRWYL4RjkvLM4s06QB4+ThgV7PzbERd scgw== 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; bh=pAtF0wjEKrB/alfg2gW6OkSKCElY2DJ4jsuY2G/uPgQ=; b=Zrl8R4MeTo6WhbbxJPrJuytCEh9D6qgtzTH1uZS1z1s+jGeO0IktmSpQHrdd9Q5i6H MZLt3mcuGvfEygtpeAaRZ2khDeayqOZsyKKnoMaYlh214LiWcbgzNQa/LO8LP/zvd7XX F3P587GR9FJflnY0XVs6ur8ayu/E8OLZs3+3TdhC7sgKDOlULlwbJUXQ/69oHEquuEq9 Z3t5f1VhOxwUCMpUhsbjcayKQePZN7BAW/WEia+tL3Zo+4TiO7o1521Yx5aZfgxlsZWk 5rtO9YW/hsmFKt6zev0IRXknjZhYZhbEkOcQqiQUFGVfZFXGZqHndH40TgEXx78lT5pS vRgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jo16si4521517ejb.86.2020.12.18.05.55.03; Fri, 18 Dec 2020 05:55:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726047AbgLRNlB (ORCPT + 99 others); Fri, 18 Dec 2020 08:41:01 -0500 Received: from foss.arm.com ([217.140.110.172]:35694 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725911AbgLRNlB (ORCPT ); Fri, 18 Dec 2020 08:41:01 -0500 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 ADADC1FB; Fri, 18 Dec 2020 05:40:15 -0800 (PST) Received: from e123083-lin (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A47813F66B; Fri, 18 Dec 2020 05:40:13 -0800 (PST) Date: Fri, 18 Dec 2020 14:40:07 +0100 From: Morten Rasmussen To: Valentin Schneider Cc: Peter Zijlstra , "Rafael J. Wysocki" , Ingo Molnar , Thomas Gleixner , Vincent Guittot , dietmar.eggemann@arm.com, patrick.bellasi@matbug.net, lenb@kernel.org, linux-kernel@vger.kernel.org, ionela.voinescu@arm.com, qperret@google.com, viresh.kumar@linaro.org Subject: Re: [PATCH] sched: Add schedutil overview Message-ID: <20201218133655.GA10123@e123083-lin> References: <20201218103258.GA3040@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 18, 2020 at 11:33:09AM +0000, Valentin Schneider wrote: > On 18/12/20 10:32, Peter Zijlstra wrote: > > +Schedutil / DVFS > > +---------------- > > + > > +Every time the scheduler load tracking is updated (task wakeup, task > > +migration, time progression) we call out to schedutil to update the hardware > > +DVFS state. > > + > > +The basis is the CPU runqueue's 'running' metric, which per the above it is > > +the frequency invariant utilization estimate of the CPU. From this we compute > > +a desired frequency like: > > + > > + max( running, util_est ); if UTIL_EST > > + u_cfs := { running; otherwise > > + > > + u_clamp := clamp( u_cfs, u_min, u_max ) > > + > > + u := u_cfs + u_rt + u_irq + u_dl; [approx. see source for more detail] > > + > > + f_des := min( f_max, 1.25 u * f_max ) > > + > > In schedutil_cpu_util(), uclamp clamps both u_cfs and u_rt. I'm afraid the > below might just bring more confusion; what do you think? > > clamp( u_cfs + u_rt, u_min, u_max ); if UCLAMP_TASK > u_clamp := { u_cfs + u_rt; otherwise > > u := u_clamp + u_irq + u_dl; [approx. see source for more detail] It is reflecting the code so I think it is worth it. It also fixes the typo in the original sum (u_cfs -> u_clamp). > (also, does this need a word about runnable rt tasks => goto max?) What is actually the intended policy there? I thought it was goto max unless rt was clamped, but if I read the code correctly in schedutil_cpu_util() the current policy is only goto max if uclamp isn't in use at all, including cfs. The write-up looks good to me. Reviewed-by: Morten Rasmussen Morten