Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp719486ybl; Fri, 10 Jan 2020 05:41:35 -0800 (PST) X-Google-Smtp-Source: APXvYqz2/Cg04Mwr069GC7Xp5LG/QT9n1MMDN2YzI5QEqitMsvRswDV9wcWuE+EIQPPde5U3tVoo X-Received: by 2002:a9d:67c1:: with SMTP id c1mr2760207otn.161.1578663695581; Fri, 10 Jan 2020 05:41:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578663695; cv=none; d=google.com; s=arc-20160816; b=gvk8KUUiH4zDzeKvS4m8OeMCMpVBdRGBMemQjVISXyMAS5pma/64d265gakRKya5uq Lz4zHzYvQ4U5sflu9BuDRHjkq57XkcmAhODKh5jlvM9m/sddKunDD0yInKwr+xdLq+B1 XEIbgke3ZVi1WXKLbrDUS/1wY5eij1r+5NarlvNT5dOhA5X9B0uVRy9pcQWktD3Flwa1 BRNfSsxy6JEufa/1UyVem7c1wOFEjbzqHg1mFL3KTMoK9d0yaz9jPukHIf8E6jER/gt/ wNNuNdIts20d3MQmxy5HOdx0U1Cm8mxAMUxGLxLsAXndazVEiBm69OELf1eiVjSJ/VMf 9tSg== 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=eg00gB5MIhosfgx54pb6m/6BTbun0f1ISZugspfmb0Y=; b=BpuCbQy5fVhgsNLGS5HRV48rp15Mc6AjjrPcwsBragf7jFT+RNNR4Ihm0f6KCEI/ye +Ig5LMZGZMQAWN4ey4jtEor+SbDs56UfpJgos8hBSkYY2EX9DnlLfqJ6cvha2qlxlLBZ eh4Hn5I7bfZUQhQzNSW0zCuCARcooYEDIGktKmZg9kJu26IDxt98falsRwdBv8YuAmvZ AnsXctET0GTKsTSjkCc9o1KbZxU4lCIEitGBRr4f8FfWeq8AQF74ewoJwDBYpZFNvKK5 DWVycY7q+tSnUVfSmrXAHECcdH/Wx7gDtG9OkDmrvU7dUBZO8uTCTXNOHLg2D261BqUZ pdZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=FmFQpjHO; 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 g17si1346642otk.252.2020.01.10.05.41.23; Fri, 10 Jan 2020 05:41:35 -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=merlin.20170209 header.b=FmFQpjHO; 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 S1727639AbgAJNkY (ORCPT + 99 others); Fri, 10 Jan 2020 08:40:24 -0500 Received: from merlin.infradead.org ([205.233.59.134]:40236 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728192AbgAJNkX (ORCPT ); Fri, 10 Jan 2020 08:40:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=eg00gB5MIhosfgx54pb6m/6BTbun0f1ISZugspfmb0Y=; b=FmFQpjHOHVqGjrXsr25KBEkQY ZZWqukYHz+36aJ9r8c/zVY5l+S6Pj+cjcgn2j+tFg5tSMoVNvAyuCHX7YfU282PakvlTT7G+gpLuv A865RDnXjV+NasjD38XTI4f8jhAr4uNVZYhTgy6/zf+JTpCcXgUzk5hOjVv5L0lNyUu3WEwu5eJPC CcBU6coeZW+1sHmoXcQ0NS7wMSys7IG0Ho+my/nmbDXUve77AUaKNITc/WunW4LZ6JkAh0J8Evjl5 Hc82u4te9BuKQLb7Rj/DcrXp4C7RgtwnzfgeeqK9JP6oRh1gDY1RIevO4aikYeE312Oon1thbOHu8 jyvV8Gefw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipuW6-0003f2-M1; Fri, 10 Jan 2020 13:39:58 +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 0AE123043C9; Fri, 10 Jan 2020 14:38:22 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C32142B612615; Fri, 10 Jan 2020 14:39:56 +0100 (CET) Date: Fri, 10 Jan 2020 14:39:56 +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: <20200110133956.GL2844@hirez.programming.kicks-ass.net> References: <20191220164838.31619-1-qais.yousef@arm.com> <20200108134448.GG2844@hirez.programming.kicks-ass.net> <20200109130052.feebuwuuvwvm324w@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200109130052.feebuwuuvwvm324w@e107158-lin.cambridge.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 Thu, Jan 09, 2020 at 01:00:58PM +0000, Qais Yousef wrote: > On 01/08/20 14:44, Peter Zijlstra wrote: > > 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. > > The uclamp_min for RT tasks is always hardcoded to 1024 at the moment. So even > if they belong to a cgroup->uclamp_min = 0, they'll still run at max frequency, > no? Argh, this is that counter intuitive max aggregate nonsense biting me.