Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3200493imu; Wed, 7 Nov 2018 06:43:39 -0800 (PST) X-Google-Smtp-Source: AJdET5fVFcD8pITzyE3zykYTN0IHdyE9UuEb15qJFKt023X1Qq7YU8xyEl2lkHO2ImaX6Xm/8iGy X-Received: by 2002:a17:902:2f84:: with SMTP id t4-v6mr465600plb.239.1541601819057; Wed, 07 Nov 2018 06:43:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541601819; cv=none; d=google.com; s=arc-20160816; b=ye2gNJcq+7txuOKLzktC0PdSO40L5Y6sSj5oURkDlCCMaNCtLejFuEnV9UdPSWqjh/ BRHOfY0BDeFEn/VPrKSn2apDMUxHczehyEdZjdL9yqPKXsev/D816KQbItvCp0xLSvou UtC3Y58FGHsNMul7UjAyPel5eVMEXeV3Ar6QQKdESFZkOwOla1wURxUj9rrWW3u6d1UX 8KIVrDXVfOqdWYvnuerynVDM7xwLYru6miwvayrMrY3TEhFsuayxWXcYX30a9vhpu2eU NvRQuH5w9cZkFvIkaaXS1yVMtwHUzfiWJKn/npUUOaxAkPHCFIl96wH2WG6Ip4GE/0Q9 H6Uw== 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=kW150as6jh2xgxsgE/o7JvaN4EvlRt/v4i2mEbQdYJg=; b=rtDK6WUJCo8x7UJpnApaNpG7VeOOPHYXStEWidqYh8ImnGhU6usjUQXI8OwteeLPaM 45g/P3+ehyewWloA32Ixc5xj1Ep47/KLZkTetUuQSEulM03vbar/l2QrlqXJ3fZpbUXM 3r1NXqospr2OiS/dPxTCE8/mQbuqHuoNrTOfhksWK4bOgyjdHs3h3ZGU/K9Iqmh1Fvha IDcyIB1JRzvyaQTENN5yGhf9CkgJar7Ie+b5TPBTnmWiaWkvhVk/ICKsHRvlAcRZf19k TP7PBQtGoGAuzMcBNqzfiiOzmJdKlKQyBVZx4VL4ZuJGVeeCagfVcyNgF2n63dZ71dYo G8Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=BEejzrZt; 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 j5-v6si820309pfb.211.2018.11.07.06.43.23; Wed, 07 Nov 2018 06:43:39 -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=BEejzrZt; 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 S1727286AbeKHANl (ORCPT + 99 others); Wed, 7 Nov 2018 19:13:41 -0500 Received: from merlin.infradead.org ([205.233.59.134]:33532 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726670AbeKHANl (ORCPT ); Wed, 7 Nov 2018 19:13:41 -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=kW150as6jh2xgxsgE/o7JvaN4EvlRt/v4i2mEbQdYJg=; b=BEejzrZt+wWFD10L3pVHREJ4C J/Px4kHhmMU+IMr5Z5GNflhSzdxMS4eX7SbMcXVxpYQFW4dwH6ljw9BiicMSnC3ntqLPJd3fyhae/ 2QsxuI/wYGmnrHUnng4sKm/b9dsr/rzAW2cijgwTbeI9YkU2kF/IRhv+Mgx3ErBvk4lI9uvJokmgV q0aZizfoDVDcZnAajwsu1AoiwdLRPHlOOftD3xzRB5KSy+ebv8NfJHRzdkvWinm3V4JcWv+BNd/+L jPOPc+nXg7IcpGXoK1FCn6iR3c4WL5oHPhxHWlbMEMXgKBklPtxIUzmZMNcfweWbLdPgD5aOzy+GN DD7f0Jtog==; 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 1gKP2k-0006PD-IF; Wed, 07 Nov 2018 14:42:54 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1EB7720284F94; Wed, 7 Nov 2018 15:42:52 +0100 (CET) Date: Wed, 7 Nov 2018 15:42:52 +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: <20181107144252.GG9761@hirez.programming.kicks-ass.net> References: <20181029183311.29175-1-patrick.bellasi@arm.com> <20181029183311.29175-4-patrick.bellasi@arm.com> <20181107121908.GO9781@hirez.programming.kicks-ass.net> <20181107141949.GF14309@e110439-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181107141949.GF14309@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 Wed, Nov 07, 2018 at 02:19:49PM +0000, Patrick Bellasi wrote: > On 07-Nov 13:19, Peter Zijlstra wrote: > > On Mon, Oct 29, 2018 at 06:32:57PM +0000, Patrick Bellasi wrote: > > > +struct uclamp_se { > > > + unsigned int value : SCHED_CAPACITY_SHIFT + 1; > > > + unsigned int group_id : order_base_2(UCLAMP_GROUPS); > > > > Are you sure about ob2() ? seems weird we'll end up with 0 for > > UCLAMP_GROUPS==1. > > So, we have: > > #define UCLAMP_GROUPS (CONFIG_UCLAMP_GROUPS_COUNT + 1) > > because one clamp group is always reserved for defaults. > Thus, ob2(in) is always called with n>=2. > > ... should be safe no ? +config UCLAMP_GROUPS_COUNT + int "Number of different utilization clamp values supported" + range 0 32 + default 5 0+1 == 1 Increase the min range and you should be good I think.