Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp629559imu; Wed, 23 Jan 2019 02:51:51 -0800 (PST) X-Google-Smtp-Source: ALg8bN4PgS0Tc7W9M8YDyRIDKQkyIe6gtCrgBq4EdwxdTsVT5akpWNedwLuDHcXQSNhibZmNQSx8 X-Received: by 2002:a65:584e:: with SMTP id s14mr1549812pgr.142.1548240711730; Wed, 23 Jan 2019 02:51:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548240711; cv=none; d=google.com; s=arc-20160816; b=MWtzcStdxD7jdJ6oSKtePrXsdfDe/26BfADGe865vru1DP/0hSQMXGY6xsyHjK6wj9 8Xpj9DUlGSvhgXUsZ8SCRKGrfcswCcgQMcAYWpBkFjjSuZa0HmOcuyvCTuych2N8ae5c 8HZ0fTsNundsgr6tNmwDgV6Zk7wgZAvFKfOF8rvjo6ZToHuPagmbquJn18EXizOALIHq EuzU2E41x2sng7Ql+d3wOTf3TfcOvAZPz15Vi6QrEE2BDm1acCAzQ79xP7TchMtrs52Y XirDKktXQxpn+wSt7ZjhD3ZGdIATjaOxw8bOuNG4iCCaHGd/HbS/ANBhkMjREHY3ebri Elig== 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=Fj8gJSjcxfpZKzVD1byPKkWI9L43yHzy8tX65MS9pj4=; b=y7354EmiRmaOmSWa499mt88kdn5OhaR4SF8+RTWdL0bqrTSW4iZIXn5IELJVOUOzlc rXfP9f1mIWq5A53Vks5xB9+yPQ3BlaRQxH1xrvGoKvBHC8RIHTzWNa52Gds/jt+BoZad spOHgiYnVXQuOc2klB4FTnQbsunqZpKC8NgxnvHg71XVbCjuvPk+obfYH+oGnIOtwggZ Nox4rL0xNPYqx7+x9gDz62XfDujDO7CcNT6vKI0BDwSj++5H8EiEWjlyHzvWebKPZl/N 2QrJ0ZAxjrCzs/OkosAMB/DIaz9VuqYTD6Mo0SgpWEGxDCxfz54F4kLqYtFA5zTCOlaB 7s1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=11PFmFjI; 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 d10si18237318pls.170.2019.01.23.02.51.35; Wed, 23 Jan 2019 02:51:51 -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=11PFmFjI; 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 S1727237AbfAWKt5 (ORCPT + 99 others); Wed, 23 Jan 2019 05:49:57 -0500 Received: from merlin.infradead.org ([205.233.59.134]:42240 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726963AbfAWKt5 (ORCPT ); Wed, 23 Jan 2019 05:49:57 -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=Fj8gJSjcxfpZKzVD1byPKkWI9L43yHzy8tX65MS9pj4=; b=11PFmFjIetN8fpg3V3zQ6ozre 2TxgPww9ShwlgxYApOy4WjTQOydFBeO9jlqRxh0fO88/xP44Z27c+RaznEDY6BQ+jSy/FMVRBDsif o+SiHpkLoKvOLCqTszlVdQxflAOHpIfhyQt67bgkLv7l6qkZVxGOijStDn2kMGRx4A7R4uPZ6ySZx 73IioYcmfczbPq+fnplVeY4a/ITEWMIeTYE8l1qNRmlXwHtHKhARqbC/0n7VzG1JS9PBkvkClFmID gPuFtfIccwKit83Z1ATLO3LKp6OocuNN1ugsnSD8CBv3t+pfLyQlQYz1iPe/p2ye+B9CcgxeT1n4S w8qwh9Emg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmG6M-0002OS-6i; Wed, 23 Jan 2019 10:49:47 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id EC472201EC16C; Wed, 23 Jan 2019 11:49:44 +0100 (CET) Date: Wed, 23 Jan 2019 11:49:44 +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: <20190123104944.GX27931@hirez.programming.kicks-ass.net> References: <20190115101513.2822-1-patrick.bellasi@arm.com> <20190115101513.2822-10-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190115101513.2822-10-patrick.bellasi@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 Tue, Jan 15, 2019 at 10:15:06AM +0000, Patrick Bellasi wrote: > @@ -858,16 +859,23 @@ static inline void > uclamp_effective_get(struct task_struct *p, unsigned int clamp_id, > unsigned int *clamp_value, unsigned int *bucket_id) > { > + struct uclamp_se *default_clamp; > + > /* Task specific clamp value */ > *clamp_value = p->uclamp[clamp_id].value; > *bucket_id = p->uclamp[clamp_id].bucket_id; > > + /* RT tasks have different default values */ > + default_clamp = task_has_rt_policy(p) > + ? uclamp_default_perf > + : uclamp_default; > + > /* System default restriction */ > - if (unlikely(*clamp_value < uclamp_default[UCLAMP_MIN].value || > - *clamp_value > uclamp_default[UCLAMP_MAX].value)) { > + if (unlikely(*clamp_value < default_clamp[UCLAMP_MIN].value || > + *clamp_value > default_clamp[UCLAMP_MAX].value)) { > /* Keep it simple: unconditionally enforce system defaults */ > - *clamp_value = uclamp_default[clamp_id].value; > - *bucket_id = uclamp_default[clamp_id].bucket_id; > + *clamp_value = default_clamp[clamp_id].value; > + *bucket_id = default_clamp[clamp_id].bucket_id; > } > } So I still don't much like the whole effective thing; but I think you should use rt_task() instead of task_has_rt_policy().