Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp826281ybl; Wed, 8 Jan 2020 06:32:40 -0800 (PST) X-Google-Smtp-Source: APXvYqzMvOOEgccQrAQdf4ccc6fhePgFvSUWbjpplnYWWydMcXZfL6Pp+bfHNCq+mmBtjWmYT1Y9 X-Received: by 2002:a05:6830:139a:: with SMTP id d26mr4525705otq.75.1578493960327; Wed, 08 Jan 2020 06:32:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578493960; cv=none; d=google.com; s=arc-20160816; b=vmkAJH5K80YIe8dO4OAX1Grh0ieDcaR1q5ZApFl75JZBuasf8o67ukfpahsRgkFk7Q oTJvvCjbhdIt9dvEhLn98OeG6WY8pcTIZfvgVGLJkFXn8CZb+Ffk16iWbNbjMO8McGfH y29YQa3vwiuZso+OERKS+81z4i8Jb3cw7p7YVC1hBplhREdD/9Dkq+uQEVorbl5hhrbh uWhPQyMnhkXniGJcGJhp/emFl2rwPqMHLFaYqSeLJs8+QJ9bBLxRhoHl+Ty+oQcX5Oxm f6iKZm9Smb2x0TOuH5jATFOvgbe5t8N5ND3JzH2I0b3/ojqB+MZUxcj6R719ioiJuExW 4+8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Wk7s5uy/Dgrq7F8jPCUqmm6ORQULcEXjI71y1YxQTGA=; b=C9m6HhHns8Fk9UYWsnfG3KhOJqyqxthgGXQMk/1P7c5n/He++7QemxOoMnv37Iy65f SPdMBf0sts2HZ0B5D5w575821jHfdRQTNRv/TkDsGJTyXPc0ux9ywOlVxP+XSJ3Y68bm 9KuMyn0/fmRW/ji1f44QQ6yZZXmDwrmBnci4I2mAZydJCmc1X3R2CCQRn92To4NX+NC4 P+HIHFVRWgoIwYV075MQVah7pZ0MpLJOmztNzGPniGVcx+pBcenbFcxgKZnEzO1qz13N bDkdfDH1Z9Nax/LLjrNYIW3PcTH410z3+D/zVUsZP7mV4Bxh/xYWQ9tyTKmeP6E6Yu5a xoPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Rzo0ZjCs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f81si1879457oig.110.2020.01.08.06.32.26; Wed, 08 Jan 2020 06:32:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Rzo0ZjCs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728369AbgAHNpH (ORCPT + 99 others); Wed, 8 Jan 2020 08:45:07 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:43632 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbgAHNpG (ORCPT ); Wed, 8 Jan 2020 08:45:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Wk7s5uy/Dgrq7F8jPCUqmm6ORQULcEXjI71y1YxQTGA=; b=Rzo0ZjCs0fX38OXa1TaOnUpRs Wotv2f5MlC0vVaJaDFXtwg0rojTCeEDsqK61OP2S8dn/iSQDfvmZywW79em3iK6rF3e35yg+Aly29 iKEoIYC6MsV1jhEXnOFv5gmU+pVNDANpyvxi4vHZSHN9FCYH7bb9380cmfXFsuxJe8T2Hk/P2q8k2 vO9K7RQPxkQI+be8bALGDPhjCirrEDWMLDyBN6mNB46GF9lD+SX7oF1psRDxb3KTdrR+eI43TF/mA 7jEXnwBqcwmxAnyyNtCQuAT4ShB3NXrWNRQpsnB32Y25682Uz8k3iwdBQeF8ddAGrIp5N13HX/LIs sxs2uuV1g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipBdj-00078N-Vr; Wed, 08 Jan 2020 13:44:52 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 015D730025A; Wed, 8 Jan 2020 14:43:15 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id EE10A201CE313; Wed, 8 Jan 2020 14:44:48 +0100 (CET) Date: Wed, 8 Jan 2020 14:44:48 +0100 From: Peter Zijlstra To: Qais Yousef Cc: Ingo Molnar , Dietmar Eggemann , Steven Rostedt , Luis Chamberlain , Kees Cook , Iurii Zaikin , Juri Lelli , Vincent Guittot , Ben Segall , Mel Gorman , valentin.schneider@arm.com, qperret@google.com, Patrick Bellasi , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] sched/rt: Add a new sysctl to control uclamp_util_min Message-ID: <20200108134448.GG2844@hirez.programming.kicks-ass.net> References: <20191220164838.31619-1-qais.yousef@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191220164838.31619-1-qais.yousef@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 20, 2019 at 04:48:38PM +0000, Qais Yousef wrote: > RT tasks by default try to run at the highest capacity/performance > level. When uclamp is selected this default behavior is retained by > enforcing the uclamp_util_min of the RT tasks to be > uclamp_none(UCLAMP_MAX), which is SCHED_CAPACITY_SCALE; the maximum > value. > > See commit 1a00d999971c ("sched/uclamp: Set default clamps for RT tasks"). > > On battery powered devices, this default behavior could consume more > power, and it is desired to be able to tune it down. While uclamp allows > tuning this by changing the uclamp_util_min of the individual tasks, but > this is cumbersome and error prone. > > To control the default behavior globally by system admins and device > integrators, introduce the new sysctl_sched_rt_uclamp_util_min to > change the default uclamp_util_min value of the RT tasks. > > Whenever the new default changes, it'd be applied on the next wakeup of > the RT task, assuming that it still uses the system default value and > not a user applied one. This is because these RT tasks are not in a cgroup or not affected by cgroup settings? I feel the justification is a little thin here. > If the uclamp_util_min of an RT task is 0, then the RT utilization of > the rq is used to drive the frequency selection in schedutil for RT > tasks. Did cpu_uclamp_write() forget to check for input<0 ?