Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2122022imu; Thu, 24 Jan 2019 07:34:52 -0800 (PST) X-Google-Smtp-Source: ALg8bN7a7PenYbK4+RJPUT5xFxW9XY4ZrAURrjN/UfQdtENhzbt31uZNGmR6Oq8Up/NR2r18m23F X-Received: by 2002:a17:902:b20e:: with SMTP id t14mr7039391plr.128.1548344092496; Thu, 24 Jan 2019 07:34:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548344092; cv=none; d=google.com; s=arc-20160816; b=Kc4H2RbkHUCFegEyvw2xTgxTddlnKSuWwMtYN6hpwUZy5wstwNYiMnnwFFSuQ02dFU lTEFuqPVmNMDdWxdQDbTy3LiCl6kCXONtU1acRHU2ClW4sxhEaa1nFSfeYsxVORPcXJo JcbIfgQshuhE91E8MeF7wNYQm7VevO2wCHHIzcGKeFyLBvyAri+EQXoakz4XPj+GKD53 RLLGJeh/XMKmU9uVJXlzOuM59akuzvoaONziQHpFYPVIjwb1ssxMoMQGXEpyt2+w+C1G gBsspu7aS2jiDWGV3IdJaYQdtQ0FVL9PPzCzb/t7A9Wy073Un7jFgvsF0dxOgTtJDl7a DvaA== 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=WpLt4VcRsTHzzzmGG2pnpjIihvx+8RyruObT+Y0/t8Q=; b=DMUSW822lKM2AIgOsclOkOPp4flUwLhUOGXDYynZvL6ZdKAuGlUPf8D4VSWOrVZhjS F40rS7XunQKVPO6QdSR9owgOqAXaiFX64Dmhv18DVSWoV7zQjH1n5Lu85tcyJW/JlebG 7McdxtuyEFaeMoEagHB4kj2qjLFURFp5N9FZDFtYXKR6XENeZgS3I/Ge9CevreUx3hZp xgHy/D9G2w8FztNFqX9km+jtVtQ9aHjoCc3rAMzd5hjGiV1J+brVJMThxSOkm2eQoWEL PIo+2VAyl0MZTk1i7XaHMyKk3MEMzEqHKJpkGUyl/CF8Rr5AqMfe9N+qpvUjDXDLr9E/ HS0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=BzWQhJ+P; 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 g21si20497308plo.435.2019.01.24.07.34.36; Thu, 24 Jan 2019 07:34:52 -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=BzWQhJ+P; 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 S1728079AbfAXPd5 (ORCPT + 99 others); Thu, 24 Jan 2019 10:33:57 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:44554 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727649AbfAXPd4 (ORCPT ); Thu, 24 Jan 2019 10:33:56 -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=WpLt4VcRsTHzzzmGG2pnpjIihvx+8RyruObT+Y0/t8Q=; b=BzWQhJ+P0f+SVyfn0/jXxNyAA ggTwOs9n/zJIbOYa/WGcEbT575BWfmmr/qo4sV88MkgJB6whq4V9JYFH5zpy3hhRW/lCelfFxPopJ sXjjhmtxQzDxgV3/dtJAEOBQrrrz1HQTOWjpdkrqpbu2tm2M7zx3ElJcEYKNhQDG7qp4wvb5tPCxe /Y4YShOs5gPJBL0iU5B/rNP2lWGd/gEJ4C/pISs8SdDk16dSKDpR6REzj6h7TshPue+ZyhlkNRg+9 X24rySOzT0mVCcPWN5yCsAUprt6EcXjvdIPAkF3YOOMqzVsoZzljJNLrQ3zx80YMbnT66LciPUGjv GZUy2glrw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmh0q-0003xg-IM; Thu, 24 Jan 2019 15:33:52 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1418E20D1512E; Thu, 24 Jan 2019 16:33:51 +0100 (CET) Date: Thu, 24 Jan 2019 16:33:51 +0100 From: Peter Zijlstra To: Patrick Bellasi Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-api@vger.kernel.org, Ingo Molnar , Tejun Heo , "Rafael J . Wysocki" , Vincent Guittot , Viresh Kumar , Paul Turner , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan Subject: Re: [PATCH v6 09/16] sched/cpufreq: uclamp: Add utilization clamping for RT tasks Message-ID: <20190124153351.GR13777@hirez.programming.kicks-ass.net> References: <20190115101513.2822-1-patrick.bellasi@arm.com> <20190115101513.2822-10-patrick.bellasi@arm.com> <20190123104944.GX27931@hirez.programming.kicks-ass.net> <20190123144011.iid3avb63r5v4r2c@e110439-lin> <20190123201146.GH17749@hirez.programming.kicks-ass.net> <20190124123009.2yulcf25ld66popd@e110439-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190124123009.2yulcf25ld66popd@e110439-lin> 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 24, 2019 at 12:30:09PM +0000, Patrick Bellasi wrote: > On 23-Jan 21:11, Peter Zijlstra wrote: > > Anyway, once you get range composition defined; that should be something > > like: > > > > R_p \Compose_g R_g > > > > Where R_p is the range of task-p, and R_g is the range of the g'th > > cgroup of p (where you can make an identity between the root cgroup and > > the system default). > > > > Now; as per the other email; I think the straight forward composition: > > > > struct range compose(struct range a, struct range b) > > { > > return (range){.min = clamp(a.min, b.min, b.max), > > .max = clamp(a.max, b.min, b.max), }; > > } > > This composition is done in uclamp_effective_get() but it's > slightly different, since we want to support a "nice policy" where > tasks can always ask less then what they have got assigned. Not sure I follow.. > Thus, from an abstract standpoint, if a task is in a cgroup: > > task.min <= R_g.min > task.max <= R_g.max > > While, for tasks in the root cgroup system default applies and we > enforece: > > task.min >= R_0.min > task.max <= R_0.max > > ... where the "nice policy" is currently not more supported, but > perhaps we can/should use the same for system defaults too. That seems inconsistent at best. OK, I'll go have another look. I never recognised that function for doing that.