Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3397614imc; Wed, 13 Mar 2019 17:31:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+VGYYchzVGf/ZOs1/SO4yto8uOFdmgayfH3RYwbOFl03rnii4PzC3Id5BFh63SA93oQc1 X-Received: by 2002:a65:5286:: with SMTP id y6mr25449759pgp.310.1552523481543; Wed, 13 Mar 2019 17:31:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552523481; cv=none; d=google.com; s=arc-20160816; b=Fv7xmww9KJgmas3s8kof/7ES3FbPZ303Ys/JE65AVUH7XJdE4zCKwxpvEhoj1MEg3v jZ/w1dkMrjbb3TSmCOUZepuBdO8vlUHFk9Kf3wLiJLE0wXtRe3+UqaTTHdk71/GN60Zx Ycg/dRpbJasnlAMfAZygzXeF5jvWMJo3jBmEvOtG7OsnVp0lpP1TwYlLuGKXC+PHUBpP i5qMgV7DUXxPESLtTjpUl0ZoN8oiijrzouOQAMPr1DI/sA4PIRxfjWBYHTxP7rcJYUW+ JgxRv/yMQOyNlC0Zs2LTF8hkxO3YdhObBy/PddNiUrypOAuW6xQ1TrRt7i7ZYjfqFaKR q8nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bA6I4b+KNoyWDW/ol2Rzv/zK7atLFhqyLkmYsEnI5DE=; b=dyClMDADd9PQkLGABGaNs6AlU9Osutd6ngr4xzDYkgdMfJbYyMIhZ0qGSrjSECLvNd cNflX9R4w8VE3ehbOH8QrPN8EXEEoaOwIPrFLDXnUjk6aUr4JaXh+qUuojDCA8buMxIn YXFB7kMzrny5x88/rkAlsLNiICv+sq9HBu79Kr5DVrUeOk66nRVe5E/lcKaoern/+sf5 FXtIfmoMZptOrC0duVmnS3mdVx4y7vxPXCXJvBCTjTHhL0tjKnsSoUQCml8ezaPYg0YJ 0pSrrbUJwZBlGPkbXW0uHwvdjsYOqWOPiaY3XvQQN4OduM1mi/25T3pmy7kQ1BK4yZU1 09LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=SCgjYU7i; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n16si11283308pgj.27.2019.03.13.17.31.05; Wed, 13 Mar 2019 17:31:21 -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=pass header.i=@google.com header.s=20161025 header.b=SCgjYU7i; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727001AbfCNA3a (ORCPT + 99 others); Wed, 13 Mar 2019 20:29:30 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36611 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726477AbfCNA3a (ORCPT ); Wed, 13 Mar 2019 20:29:30 -0400 Received: by mail-wr1-f67.google.com with SMTP id g18so3962133wru.3 for ; Wed, 13 Mar 2019 17:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bA6I4b+KNoyWDW/ol2Rzv/zK7atLFhqyLkmYsEnI5DE=; b=SCgjYU7iw0BdvgnDh/XKa4WtbEgtobbLXGjxDTMxfx8eeFZO41XJVgc1ZE3//MKWrs CrGOZKcf5uX1nRHBcBtp2/Dzdvp3Xs/Q5bn3ewEgny6YlgqX7aVZ5bKRBhAaSF9T5CJd YJ2HH4kjLrhNfw5mkntbf95kT+UgXmVR1wobcoTcf8F0hbTjsEUl0liPdliFG234NYe6 hWzqCDEIHg13rd/F1NXcJSh5Mkw4wQ0q3uKHmTQfhFk95H1tpX3ohcCvD3bRaMYuA5vh fE0yVftU1a/lljcaOPbJMxGDr+OA9AnzTmN1jVXsUqehHeNr8y6glS4Rgw2DprJjT1bB /gEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bA6I4b+KNoyWDW/ol2Rzv/zK7atLFhqyLkmYsEnI5DE=; b=uQ1wFY9gg73HaKqG8PO+IVey9mfxk5jJPjIczSD2ojXD+ZOM8FlhaCyzqgHuGx/K0z /M2YJKfwViMlazLltYAbfrWeAIk4c78+KHFxAZg0IY7/V7wJieuA+5YZ1lWpc4A04Xht VuHHP7j3eSavNYnyWzGIxbIdCSG3bno3TKEMjv2JYD39PaPPQUWG3lJxffMGCM1KofCi UHzJn2AEkd/wUdIHmLNPB/s3BGW2PPJ5QrSpHHQ2YL1lNHOJIqvGLxm4kGV1qOsMbH/p 99Fi0aIrrOlEQJB9eUHgOdsgqAXqFJZYqgnKj4EmfrQ/XE8ivMDAFlkIOlqSDMwQcapn 7lbA== X-Gm-Message-State: APjAAAVuxQS9KvmMeel/FcM4T8JF9xDpxyK15sFODZPeBO8D4eZRqaZL hcxkVD1DtdFYVdsVX3EDbBC5yrRfUoNH9ZOpeceG/VZd76Q= X-Received: by 2002:a5d:40c5:: with SMTP id b5mr30091307wrq.107.1552523367691; Wed, 13 Mar 2019 17:29:27 -0700 (PDT) MIME-Version: 1.0 References: <20190208100554.32196-1-patrick.bellasi@arm.com> <20190208100554.32196-3-patrick.bellasi@arm.com> <20190313141253.GG5922@hirez.programming.kicks-ass.net> <20190313161646.fp2gswuqgzi7z7ow@e110439-lin> In-Reply-To: <20190313161646.fp2gswuqgzi7z7ow@e110439-lin> From: Suren Baghdasaryan Date: Wed, 13 Mar 2019 17:29:02 -0700 Message-ID: Subject: Re: [PATCH v7 02/15] sched/core: uclamp: Enforce last task UCLAMP_MAX To: Patrick Bellasi Cc: Peter Zijlstra , LKML , 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 Content-Type: text/plain; charset="UTF-8" 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 9:16 AM Patrick Bellasi wrote: > > On 13-Mar 15:12, Peter Zijlstra wrote: > > 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. > > Right, the code is clear enough, I'll remove this comment. It would be probably even clearer if rq->uclamp_flags &= ~UCLAMP_FLAG_IDLE is done from inside uclamp_rq_inc after uclamp_rq_inc_id for both clamps is called. > > > > > + */ > > > + if (clamp_id == UCLAMP_MAX) > > > + rq->uclamp_flags &= ~UCLAMP_FLAG_IDLE; > > > +} > > -- > #include > > Patrick Bellasi