Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3027033imc; Wed, 13 Mar 2019 07:11:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGCH6T0XdjFlAg4w7FKrq+Zi/1/EHPBj93TAedRkSFlTHxSUc9H2N65EOASgRmO9R8Q/Zr X-Received: by 2002:a63:f146:: with SMTP id o6mr6876500pgk.360.1552486279966; Wed, 13 Mar 2019 07:11:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552486279; cv=none; d=google.com; s=arc-20160816; b=m4bTkmfExs/HUnRvrW0+gV03XJTfmPLVYGKK0smPsaSzD7Q8zQkwJk4aBpgCZ35hKn zsBFrzjl5kkt3Pa9PuAjcwjlW6D+toV+4XWPZg0w+RYqZiCF/6oeEUfF3m6yv/InYUGA VNo75bOb6Z7sFvKGVv/bbn5ty4PhTqUNZinVOTbyDQU6AEZbRs8/S4jFmfR3cqkHlgfw E2Rq50IAcp/dUdrNGqZtbe+M49I1Oe3dwBX6Bth9YCr5u248Jtbv4zEncrRF06clXojf fw1vEeUSTrjzX0R7XB10Fkf60jduIV9udy3tGOhp1N3dvdIls5qTyuYlhPL2l7FYcJCx hRlw== 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=0U/xQi9K7IvDGR4nV1QNS9lG0XQYKLj9vkt1l56gZ3I=; b=YOxx3CUctayUsajekvIWOkdA5KxYY6nL5gSifh2DMxctft2pd3PZ2Wd+UF4MwQiNqu O6IsqJjM0f/BOUebswChaP7kzl9xIgQweR5x2xhFVyAGe55ZzLxdW8QG9C7DBuZM88VN cWxzYozNxS9DEVuLRh2U6/mqhi4iwsMiNLc+aIiryE7K/Von51haMVh8iD4gnf6qEaVp Z8PjbW00DHiTl1yZ22WIIfU8kxc0FViV1XkhrJgwaTvkBi2Yq4q9pHlpD/vHY3pP/Gjp 9Xzr6N87E6m3SawHoJ/9Ufp68M+i2GdQ6VovvLwQcLwSwXfcwvklGDHEz8qsRQpsVrk5 k9YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=itajYF3T; 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.11.02; Wed, 13 Mar 2019 07:11:19 -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=itajYF3T; 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 S1726897AbfCMOKP (ORCPT + 99 others); Wed, 13 Mar 2019 10:10:15 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:58730 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726626AbfCMOKP (ORCPT ); Wed, 13 Mar 2019 10:10:15 -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=0U/xQi9K7IvDGR4nV1QNS9lG0XQYKLj9vkt1l56gZ3I=; b=itajYF3T4vLAdSA3BYtBabzKP OL1/FjmO74Y5V/4GVFX4tg95Cqomkh04qhLQmeQc6AEX/GS3YkzVNscZ1ibrMmBk14pOduH7naQrV Mutmrn1vq7yS6CADmRPO/AQP38JhE9DUoizC+DEcP4Qazb6aRxx789OCqBKHeLp8KmBc23aSUx42I ZwoTr60rOzig3KV/qDcDu0ElenRkNHsQ8HXcAmo+czoa62cM/WuIw8WCAL1IbSiJY+qsXpBaDF22o 8cBIgY+4KU0jyRATjXf8BTXblWSnq4uaxJJapv/EsLutyPqO1joQBXo/hYbBMmTmPpZ8ztNbxH98R N6Qn5kFlA==; 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 1h44a9-0004jO-Nf; Wed, 13 Mar 2019 14:10:09 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 404D72028B0E8; Wed, 13 Mar 2019 15:10:08 +0100 (CET) Date: Wed, 13 Mar 2019 15:10:08 +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: <20190313141008.GF5922@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: > +uclamp_idle_value(struct rq *rq, unsigned int clamp_id, unsigned int clamp_value) > +{ > + /* > + * Avoid blocked utilization pushing up the frequency when we go > + * idle (which drops the max-clamp) by retaining the last known > + * max-clamp. > + */ > + if (clamp_id == UCLAMP_MAX) { > + rq->uclamp_flags |= UCLAMP_FLAG_IDLE; > + return clamp_value; > + } > + > + return uclamp_none(UCLAMP_MIN); That's a very complicated way or writing: return 0, right? > +}