Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3026821imc; Wed, 13 Mar 2019 07:11:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4Jf/Z0FczCzm448Jy8BttTOJUNtXaIY8Mf09/3n84mqZFyaqg2u8sA2cLRRjmw5lITTpU X-Received: by 2002:a63:6cc1:: with SMTP id h184mr40991963pgc.151.1552486265162; Wed, 13 Mar 2019 07:11:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552486265; cv=none; d=google.com; s=arc-20160816; b=uzrcAHJ41vY98r5ZxYTmW5y4jqGy+2/rV+4W5d72tRqUVNr4skeNg1ObiKhb9tXgAt wvFB6RpNJJPO8j4uX+uhyzwaj0eM8tOVrvy5fhlu8T26y3uiJBGBeDsukd6wTac2ETnf +BerHmCXYVsugfYl0DGNUXgDJwLHH2zdwDHH3V5m2SReutqLpLTUSXIMaL+TXx3o564d bS9+e/DidXn22HcaCr/V9gRLuO/khMSTUtW9CvjM+xlqcZ6aDimTqAd7KKwmg+dNRMHn 20KymFuKkq7cgAFanEy0iIrSWfduPh4GUieXNFLEmAoYzIFV+J0jm1tlCqNNwj5Mfan9 mvlQ== 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=1O9otNqbUSZ4NBzoCNgVtlgqndPz2p5r0zu5jHpoZWY=; b=DWemEXpf/oIOMYhqRMD/R4E5h5HQ9b8mDkMxlMoHXrwfO92XIp4YBNbofbDLI03ziT 4vUPpMA9BM7CEMvRL36ZwLkBgvJ0yI5oieAU4l/6gOj+uTF5pMOW+C36QEzIGkTvV95F 1eDEk0gH1fsWgynbk6e2hT5RL9/iIehOfFDXUvLVo2NMn9GXhyOW6MYRFBhC4rxVTGF7 RF5kktE5OXi50NyozM10qkRSiwPGbCqdVmtxQxT4lVpnimtZZ3SQMhcmgWd8iv4DK/eI 8rZgdByL/7oROj2IjfhBjml43qdUbIPN0KV9tzaZ+KrBhWyfAoOhdkdET9RrOJl/JW5M yU1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=R78+p2QK; 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 r15si10859586pls.374.2019.03.13.07.10.47; Wed, 13 Mar 2019 07:11:05 -0700 (PDT) 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=R78+p2QK; 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 S1727042AbfCMOJo (ORCPT + 99 others); Wed, 13 Mar 2019 10:09:44 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:58678 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726624AbfCMOJd (ORCPT ); Wed, 13 Mar 2019 10:09:33 -0400 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=1O9otNqbUSZ4NBzoCNgVtlgqndPz2p5r0zu5jHpoZWY=; b=R78+p2QKmRTcdakB6zwwnzC2z jvh+Z+YNuYmDkU77XSNvqEDlM/DDWIz+C+leyv1FYHdZGLUO+Nlm3upSHtrJRJNT79RjgXzFZCwvo HT3MRUyVEt7VpyYRhkBFyrC8uvhojGqjTd+6jgIk5Dx5Vhes/efFNJu2SAz5zyi/0n87W2zD49axz 1OjZgAGP3xeb+Ku69ZQj4Jtk7M9SRhnMXo87T/9K+cmgjPwTC/W4VSAPB1Oa1v4oVIay94E9aeBI8 nWxRfTaTTV6GpqVYc2AwAse3AUWpNdyudjNYEJH3nZJTdzoclZThP6hReb3AmixPwNzbF9XHNnKME HGSc/MYMw==; 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 1h44ZT-0003Xj-FI; Wed, 13 Mar 2019 14:09:27 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B898B2028B0E8; Wed, 13 Mar 2019 15:09:25 +0100 (CET) Date: Wed, 13 Mar 2019 15:09:25 +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 v7 01/15] sched/core: uclamp: Add CPU's clamp buckets refcounting Message-ID: <20190313140925.GE5922@hirez.programming.kicks-ass.net> References: <20190208100554.32196-1-patrick.bellasi@arm.com> <20190208100554.32196-2-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190208100554.32196-2-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 Fri, Feb 08, 2019 at 10:05:40AM +0000, Patrick Bellasi wrote: > +static inline unsigned int uclamp_none(int clamp_id) > +{ > + if (clamp_id == UCLAMP_MIN) > + return 0; > + return SCHED_CAPACITY_SCALE; > +} > + > +static inline void uclamp_rq_update(struct rq *rq, unsigned int clamp_id) > +{ > + struct uclamp_bucket *bucket = rq->uclamp[clamp_id].bucket; > + unsigned int max_value = uclamp_none(clamp_id); That's 1024 for uclamp_max > + unsigned int bucket_id; > + > + /* > + * Both min and max clamps are MAX aggregated, thus the topmost > + * bucket with some tasks defines the rq's clamp value. > + */ > + bucket_id = UCLAMP_BUCKETS; > + do { > + --bucket_id; > + if (!rq->uclamp[clamp_id].bucket[bucket_id].tasks) > + continue; > + max_value = bucket[bucket_id].value; but this will then _lower_ it. That's not a MAX aggregate. > + break; > + } while (bucket_id); > + > + WRITE_ONCE(rq->uclamp[clamp_id].value, max_value); > +}