From patchwork Thu Nov 30 11:47:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Bellasi X-Patchwork-Id: 120145 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp558816qgn; Thu, 30 Nov 2017 03:48:02 -0800 (PST) X-Google-Smtp-Source: AGs4zMb2Po8w6XdEjcFpRnWXlyxGHWMq+6h6pp3EOJv0rSinBV/D+A3RdjqHKIWJuwJohWJGJCsF X-Received: by 10.99.2.23 with SMTP id 23mr2058388pgc.99.1512042481891; Thu, 30 Nov 2017 03:48:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512042481; cv=none; d=google.com; s=arc-20160816; b=Z1Ts85cy2x7mQPyKnbgth+ydCqS2L8/Z86kgGYPBqyxdXxpSPQPOjS9efmLTwxGEgZ UtR3bOrjzacBYrHjCxAamknHqflDLhhu+Xh+fwiIJnL3scS4IK2nmoyifIShywjsOvbQ /+Q+s1gTV/sca0ohJi9F8fFHjjyL5X9hpfYHEbFR70qHzbwBQHQJYVGM0FMHQgeOQYZI e8YAKcjjeiQNmJO5wcoh0XhwoCP2oa3LZKm/0bCwDVNtsDwxljKBt6wdlmOoOTG9wENf deIFaJqoxbzPFoQ678I5Y+5Z5x9KmBALUibnCKQlCTWQ9KGVSdddnbowu0oBcamyWsvn 7X4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=byrhcP4bLcxcFVGa5jRArDC5Hi0yLcrdvJf1Ge7lHNc=; b=oP+sHAxS4OMaPUj4P7jbBurHSapLQRcaol088LIMelM4JvVxXM/O7SqFiKOOkpJYhj 38nJzaowClzJ5MR6If+i5uhS1oiO6G34Zmch7Swb2bfVgPGzYCc+pllUcb4fUu1mMg/T YdkQ2kFC/b2Vzb0HGB/HllLePBtpFB7SLqTP3Qm643ReFsE9sFfvZm380iJhdBcCk9kQ wLgctIwWitsjxmmI9aPZLe5bwD/ccI/8d5qW/6TXRKck4/f5xvawi4Kf26iCnDyLY9/2 JR9LVVljK7X9TES9SiwCVY5ReFxDewADHRt/PP7iJm4clCdGsX3bzg43SjnAXzrdc2bu BbtQ== 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 y20si3150041pfa.158.2017.11.30.03.48.01; Thu, 30 Nov 2017 03:48:01 -0800 (PST) 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 S1752609AbdK3Lr7 (ORCPT + 26 others); Thu, 30 Nov 2017 06:47:59 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:51280 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752550AbdK3Lr4 (ORCPT ); Thu, 30 Nov 2017 06:47:56 -0500 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 9753A15BE; Thu, 30 Nov 2017 03:47:56 -0800 (PST) Received: from e110439-lin.cambridge.arm.com (e110439-lin.cambridge.arm.com [10.1.210.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 60E923F236; Thu, 30 Nov 2017 03:47:54 -0800 (PST) From: Patrick Bellasi To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes Subject: [PATCH v3 3/6] cpufreq: schedutil: update CFS util only if used Date: Thu, 30 Nov 2017 11:47:20 +0000 Message-Id: <20171130114723.29210-4-patrick.bellasi@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171130114723.29210-1-patrick.bellasi@arm.com> References: <20171130114723.29210-1-patrick.bellasi@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently the utilization of the FAIR class is collected before locking the policy. Although that should not be a big issue for most cases, we also don't really know how much latency there can be between the utilization reading and its usage. Let's get the FAIR utilization right before its usage to be better in sync with the current status of a CPU. Signed-off-by: Patrick Bellasi Reviewed-by: Dietmar Eggemann Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Viresh Kumar Cc: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org --- Changes from v2: - rebased on v4.15-rc1 Change-Id: I9291a560bcad7db76894e3f0fcdb917511d0479e --- kernel/sched/cpufreq_schedutil.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.14.1 Reviewed-by: Juri Lelli diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 448f49de5335..40521d59630b 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -351,10 +351,9 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, unsigned int next_f; bool rt_mode; - sugov_get_util(&util, &max, sg_cpu->cpu); - raw_spin_lock(&sg_policy->update_lock); + sugov_get_util(&util, &max, sg_cpu->cpu); sg_cpu->util = util; sg_cpu->max = max;