From patchwork Tue Jul 4 17:34:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Bellasi X-Patchwork-Id: 107009 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1252114qge; Tue, 4 Jul 2017 10:35:53 -0700 (PDT) X-Received: by 10.84.209.234 with SMTP id y97mr17376807plh.200.1499189753190; Tue, 04 Jul 2017 10:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499189753; cv=none; d=google.com; s=arc-20160816; b=yN4zLPj1McmUMtTsdrG/z+ITG6H0xaDF0w0Dka3Y4kxBl+EnRCOHg98HGtcl+HU3na +pITAuROOSPyNP/9htNF7/P970qP/ewP+BX8DpWGub8Zy7hkULVnPt1sdBvEGqUE8VWT 1GgBrFww5BkZylu435gjQ7mCG5bvxSogvmWe3CyuGEyafxKJaBaw6sBUL1oOJqt9kFpL 0xLmIqFikYhQwXpO6hc9RQAdqIP+I2IwopqzNYCWs6GZKbPH735DbeahNESSWGLu+xLp Dm2Z12vhBNK3cBuBQsYir5NbcBE+/APOU3Zz9VSK3EMCNr7VLhCcbGz2FqpdUDKocqKb V2hQ== 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=2hnwSAtn5CkdP9MPZgNFPN+hJkjjMl8xKhH+gf99q7E=; b=XCnGtP7FgC5d3z0S2DRyzik6mREV9+9g/Ix8T+2VAmnXl6qqa+8cVHuW9FIViY11g5 fA/CEAqgvYJENTLmGJxYceqZjTqyE/SZlG8tZgP+TrSkoVbNVBsTNNddBgT/fESdDxwL 5eRmu6xez3odudqZtR9GBgPiQPCECUvRlB/sGCnTgiXWjBHys9QNsBri64IToH5leIjp lOBkUmxy1Y5l4VvjXIE1YkZCyJnulDBebn5lHSuWq7DNhRytltDAruAiKzxy27V5w/+M Vk9gJrDA77Va60MpkoNy+HZGp/bWWEmTRy7NWl1KAphwP2LbQwV7w6sVw8FojckeZWLv W9Fg== 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 u133si14884536pgb.573.2017.07.04.10.35.52; Tue, 04 Jul 2017 10:35:53 -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 S1752341AbdGDRej (ORCPT + 25 others); Tue, 4 Jul 2017 13:34:39 -0400 Received: from foss.arm.com ([217.140.101.70]:48154 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752248AbdGDRei (ORCPT ); Tue, 4 Jul 2017 13:34:38 -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 7D20C164F; Tue, 4 Jul 2017 10:34:32 -0700 (PDT) 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 5E6A03F41F; Tue, 4 Jul 2017 10:34:30 -0700 (PDT) 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 , Juri Lelli , Joel Fernandes , Andres Oportus , Todd Kjos , Morten Rasmussen , Dietmar Eggemann Subject: [PATCH v2 4/6] cpufreq: schedutil: update CFS util only if used Date: Tue, 4 Jul 2017 18:34:09 +0100 Message-Id: <1499189651-18797-5-git-send-email-patrick.bellasi@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499189651-18797-1-git-send-email-patrick.bellasi@arm.com> References: <1499189651-18797-1-git-send-email-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 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 --- kernel/sched/cpufreq_schedutil.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.7.4 diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 98704d8..df433f1 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -308,10 +308,9 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, if (unlikely(current == sg_policy->thread)) return; - sugov_get_util(&util, &max); - raw_spin_lock(&sg_policy->update_lock); + sugov_get_util(&util, &max); sg_cpu->util = util; sg_cpu->max = max;