Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp844845imu; Wed, 23 Jan 2019 06:43:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN5UjFMDR1DYRBixBNYpQZcqZjl3l/BuZMjAPg7bqQp1u2eEQYsfIGdaQ1Vc1EHVdxUE/QoB X-Received: by 2002:a62:9657:: with SMTP id c84mr2268497pfe.77.1548254610534; Wed, 23 Jan 2019 06:43:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548254610; cv=none; d=google.com; s=arc-20160816; b=HX/eYBmaUubYxYeGTw3Jdiz5b7ifF4LKdT+HPdZYDi7D4UIBcu0ZCHuq4FOkvK3MNy B+kReoF/FCJfj9kdg1krxhEtGBBUf9JqmnqrTXUkBX/IPdhmISLNRXLR15v8YGQ/gUpf HJqBiFyFQAAGZoQNbXjjQ2X0aIracGM/v0z2HTjMOoXmjXChhOKb9cLcLJGnnY7zlH5o vCXJQ16fsppAEkCX3AOFo/gMqEJ4dmUu3qWV34hPOfcw4W+g2+fs5Wp1xEEEbUXI7ma8 tKWzSvTpVjyiiup0zH94UC5ku6gqfIdBfEeyGcKoEQDs7LoDkpjxUzFoUmu8ZSOxkW0n Op1w== 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; bh=F0pe7u0GBR+zvH0wZ4mg2WWKIQ0xd3gLPeQppBOCQUg=; b=C9we/iwiQQsCN/obKGELiSgt/VvWdktt22Uz9LMl2j4ykPwhlsCy5q5hIIZxkZGUEN gSbzge0Hw7uCKyb1hWCiroysChRqcwI1rfjhzmw5eTQ8wy9ce7DJg7DDbAYM6HuWtBmG qwf66EI9Q2Mg7AUnPMHwvdllIyRGC9dBImOyJqHv754iwHp8+6Vux2XxuJxaHVCtmmju qRc1GSBEk1/AozbmguhUg1BqbEY3WWegrUQ/aLpgXvKbY/ZtWBKyLo4VbERRYEU/Zysj iUyL+73fLElP9TbEi/TfrHQK4X0JfDVOX3zV11oMBfUqzE7KHOj1ZSAmBn4lTlEDQ3o1 Uyww== ARC-Authentication-Results: i=1; mx.google.com; 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 1si19247827pld.239.2019.01.23.06.43.14; Wed, 23 Jan 2019 06:43:30 -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; 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 S1727079AbfAWOkR (ORCPT + 99 others); Wed, 23 Jan 2019 09:40:17 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:42152 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726954AbfAWOkR (ORCPT ); Wed, 23 Jan 2019 09:40:17 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9AB8AA78; Wed, 23 Jan 2019 06:40:16 -0800 (PST) Received: from e110439-lin (e110439-lin.cambridge.arm.com [10.1.194.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A659A3F237; Wed, 23 Jan 2019 06:40:13 -0800 (PST) Date: Wed, 23 Jan 2019 14:40:11 +0000 From: Patrick Bellasi To: Peter Zijlstra 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: <20190123144011.iid3avb63r5v4r2c@e110439-lin> References: <20190115101513.2822-1-patrick.bellasi@arm.com> <20190115101513.2822-10-patrick.bellasi@arm.com> <20190123104944.GX27931@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190123104944.GX27931@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23-Jan 11:49, Peter Zijlstra wrote: > 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; :/ I find back-annotation useful in many cases since we have different sources for possible clamp values: 1. task specific 2. cgroup defined 3. system defaults 4. system power default I don't think we can avoid to somehow back annotate on which bucket a task has been refcounted... it makes dequeue so much easier, it helps in ensuring that the refcouning is consistent and enable lazy updates. > but I think you should use rt_task() instead of > task_has_rt_policy(). Right... will do. -- #include Patrick Bellasi