Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp369830imm; Thu, 10 May 2018 22:45:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqIqdj85f/eofvcuRek7NunHNAwtNhGpGfost1f6A4eY9UnkZnqwT6uYSq84cgH5oQhgYbj X-Received: by 2002:a65:4542:: with SMTP id x2-v6mr3460313pgr.24.1526017513341; Thu, 10 May 2018 22:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526017513; cv=none; d=google.com; s=arc-20160816; b=w2dqcs1v0Gc1mXI0kOHItEIzGEMYvDQqPC3wzUsgvrpw0aZwyyB1zIAavzgcBvOrf4 /4mbZBpGxTDvHR8xvg7eELyzH0zQRN9iYXdqqgSQLYWyKwbD2+AqYYE7rPzb9nEM0DY9 bEtxk8XQvVpmJjjNExAmxyuLVO0OtN1olh32s8yl9xEUJbEiLQ5jQjKu/CC7jty7CgD0 JfgUwtoSiqvgQDy3bCQS8sRArSjf2Tf6dpo/ujZTkYxArngnDAY6u3fE3oc3eqdwUsXD g2a8V4gmgokimpXWsF0j7otjVHVxQv7aG2WW2xe1Y4tLKOt9d4MHys2FwL/2Ejx6KRBe /pww== 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:arc-authentication-results; bh=jOyKC+46uWz2c6XlU56bxkBpqxLKXkfcQtJxc3bCjrM=; b=zzqUWfNqmY9SI/qYpJqoNWicOAIHAbTQQeGJymDgdCEMlgI+fY/ji9fkckc+wJhgMX 5GeOh4ALxzHRexYoqssQVs4Y9TeyK7bHoUml3g6oDv6Y0a/OAZWzjBBMaOUvHJkmLpNF EPWsn3zclP4xzQOsAmFA4y6uBb2+85NfaxS91HZ8EInoMS1KcfgBvSz0COrkJEIEc6sf Pmb5b00MZOVNclStzGX8z2B5mCpc79T14RM09mjUtNvZbUakVt01Ag7fcQbmA+e6/l2e 62XHzTMUcU0QV/qbvrJBHX6l7m3ZXSRI3LqScp4yR2t8Ftgg9STMP0KZRHO2cj8yJ2CW GkYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iBsa1ukv; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 24-v6si2549240pfp.161.2018.05.10.22.44.59; Thu, 10 May 2018 22:45:13 -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=@linaro.org header.s=google header.b=iBsa1ukv; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752481AbeEKFoo (ORCPT + 99 others); Fri, 11 May 2018 01:44:44 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33386 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751947AbeEKFom (ORCPT ); Fri, 11 May 2018 01:44:42 -0400 Received: by mail-pf0-f195.google.com with SMTP id f20-v6so2190649pfn.0 for ; Thu, 10 May 2018 22:44:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jOyKC+46uWz2c6XlU56bxkBpqxLKXkfcQtJxc3bCjrM=; b=iBsa1ukvGTORjSbKM2PGCDvozKM9b7EtUznnntFf80UOuIUrwn2VVTBEblVBe7Jx4K wDFk/vQlT8KlHzAAAcXDzuDoEQqV5N1PTrhpoKQ20U+NFXqkFeaOXF0sFFR5fDePsBei l7U6btHuwtncO/7eZZOFTMhh2WKyCvTkzzeuk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jOyKC+46uWz2c6XlU56bxkBpqxLKXkfcQtJxc3bCjrM=; b=A1FdIPE1Yyv1E6J3Vkhd+JRFMxCUXdzJtriei7gtoEhIroyNqBzPu6BZ2/A9jwwjCE KFEZ+Z2Ql679c7d9ig28CE17L2/6AfGQt3BcPW9n8vCqgGsPYwQQm7e3WufYeTzpVLha GO2jEDyw+FMi8hxhXgrNU5kzC7sY/l9e/1sibONVpFSqQKRAxK0GuMptq4JOCXfpKwap iyAeA+aLP/eKxNSZUtlbsMGu8kkuuXjsAQYKdsl/aNgxVpD2DUjzO0+VNCES7Jhfw6KL WmGnxweFNVIpnqcQl8UWY3K2BxlDjrZ5uEoufFguVYkQtSy48CeC4uVtCo4I6G6XBGnk X3WA== X-Gm-Message-State: ALKqPwcEtwto8iygekqYra+heDN45sO7zkpScu6p+ekMMSnFiGxv7ShK 8SXlAeZmduHSfH7Dnh5ysZx5TA== X-Received: by 2002:a62:d8c7:: with SMTP id e190-v6mr4107418pfg.161.1526017482208; Thu, 10 May 2018 22:44:42 -0700 (PDT) Received: from localhost ([122.167.163.112]) by smtp.gmail.com with ESMTPSA id q9-v6sm4238981pgs.5.2018.05.10.22.44.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 May 2018 22:44:41 -0700 (PDT) Date: Fri, 11 May 2018 11:14:39 +0530 From: Viresh Kumar To: Patrick Bellasi 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: <20180511054439.slrpscgm6ivho5qy@vireshk-i7> References: <20180510150553.28122-1-patrick.bellasi@arm.com> <20180510150553.28122-3-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180510150553.28122-3-patrick.bellasi@arm.com> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ? > 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