Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5908486imm; Mon, 23 Jul 2018 08:05:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfDR20CUxk9DeboQF4ONC38//nLI++X82L3kYbyDzlJI+gJynoPCjQ3nZ4tZ3/OqoCr5NYA X-Received: by 2002:a65:4849:: with SMTP id i9-v6mr12602052pgs.350.1532358330060; Mon, 23 Jul 2018 08:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532358330; cv=none; d=google.com; s=arc-20160816; b=jyWfsHwg7Os4WqQldXQQzHs0kHkAribT7p24bF6CGQVaAm5Tpw6WLoyAgY1o3igl4z 05665gTn7i8D27g0LBuX1xt50tt+Sp9b9hrnoYGlW8/Sr+w0mGg12YAdEaIarm8brqet Yq16CkNL+AeVQwQ4dsPxqab+kzS6SSItUq2UP2OgUqZmZKFQv1d0sv1tV2MaEAtx/G7K d6mPOPfI3CyhyNn8mUTp11xQFkq7Dn0a0+h+Sb4LDTX8F2Sr0uWWTcK5x4X6mqu1NesZ 92mjk8DO74CpvT/rmgc56q4PXDqRbXrC6Gkv91Eu+6OLzwnXSKscHwmq95FtkCYVFHKU cq7w== 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:arc-authentication-results; bh=wUBd2j8jplLD7RHehuHCsnRcyZGtelYkn21XBqtTh0I=; b=xPYGBlK3ShR9xKanQY4+nituisGLsCVF3GJZSfuB1PmYdch8NbK0xmXB1Krv3M47pX 3nGBFNh3URwqwrjUrxTRnZuKu6bgAnrezVsyS8uPO/gg9jS8TV6FpeiSbdIVeCuy9J+n EjQJJtmqeGgSMEmzshLOjF3fx4oBJAzG8nPkce+oMIN/+ZOatBwodM+fMymq5OVhDb29 cpVuAM2pIfin9eXq+FJe7e0OJ+AEEZu2I/xsAl4huMuedNabhSA8jwgXJuv3R0TRPlUH 3of7MCbH2BwG5lou4T5wn4iSwfAPvRN+ZjSdcw/q66X1tFzOWtlAJD/Y4yI4a9c7KnnC kSGg== ARC-Authentication-Results: i=1; mx.google.com; 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 g16-v6si8761154pgk.465.2018.07.23.08.05.15; Mon, 23 Jul 2018 08:05:30 -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; 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 S2388591AbeGWQEd (ORCPT + 99 others); Mon, 23 Jul 2018 12:04:33 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:35306 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388410AbeGWQEc (ORCPT ); Mon, 23 Jul 2018 12:04:32 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C0E2818A; Mon, 23 Jul 2018 08:02:54 -0700 (PDT) Received: from e110439-lin (e110439-lin.Emea.Arm.com [10.4.12.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 21BC43F5D0; Mon, 23 Jul 2018 08:02:51 -0700 (PDT) Date: Mon, 23 Jul 2018 16:02:49 +0100 From: Patrick Bellasi To: Suren Baghdasaryan Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Tejun Heo , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Paul Turner , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle Subject: Re: [PATCH v2 07/12] sched/core: uclamp: enforce last task UCLAMP_MAX Message-ID: <20180723150249.GD2683@e110439-lin> References: <20180716082906.6061-1-patrick.bellasi@arm.com> <20180716082906.6061-8-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20-Jul 18:23, Suren Baghdasaryan wrote: > Hi Patrick, Hi Sure, thank! > On Mon, Jul 16, 2018 at 1:29 AM, Patrick Bellasi > wrote: [...] > > @@ -977,13 +991,21 @@ static inline void uclamp_cpu_get_id(struct task_struct *p, > > uc_grp = &rq->uclamp.group[clamp_id][0]; > > uc_grp[group_id].tasks += 1; > > > > + /* Force clamp update on idle exit */ > > + uc_cpu = &rq->uclamp; > > + clamp_value = p->uclamp[clamp_id].value; > > + if (unlikely(uc_cpu->flags & UCLAMP_FLAG_IDLE)) { > > The condition below is not needed because UCLAMP_FLAG_IDLE is set only > for UCLAMP_MAX clamp_id, therefore the above condition already covers > the one below. Not really, this function is called two times, the first time to update UCLAMP_MIN and a second time to update UCLAMP_MAX. For both clamp_id we want to force update uc_cpu->value[clamp_id], thus the UCLAMP_FLAG_IDLE flag has to be cleared only the second time. Maybe I can had the following comment to better explain the reason of the check: /* * This function is called for both UCLAMP_MIN (before) and * UCLAMP_MAX (after). Let's reset the flag only the when * we know that UCLAMP_MIN has been already updated. */ > > + if (clamp_id == UCLAMP_MAX) > > + uc_cpu->flags &= ~UCLAMP_FLAG_IDLE; > > + uc_cpu->value[clamp_id] = clamp_value; > > + return; > > + } [...] -- #include Patrick Bellasi