Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3169021imc; Wed, 13 Mar 2019 10:31:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8goGtkQNI+Qpb8jJvfgzyU6tOs5ScdCRvRTdCxhpTmXqhZXxqwNxaPEvmvga1Dh5Ocxyv X-Received: by 2002:a63:1354:: with SMTP id 20mr15405205pgt.198.1552498296138; Wed, 13 Mar 2019 10:31:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552498296; cv=none; d=google.com; s=arc-20160816; b=g7AMJIhn04+eG9/G3ikrvE+4s/AAw84Nt/yQWnU020KgenwtIBHmfCKo5Ipcs5Pw/I 5HTVd5R1zKAxIZulPS0k0WtViX0CG7+bLIUmhHd45Widu43/DuIKWgvK+f7Ik70Sk0nM xisEfgNMzoaHZu+F4zvWERtVhCVqZea4PWhLaG7tKkbdxdEZX6/8rR/OcIVmwQpcEMIs 1GteShZwF3D/zyg2AXbWcby1BrRBPi6ZJ3JzYyT+C8i6SJs+luFSfsFfxk/RYj1EPwu6 85lm+5o3SMxQRZQ1rd0mHVnoV0BYy3ZoVjLuR/aCHTQT4mUppXUC9mFO6B8Qk1GwRX6I whlw== 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=HF8nBaZuvTKqYBvaf8Cxq+aLjj2KM4OBQgPcDV3n/S0=; b=kfQGrieKElNDSDrIPiTPFbnWF5jnDeEN0bG9dETSbD5PcQFmk/OPJgz1lnNkqTloUM yev2x6ccJEGGE8OGmpVtz54buon4t39I3mpYE0zX9LZdS8j9aNzxVqsepOIZapmnvDXZ dWA4l6iVjPOGHGwgRxJgq+fClJ7wJlrWgUjLHu0CiQPHdDKx5/vXKo8GJbdRk2gvlyvY CaGYRFlYEAdzqFojkGcz/JRevJjJGONXs8hvCO4NoqMP/aq3NRCh8nYho7gf7IxJJERV KcU0guYBmz4s3jdZQeNdQQu7jr5aRZn1WYxPWjnLTv+UfReEp+oPjarAjAFG62oGLxxq 07Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=az06I3Kk; 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 n19si10644420pfb.189.2019.03.13.10.31.20; Wed, 13 Mar 2019 10:31:36 -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=az06I3Kk; 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 S1726730AbfCMR3U (ORCPT + 99 others); Wed, 13 Mar 2019 13:29:20 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:41974 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfCMR3T (ORCPT ); Wed, 13 Mar 2019 13:29:19 -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=HF8nBaZuvTKqYBvaf8Cxq+aLjj2KM4OBQgPcDV3n/S0=; b=az06I3KkjRxRL8C0HTvgN2wvA 2JtvHxA9inHUVprTPF14jAmveXClI5SfyUpS/YRZ2nJVIzYdSEBPjhrtAxlGFR50vW9kjKoAxa5xS uH4bbI/JO3/4kbq8SGjV082QE/0atD2QNgxu4QFzVt4gOyHA5PYk2aoyf9p1X0Hm/TKc3jtpWxXu/ sTC70g4FcT4ojaPGEE6Eu5EYGpTa0NBxJFq4PECrT3Y/VvE5HGMlS1yWwrgdRLp142rk0TAmieZ4u PFFrvXfswGlxsnEWt0VtCaqhppL2U3H6j8vd+war1lnWLtL+svrEvOu7Fqj49dZngwUjqdWtbbzK/ Lag9DwabQ==; 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 1h47gn-0000CJ-K4; Wed, 13 Mar 2019 17:29:13 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BDA152028B0F8; Wed, 13 Mar 2019 18:29:11 +0100 (CET) Date: Wed, 13 Mar 2019 18:29:11 +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: <20190313172911.GH5996@hirez.programming.kicks-ass.net> References: <20190208100554.32196-1-patrick.bellasi@arm.com> <20190208100554.32196-3-patrick.bellasi@arm.com> <20190313141008.GF5922@hirez.programming.kicks-ass.net> <20190313162051.djiu5dwc5ahp5p5p@e110439-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190313162051.djiu5dwc5ahp5p5p@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, Mar 13, 2019 at 04:20:51PM +0000, Patrick Bellasi wrote: > On 13-Mar 15:10, Peter Zijlstra wrote: > > 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? > > In my mind it's just a simple way to hardcode values in just one place. > > In the current implementation uclamp_none(UCLAMP_MIN) is 0 and the > compiler is not in trubles to inline a 0 there. > > Is it really so disgusting ? Not disguisting per se, just complicated. It had me go back and check wth uclamp_none() did again.