Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp962208ybt; Tue, 7 Jul 2020 04:40:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeh9irg4fmwLlkyhp0ifdxgQwk+jCTLlPEQ5f7BohOmIbQmpXoAG+OWp1UGCQtDiV8MJJz X-Received: by 2002:a17:906:26c3:: with SMTP id u3mr45769225ejc.483.1594122022849; Tue, 07 Jul 2020 04:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594122022; cv=none; d=google.com; s=arc-20160816; b=GexHXF6xbhRS/LyOXvTMuQCkQak3nmbuo8XPrUtgu+bXj4L1lNR9IonQCJqJwN5cKp nW8AtnAH19QjhFaedmJx+5882hLEZdIGb5P2zqg8MO7OXlUNiYHC4UeY2i7BRMuf5FIG DYOVNlpEWYIgTKqCZGDzO5rICr1Vr/VpK1xMqDwzQlKf+sI5J3AM6Pst6Bb6TSYbhjyU cDPI/RtMZJqc4dRXOSnFLX5bYbk12ZieJsQ7D74zNX4b0+Z3qdRJYWhPaa80t0nLxqdc aOZ6zUpyaNdOcUlIMmNWSwt66EOADVX3s6OKmvcYVD/Ugfz40PmSoBAwTTinPq6v208c Eftg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references; bh=qlPTe6z62F7XhBOfu/pyBp8OcIYQ1QR6iIpLFqdiVmU=; b=v6Y0E/2CIX9weUXs0YXr193WjEYa23D9L05ST3T/+SjK7Wariqcvs30Nli+jE/0o44 n44xnvFGFpUiUGT+6z7GafFmm/xD2sPmZlKNx4uuz5n+XL7zRw9tNJ+nLBkiERRraWmB FDk4X66rPWyIzj7lHWXSVzmpS3UaQw6zMr8b8Ol6IKnwO9NlxSwQsWFOCfPm6CtVNmy7 SQ00Bi6ExaAUqTut70VbJduJV0+CKvKtNl3Me8JD/2QQDFd5JUN/u7RMqevKP5ycJF4T 2XrlkYK2Dqio9EdmepQTw3N7DIjbDomrbLUm0/mO4IDp569LVULR0ykKOvBT7tUHauiF w24g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds3si17584714ejc.545.2020.07.07.04.39.59; Tue, 07 Jul 2020 04:40:22 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728224AbgGGLjy (ORCPT + 99 others); Tue, 7 Jul 2020 07:39:54 -0400 Received: from foss.arm.com ([217.140.110.172]:42780 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726805AbgGGLjx (ORCPT ); Tue, 7 Jul 2020 07:39:53 -0400 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 EFA3E1FB; Tue, 7 Jul 2020 04:39:52 -0700 (PDT) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 878203F71E; Tue, 7 Jul 2020 04:39:50 -0700 (PDT) References: <20200706142839.26629-1-qais.yousef@arm.com> <20200706142839.26629-2-qais.yousef@arm.com> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: Qais Yousef Cc: Ingo Molnar , Peter Zijlstra , Doug Anderson , Jonathan Corbet , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Luis Chamberlain , Kees Cook , Iurii Zaikin , Quentin Perret , Patrick Bellasi , Pavan Kondeti , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v6 1/2] sched/uclamp: Add a new sysctl to control RT default boost value In-reply-to: <20200706142839.26629-2-qais.yousef@arm.com> Date: Tue, 07 Jul 2020 12:39:48 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/07/20 15:28, Qais Yousef wrote: > RT tasks by default run at the highest capacity/performance level. When > uclamp is selected this default behavior is retained by enforcing the > requested uclamp.min (p->uclamp_req[UCLAMP_MIN]) of the RT tasks to be > uclamp_none(UCLAMP_MAX), which is SCHED_CAPACITY_SCALE; the maximum > value. > > This is also referred to as 'the default boost value of RT tasks'. > > See commit 1a00d999971c ("sched/uclamp: Set default clamps for RT tasks"). > > On battery powered devices, it is desired to control this default > (currently hardcoded) behavior at runtime to reduce energy consumed by > RT tasks. > > For example, a mobile device manufacturer where big.LITTLE architecture > is dominant, the performance of the little cores varies across SoCs, and > on high end ones the big cores could be too power hungry. > > Given the diversity of SoCs, the new knob allows manufactures to tune > the best performance/power for RT tasks for the particular hardware they > run on. > > They could opt to further tune the value when the user selects > a different power saving mode or when the device is actively charging. > > The runtime aspect of it further helps in creating a single kernel image > that can be run on multiple devices that require different tuning. > > Keep in mind that a lot of RT tasks in the system are created by the > kernel. On Android for instance I can see over 50 RT tasks, only > a handful of which created by the Android framework. > > To control the default behavior globally by system admins and device > integrator, introduce the new sysctl_sched_uclamp_util_min_rt_default > to change the default boost value of the RT tasks. > > I anticipate this to be mostly in the form of modifying the init script > of a particular device. > Sorry for going at this again, but I feel like I can squeeze more juice out of this. This being mainly tweaked in init scripts makes me question why we should harden this for runtime tweaking. Yes, there's the whole single image thing, but there's other ways to have different init-time values on a single image (e.g. cmdline, although that one is usually a bit controversial). For instance, Android could set the min to 0 and then go about its life tweaking the clamp of individual / all RT tasks at runtime, using the existing uclamp API.