Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3195074imu; Wed, 7 Nov 2018 06:38:37 -0800 (PST) X-Google-Smtp-Source: AJdET5f5xVuCymeta70VbwX1FOUB+DD9UZ4av04Gv9Wp/Upexe3huMMR9jiKyreYzqlJjY0zpZNt X-Received: by 2002:a17:902:9a44:: with SMTP id x4-v6mr454810plv.121.1541601517041; Wed, 07 Nov 2018 06:38:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541601517; cv=none; d=google.com; s=arc-20160816; b=sx+NBi4DmLq9EzQ6S7/Lppl2norisgZKS70FB8MzbHq2+IpSjckU5wc6wYpBws+Cle zBrkK/R6bhdZ92nwud2JlhAexp68g7v/q++8UW6TpTkLg0wPEaCqtyfoNcKlv/N7S75e z3A+2h/CrGcHOEQXWMoans1TYMtgo2a0SRB9p4JLNf2+igAkWHjQggVRwxVU6Sv9SyYd X153EtxqGSxZdbJ0GU5gHDy2mmPeKKK2x/tdVQtpNWGKC5to6+qN+ZkZQlqetYdxkXbt fH+GJ4W3yLFTCly8DLiiO4vD4FqiKsvYoaariRpa+lskBPLrWiuX2U3rV61v3/rHi3y3 spjg== 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=/aj/EsArb9CEadFCqv2LDpL/Pm+9u6CBNIGhuzGKnoc=; b=Nax3VDr5H+4fQFjXJDhlDcl6l5u0+extYm4sxaz2vpYFV/CHKvDEOtN81JSVovnXvx C9XPneQW+/WfP7LQijyg+39JQe/RJVL50eprC/bbkCSCtSVFv1FJp+aBBRuoRqdqKja6 GTvPDFE9ZHOcYYRm/Kj+F6gNZbKhXuQr+XwJMd9tTV5Jr7o+aaBN2HIItjzX5Kr6lazc BfdzuAG3QFmuMOQU7Rm2GjfgpynfeXnDkudrw53AxyE9JUzP/sc/09EflkCP/AnQ9XNF t0KtNXFEqOSHEGqsKLFmRa5rq0DNexKgzUqj23oMPEh0sNE2xatLu39iLmia6/bJ00/j XR5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kOvZzuVf; 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 i76-v6si812364pfi.288.2018.11.07.06.38.21; Wed, 07 Nov 2018 06:38:37 -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=kOvZzuVf; 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 S1730496AbeKHAH7 (ORCPT + 99 others); Wed, 7 Nov 2018 19:07:59 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:36720 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726635AbeKHAH7 (ORCPT ); Wed, 7 Nov 2018 19:07:59 -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=/aj/EsArb9CEadFCqv2LDpL/Pm+9u6CBNIGhuzGKnoc=; b=kOvZzuVfWuZjw2L8RWjDUfRC/ 1jj8Rdc5spnWoSghouMRnwmGNRY1rYNbRrRyatSioSzwff+vOH6mvYe7bK2JTsE6CGCHe4DngcHgM cXxTKkas2POYsuq5mSVDHfZ/4vZcrFyo48U40rAL+7fMB0+USS1baelfuphThB5cZ9+RngRkPz0xJ IMPCe8ETobiCX/uviP6BJBmDbCuMmsxbQtDEjcLIj4EYNGbyqPnYx7OnlrV1wrrS1wH0X4sCpEmvu smY+wpj+0N5+azPfpq6Dmcz9IggunP170wnmOU5b1eLlCTifowkAAbkV4aCaCRX0kpjjsQPEoAqxb toDhq58mA==; 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 1gKOxH-0003kn-NO; Wed, 07 Nov 2018 14:37:16 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 498312029F883; Wed, 7 Nov 2018 15:37:13 +0100 (CET) Date: Wed, 7 Nov 2018 15:37:13 +0100 From: Peter Zijlstra To: Patrick Bellasi Cc: linux-kernel@vger.kernel.org, linux-pm@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 v5 03/15] sched/core: uclamp: map TASK's clamp values into CPU's clamp groups Message-ID: <20181107143713.GS9781@hirez.programming.kicks-ass.net> References: <20181029183311.29175-1-patrick.bellasi@arm.com> <20181029183311.29175-4-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181029183311.29175-4-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 Mon, Oct 29, 2018 at 06:32:57PM +0000, Patrick Bellasi wrote: > +static int __setscheduler_uclamp(struct task_struct *p, > + const struct sched_attr *attr) > +{ > + unsigned int lower_bound = p->uclamp[UCLAMP_MIN].value; > + unsigned int upper_bound = p->uclamp[UCLAMP_MAX].value; > + int result = 0; > + > + if (attr->sched_flags & SCHED_FLAG_UTIL_CLAMP_MIN) > + lower_bound = attr->sched_util_min; > + > + if (attr->sched_flags & SCHED_FLAG_UTIL_CLAMP_MAX) > + upper_bound = attr->sched_util_max; > + > + if (lower_bound > upper_bound || > + upper_bound > SCHED_CAPACITY_SCALE) > return -EINVAL; > > + mutex_lock(&uclamp_mutex); > > + /* Update each required clamp group */ > + if (attr->sched_flags & SCHED_FLAG_UTIL_CLAMP_MIN) { > + uclamp_group_get(&p->uclamp[UCLAMP_MIN], > + UCLAMP_MIN, lower_bound); > + } > + if (attr->sched_flags & SCHED_FLAG_UTIL_CLAMP_MAX) { > + uclamp_group_get(&p->uclamp[UCLAMP_MAX], > + UCLAMP_MAX, upper_bound); > + } > + > + mutex_unlock(&uclamp_mutex); > + > + return result; > +} I'm missing where we error due to lack of groups.