Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3212808imu; Wed, 7 Nov 2018 06:54:50 -0800 (PST) X-Google-Smtp-Source: AJdET5ejfTLE+BM/chm6A86JQr0r20uuurVyMYLlkIp7tTjHuPrDiBIYfkoVnjIw0MlacfepPjB4 X-Received: by 2002:a63:9041:: with SMTP id a62mr427590pge.163.1541602490647; Wed, 07 Nov 2018 06:54:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541602490; cv=none; d=google.com; s=arc-20160816; b=ieRXcrraskxEJHxdEh5lnYj12Z4A/m4dXGaVTPoDzr6QQGCwAXE6IpdmT+TCB8KX9T 6URehnNVRCBT+U/lhUKD5bKOobv4cI969faCLWEJGf5LgYU8yu59KiF4jIDvG/HNz+5b JEOR+vQ+p/Im6jqKnSMvFKdXcT8HuSUC1dd5e6udsZiK48QGrxdYfvOxDOKmflN2tILs BSFriRy+YLoemyXCaygWd8l7roPFsFq0+R9ZZwJ2vWhExmcOow14L47C8MueZhJBMRcG spG4JT5rBoXAywNLOOEtCgWu5163qidmJEixcyG2kGrK5aN9sG6vN/rmttrClhSr/4ob Q6Pw== 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=VEas2bvWIPlbsH8ocLf/ZIDX2qPtkc4fhgwTP0V+3IU=; b=eX+0Dhd0Lf5sVToLv9z7GrNo6mt0qxXF+K+o1o6xC9lOgT2AriJZvnuLwcxnK1pGaq jAQCwOodDr3AuKayF+y1WJyOaToIu01UJxkMhVBxy2+jRL3xMK2TgfOjyfmN0dp7YkFE w7ruqKVw78DB0T+nGsTXmvfUBpMamDgfejeL9V+38fHl6R1yD7EhvX9yLoROthyF5Af1 t4IxFSxNnAHUrcIt3SooZyeWkvgGZhpiOA0SFQ7epy5AqUhcssQexSfdCSlWvO1inBiF Lz4UaIo0oV65GfmOqVLVLF/mAadJCY3oHd85DMIktwn2ZQTxwh7oCYIp6D6rC0jpibr6 kiRw== 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 go17si853962plb.266.2018.11.07.06.54.35; Wed, 07 Nov 2018 06:54:50 -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 S1730853AbeKHAYm (ORCPT + 99 others); Wed, 7 Nov 2018 19:24:42 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:52030 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727693AbeKHAYl (ORCPT ); Wed, 7 Nov 2018 19:24:41 -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 DF72380D; Wed, 7 Nov 2018 06:54:00 -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 1DDBB3F5BD; Wed, 7 Nov 2018 06:53:57 -0800 (PST) Date: Wed, 7 Nov 2018 14:53:55 +0000 From: Patrick Bellasi To: Peter Zijlstra 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: <20181107145355.GI14309@e110439-lin> References: <20181029183311.29175-1-patrick.bellasi@arm.com> <20181029183311.29175-4-patrick.bellasi@arm.com> <20181107143713.GS9781@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181107143713.GS9781@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07-Nov 15:37, Peter Zijlstra wrote: > 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. Again, after: sched/core: uclamp: add clamp group bucketing support we should never error. Perhaps I should really squash the bucketing in these first patches directly... lemme see what's your take on those bits, if you like them better not in a separate patch, I'll squash them on v6. -- #include Patrick Bellasi