Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3029988imc; Wed, 13 Mar 2019 07:15:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqySL73+x4QmjlSFn0oCBJJviSJE03Zd3xeVL5FzPLy+r3iuSNXCctKBbrE3TaVadh3O0Oww X-Received: by 2002:aa7:924e:: with SMTP id 14mr44786860pfp.30.1552486503056; Wed, 13 Mar 2019 07:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552486503; cv=none; d=google.com; s=arc-20160816; b=dEHM4z14MjSkNmTerSmaWBQG7c7MyjhsFYUuSHgKKlU8som+KunD1OtI/tY8He7Nk3 MwqnSiqXBgkxQLHrpghc/5BStejrpZ8cUT6VTajLUPUaVNYqORdqqHVvwj3+fpDn+Cr8 yRlrA0hEF1nDkQZ3cRLa72KpLjCDArRi3vM0mDPYABTkpYyDT8kuPlgaeAGp9qeb6Q7I dnZlBHq5o9Z4AnxC2VRkUAWAnMKPJw83nlr1jh1O450gJORX+w3IpxdUPK0m1WV9Gfng ofnKQe2umXvK3oFQnfoJd0NIos7AAvovH2aDi9wXrRUoHga2LLKVzNF3lHf1EwiQx5Pg ohLg== 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=Nk2rYN8eWAnEFbUZXn1m8vUhGEUJxpzQAU+HdaDk3Tw=; b=q+jl2XSAE2bF/m2hIDkdoc3DMm5Ne1NRuHNQHQO4RXA9TZq4F+JlX0GtzBUhJceTYP OVjdjsB/8CMgMnEYbfldcpSbBskvxgA0dEneKv934EJ0pcuiOnoy7OaAd75rvmIiVYXv B7UlYBtQM5vnAWFQidhQImQ9ayvw2DxtflDXx+rL7UjnLjLv2yHfqtBq7jLQ9lPK8Ho3 1w5IphB6MNpNJmupfzbs8x8oN92KbhRgYEtpPIcOst2DJEw++IG1iDPXZqhVbmbwPmft n/QOXNw1mL5PM6REEoXr/iIpxO1HQeo8cI+/JR3uy3fdWMdHB4AuPDLzY69lsmnpj5H+ gDZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Az3G3EIM; 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 m3si9791445pgp.263.2019.03.13.07.14.46; Wed, 13 Mar 2019 07:15:03 -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=merlin.20170209 header.b=Az3G3EIM; 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 S1726680AbfCMONF (ORCPT + 99 others); Wed, 13 Mar 2019 10:13:05 -0400 Received: from merlin.infradead.org ([205.233.59.134]:49372 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726579AbfCMONF (ORCPT ); Wed, 13 Mar 2019 10:13:05 -0400 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=Nk2rYN8eWAnEFbUZXn1m8vUhGEUJxpzQAU+HdaDk3Tw=; b=Az3G3EIMbw1KH1vF+RLU6038p oj0unAwuH5QJXekw6Ke16SBwlkVpPgE/4jG5eK4gr3cLEfhcbRUV47C7SJ++T8HDYARDzVLIUBUAG 8amqZlfHrvclgO+GCzXxKeSicdh/V8sIvoanEa8ikhndiFCdJ4G9GghiRnY28lUDg/RnXZGyZJmWS ax4FPCUBY5LXET6Wr8cE2LiniRhuO7O6u2dqBT+kPbaWENZbFsG/4ERZyw0SYS77jEqBDsPaJM655 Rqmji7SrEYHO+wFIwwgYfQf7Vh4wrR0BrAwGfiDhiwAmWWepfsWRqip3Nq7Fg/zYd0BtkUBq9vjPF PRxF8XKnQ==; 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 1h44cp-0003Jj-Eb; Wed, 13 Mar 2019 14:12:55 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E166E2028B0E8; Wed, 13 Mar 2019 15:12:53 +0100 (CET) Date: Wed, 13 Mar 2019 15:12:53 +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 02/15] sched/core: uclamp: Enforce last task UCLAMP_MAX Message-ID: <20190313141253.GG5922@hirez.programming.kicks-ass.net> References: <20190208100554.32196-1-patrick.bellasi@arm.com> <20190208100554.32196-3-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190208100554.32196-3-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:41AM +0000, Patrick Bellasi wrote: > +static inline void uclamp_idle_reset(struct rq *rq, unsigned int clamp_id, > + unsigned int clamp_value) > +{ > + /* Reset max-clamp retention only on idle exit */ > + if (!(rq->uclamp_flags & UCLAMP_FLAG_IDLE)) > + return; > + > + WRITE_ONCE(rq->uclamp[clamp_id].value, clamp_value); > + > + /* > + * This function is called for both UCLAMP_MIN (before) and UCLAMP_MAX > + * (after). The idle flag is reset only the second time, when we know > + * that UCLAMP_MIN has been already updated. Why do we care? That is, what is this comment trying to tell us. > + */ > + if (clamp_id == UCLAMP_MAX) > + rq->uclamp_flags &= ~UCLAMP_FLAG_IDLE; > +}