Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp503797imm; Fri, 11 May 2018 01:41:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr/iutpI1nd+9ZhliSK9os5OPD/uSb3plEiPHeEYJk+26L7EBTcce3VmS85cBC5UCMmHD1D X-Received: by 2002:a17:902:7241:: with SMTP id c1-v6mr4650938pll.217.1526028117146; Fri, 11 May 2018 01:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526028117; cv=none; d=google.com; s=arc-20160816; b=aQXcRbplEEFleDuSwfKHjDMyXo/4V+CFcPn+8n9KwBAbsgU/Yh1EfqXha9mkONigCe RRMMY6UqxTKIRRU59Q7BT9866Z36jSmBIqhqe58v6JoG2To88Mvx5pbwJ5SZEaP8PnwN bnx9b9JjqQhgkToWWoe1JzBc9/92aDB3cYYOzi2SGA4sYjsuZ6p6JS4GsUfgH2tJ6zMp hSn7I1Ii+y1kF7JkFhqDK8l5/HJ4p10cFqiPDGhWSx7twYzC5tuVhT5fTZJwWb7qalkp tzqPgnNfHxBCJdv+H/9PJWbyKRryeq+OslvMVtkSstV4kcPxtAQcLC5TL08tBZZjRgTM rwwg== 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=8szox/ZBF3J3HET3a5f/fZhCnkm08eBhVytmB6xW2Vg=; b=PiqsENvxnmbeLQekMy9z1zm7cGyse1X457IE1FK+LIOfokhRTbiz6VUuQ2NuynPzLs xFo+mQqSdhpShpTqpyR1s67p79wQ33aHak4Uv1j02knIyaFAcpaOM07+ZxbWSbIeuTcK hfSCd97wqF0qPFXPVy1DEkTt4CbZmasR+CqD1nYxAxe3Nh4QKqmNOU1IlNeXjO7sOkrw qbUu80qyGfTXVMWaAJ7nqDeaEp3KtCILLcvS9UGDB3uEMKTOZVt3p7nIOmYFEEDt27s2 PzNuJzcJEfR8repcDuzmZENaoInfJvQHTSqynD2Cjir04f03QHCA0IwciV1skZru3kp9 xp3Q== 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 t16-v6si2814542pfm.136.2018.05.11.01.41.42; Fri, 11 May 2018 01:41:57 -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 S1752635AbeEKIlY (ORCPT + 99 others); Fri, 11 May 2018 04:41:24 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:38038 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752165AbeEKIlW (ORCPT ); Fri, 11 May 2018 04:41:22 -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 4A4571596; Fri, 11 May 2018 01:41:22 -0700 (PDT) Received: from e110439-lin (e110439-lin.cambridge.arm.com [10.1.210.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 39ACD3F73E; Fri, 11 May 2018 01:41:20 -0700 (PDT) Date: Fri, 11 May 2018 09:41:17 +0100 From: Patrick Bellasi To: Viresh Kumar Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , "Rafael J . Wysocki" , Vincent Guittot , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Joel Fernandes , Steve Muckle Subject: Re: [PATCH 2/3] sched/fair: util_est: update before schedutil Message-ID: <20180511084117.GC30654@e110439-lin> References: <20180510150553.28122-1-patrick.bellasi@arm.com> <20180510150553.28122-3-patrick.bellasi@arm.com> <20180511054439.slrpscgm6ivho5qy@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180511054439.slrpscgm6ivho5qy@vireshk-i7> 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 11-May 11:14, Viresh Kumar wrote: > On 10-05-18, 16:05, Patrick Bellasi wrote: > > When a task is enqueue the estimated utilization of a CPU is updated > > to better support the selection of the required frequency. > > However, schedutil is (implicitly) updated by update_load_avg() which > > always happens before util_est_{en,de}queue(), thus potentially > > introducing a latency between estimated utilization updates and > > frequency selections. > > > > Let's update util_est at the beginning of enqueue_task_fair(), > > which will ensure that all schedutil updates will see the most > > updated estimated utilization value for a CPU. > > > > Reported-by: Vincent Guittot > > Signed-off-by: Patrick Bellasi > > Cc: Ingo Molnar > > Cc: Peter Zijlstra > > Cc: Vincent Guittot > > Cc: linux-kernel@vger.kernel.org > > Cc: linux-pm@vger.kernel.org > > --- > > kernel/sched/fair.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > Fixes and Stable ? Good idea, will add them. > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > index 1f6a23a5b451..01dfc47541e6 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -5356,6 +5356,9 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags) > > struct cfs_rq *cfs_rq; > > struct sched_entity *se = &p->se; > > > > + /* Estimated utilization must be updated before schedutil */ > > + util_est_enqueue(&rq->cfs, p); > > + > > /* > > * If in_iowait is set, the code below may not trigger any cpufreq > > * utilization updates, so do it here explicitly with the IOWAIT flag > > @@ -5397,7 +5400,6 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags) > > if (!se) > > add_nr_running(rq, 1); > > > > - util_est_enqueue(&rq->cfs, p); > > hrtick_update(rq); > > } > > Acked-by: Viresh Kumar > > -- > viresh -- #include Patrick Bellasi